# Chicago Building Permits & Contractor Leads Scraper (`automation-lab/chicago-building-permits-scraper`) Actor

🏗️ Find newly issued Chicago permits and export official project, fee, property, owner, applicant, designer, and contractor details for leads and analysis.

- **URL**: https://apify.com/automation-lab/chicago-building-permits-scraper.md
- **Developed by:** [Stas Persiianenko](https://apify.com/automation-lab) (community)
- **Categories:** Lead generation, Real estate, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event + usage

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Chicago Building Permits & Contractor Leads Scraper

Turn Chicago's official building permit records into fresh construction intelligence and prospect lists.

This Apify Actor searches the City of Chicago Building Permits dataset, applies precise server-side filters, and exports one normalized permit per dataset row. Find newly issued solar, roofing, HVAC, electrical, demolition, renovation, and general construction projects without maintaining your own Socrata integration.

Each result can include the permit status and milestone, application and issue dates, address, work description, reported project cost, fee breakdown, ward, community area, PIN, coordinates, and every owner, applicant, design-professional, general-contractor, or electrical-contractor contact published by the city.

- 🏗️ Discover newly permitted projects.
- 👷 Identify named contractors and project contacts.
- 💵 Prioritize work by reported cost and fees.
- 📍 Segment activity by ward, community area, address, or contact ZIP.
- 🔁 Schedule the same query to build a recurring permit lead feed.
- 🔎 Look up a specific permit number for verification.

### What does this Chicago building permits scraper do?

The Actor queries Chicago's official public dataset `ydr8-5enu` through its Socrata API. It does not scrape a fragile visual page, require a login, or use a proxy.

You can search a rolling recent window or provide exact issue dates. Additional filters cover permit status, permit type, review type, work type, geography, reported project cost, and any of the five contact slots in the source.

Results are normalized for JSON, CSV, Excel, XML, RSS, and Parquet exports. Numeric values are emitted as numbers, dates use ISO timestamps, and contact slots become a consistent typed array.

### Who is it for?

#### Contractors and subcontractors

Find active projects that may need roofing, solar, HVAC, electrical, concrete, painting, landscaping, security, waste removal, or other services. Filter to a trade or minimum project value before sending records to a CRM.

#### Construction suppliers and service vendors

Track projects that may need materials, rentals, dumpsters, insurance, financing, inspections, or job-site services. Scheduled searches make it easy to review new permits every day or week.

#### Real-estate and construction analysts

Measure permit activity by date, ward, community area, work type, project value, and review process. Preserve the applied query and source URL for reproducible analysis.

#### Insurers, lenders, and due-diligence teams

Look up an address or permit number, review declared work and project cost, and identify the owner, applicant, designer, or contractor names published on the permit.

#### Civic-data developers

Use a stable Actor interface instead of implementing SoQL escaping, pagination, retries, normalization, Apify datasets, and integrations yourself.

### Why use this Actor?

- ✅ **Official source:** data comes directly from the City of Chicago open-data API.
- ✅ **Deep Chicago fields:** detailed fees, milestones, review types, contacts, PINs, census tracts, and coordinates are retained.
- ✅ **Useful filtering:** filters run on the source before records are transferred.
- ✅ **Typed output:** money, durations, ward values, and coordinates are numbers.
- ✅ **Auditable records:** every item includes the applied query, dataset ID, retrieval time, and direct source URL.
- ✅ **Automation ready:** run manually, through the API, on a schedule, by webhook, or through MCP.
- ✅ **No proxy setup:** the source is a public government API.

### What data can you extract?

| Data group | Example fields | How it helps |
|---|---|---|
| Permit identity | `permitNumber`, `permitStatus`, `permitMilestone` | Verify and track a permit |
| Classification | `permitType`, `reviewType`, `workType` | Segment projects and trades |
| Dates | `applicationStartDate`, `issueDate`, `processingTimeDays` | Monitor freshness and processing |
| Property | `address`, `ward`, `communityArea`, `pinList` | Route and map opportunities |
| Project | `workDescription`, `reportedCost` | Qualify project scope and value |
| Fees | paid, unpaid, waived, subtotals, `totalFee` | Analyze permit economics |
| Contacts | owner, applicant, designer, general/electrical contractor | Build source-backed lead context |
| Geography | census tract, latitude, longitude, projected coordinates | Map and aggregate activity |
| Provenance | `query`, `sourceDatasetId`, `sourceUrl`, `retrievedAt` | Audit and reproduce results |

The source usually provides names and mailing locality fields, not phone numbers or email addresses. This Actor does not invent or infer missing contact data.

### How much does it cost to scrape Chicago building permits?

Pricing is pay per event: a small run-start charge plus one charge for each permit saved. The exact amount appears in the Apify Console before a run and may vary by your Apify pricing tier.

The Actor uses a $0.005 start event. Formula-driven permit prices are $0.000027442 on FREE, $0.000023863 on BRONZE, $0.000018613 on SILVER, $0.000014318 on GOLD, and $0.00001 on PLATINUM or DIAMOND.

| Apify tier | Price per permit | 1,000 permits plus start |
|---|---:|---:|
| FREE | $0.000027442 | about $0.0324 |
| BRONZE | $0.000023863 | about $0.0289 |
| SILVER | $0.000018613 | about $0.0236 |
| GOLD | $0.000014318 | about $0.0193 |
| PLATINUM | $0.00001 | about $0.0150 |
| DIAMOND | $0.00001 | about $0.0150 |

A 20-permit first run is intentionally small. Use `maxItems` to cap spending, then increase it after checking the result density for your filters.

You are not charged a per-permit event for source rows that are not saved.

### How to scrape Chicago building permits

1. Open the Actor in Apify Console.
2. Leave dates empty to search permits issued in the rolling last 30 days, or choose a date range.
3. Optionally add status, permit type, work type, ward, cost, address, or contact filters.
4. Set **Maximum permits** to a small number for your first run.
5. Click **Start**.
6. Review the permit table in the default dataset.
7. Export results or connect the dataset to your downstream system.
8. Create an Apify schedule if you want a recurring fresh-permit feed.

For an exact lookup, enter `permitNumber`. The Actor then ignores the date range and searches that permit number directly.

### Input parameters

| Parameter | Type | Description |
|---|---|---|
| `permitNumber` | string | Exact Chicago permit number |
| `startDate` | string | Earliest issue date, `YYYY-MM-DD` |
| `endDate` | string | Latest issue date, `YYYY-MM-DD` |
| `permitStatus` | string[] | Exact official statuses |
| `permitType` | string[] | Exact official permit types |
| `workType` | string[] | Exact official work types |
| `reviewType` | string[] | Exact official review types |
| `ward` | string[] | Chicago ward numbers |
| `communityArea` | string[] | Official community area numbers |
| `addressText` | string | Case-insensitive street-address text |
| `contactZip` | string[] | ZIP in any published contact slot |
| `contactName` | string | Name text in any contact slot |
| `minReportedCost` | number | Minimum reported project cost |
| `maxReportedCost` | number | Maximum reported project cost |
| `maxItems` | integer | Maximum permits to save, 1–50,000 |

All active filter groups are combined with AND. Multiple values inside one list are combined as alternatives.

### Example inputs

#### Recent active permits

```json
{
  "permitStatus": ["ACTIVE"],
  "maxItems": 25
}
````

#### Solar permit leads

```json
{
  "permitStatus": ["ACTIVE"],
  "workType": ["Small-Scale Solar PV System"],
  "minReportedCost": 10000,
  "maxItems": 100
}
```

#### Exact permit lookup

```json
{
  "permitNumber": "B200477271",
  "maxItems": 1
}
```

#### Ward-based high-value monitor

```json
{
  "ward": ["1", "27", "42"],
  "minReportedCost": 1000000,
  "maxItems": 250
}
```

### Output example

```json
{
  "sourceRecordId": "N2915993",
  "permitNumber": "B200477271",
  "permitStatus": "ACTIVE",
  "permitMilestone": "INSPECTIONS",
  "permitType": "PERMIT – EXPRESS PERMIT PROGRAM",
  "reviewType": "EXPRESS PERMIT PROGRAM",
  "applicationStartDate": "2026-07-03T00:00:00.000",
  "issueDate": "2026-07-13T00:00:00.000",
  "processingTimeDays": 10,
  "address": "9038 S MARSHFIELD AVE",
  "city": "Chicago",
  "workType": "Small-Scale Solar PV System",
  "reportedCost": 48721,
  "totalFee": 300,
  "ward": 21,
  "communityArea": 73,
  "ownerName": "QUINCY JONES",
  "generalContractorName": "CERTIFIED ELECTRIC LLC",
  "electricalContractorName": "CERTIFIED ELECTRIC LLC",
  "contacts": [
    {
      "type": "OWNER",
      "name": "QUINCY JONES",
      "city": "CHICAGO",
      "state": "IL",
      "zipCode": "60620"
    }
  ],
  "sourceDatasetId": "ydr8-5enu",
  "sourceUrl": "https://data.cityofchicago.org/resource/ydr8-5enu.json?...",
  "retrievedAt": "2026-07-15T00:00:00.000Z"
}
```

Optional fields are omitted when Chicago's source row does not provide them.

### Contractor lead workflow

A practical recurring workflow is:

1. Choose one or more work types relevant to your service.
2. Add a recent issue-date range and `ACTIVE` status where appropriate.
3. Apply a minimum reported cost to prioritize larger projects.
4. Schedule the Actor daily or weekly.
5. Export `permitNumber`, address, description, cost, and contractor/contact fields.
6. Deduplicate downstream by `sourceRecordId` or `permitNumber`.
7. Review the official source before outreach.

Permit contacts are public-record context, not consent or a guarantee that a person wants marketing messages. Apply your own outreach and privacy rules.

### Tips for better results

- 🎯 Start with 25 records and inspect official spellings for work, permit, and review types.
- 📆 Use narrow date windows for recurring schedules so each run focuses on fresh activity.
- 💰 Combine `minReportedCost` with a work type to prioritize commercially relevant projects.
- 🧭 Use ward or community area filters for territory-based sales teams.
- 🔍 Use `addressText` without abbreviations when the source may spell streets differently.
- 👷 Search `contactName` when verifying a known contractor's permit activity.
- 🆔 Prefer exact `permitNumber` for one-record due diligence.
- 📦 Raise `maxItems` only after confirming that your query returns the desired records.

### Pagination and data freshness

Results are ordered by newest issue date and source row ID. The Actor reads the official API in bounded pages and stops at `maxItems`.

Chicago controls publication timing and corrections. A permit may be updated after it first appears, and status or milestone fields may change. Scheduled monitoring should use stable identifiers when comparing datasets.

A very large query can take longer and may observe upstream changes between pages. Narrow date windows are best for repeatable operational feeds.

### Integrations

#### Google Sheets and Excel

Export the dataset to CSV or XLSX, or connect Apify to a spreadsheet automation. Use one row per permit for filtering and territory assignment.

#### CRMs

Send successful run dataset items to HubSpot, Salesforce, Pipedrive, or another CRM through Make, Zapier, webhooks, or custom code. Map `permitNumber` as an external key to reduce duplicates.

#### Maps and BI tools

Load latitude, longitude, ward, community area, work type, and project cost into Tableau, Power BI, Looker Studio, QGIS, or a warehouse.

#### Alerts and scheduling

Run the Actor on an Apify schedule and send a webhook when new results are ready. A downstream step can compare permit IDs and notify a territory owner.

### Run with the Apify API

Replace `YOUR_APIFY_TOKEN` with your token.

#### Node.js

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/chicago-building-permits-scraper').call({
  permitStatus: ['ACTIVE'],
  minReportedCost: 100000,
  maxItems: 100,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
from apify_client import ApifyClient
import os

client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('automation-lab/chicago-building-permits-scraper').call(run_input={
    'permitStatus': ['ACTIVE'],
    'minReportedCost': 100000,
    'maxItems': 100,
})
items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)
```

#### cURL

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/automation-lab~chicago-building-permits-scraper/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"permitStatus":["ACTIVE"],"minReportedCost":100000,"maxItems":100}'
```

### Use with MCP and AI assistants

Connect the Actor to Claude Code:

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=automation-lab/chicago-building-permits-scraper"
```

For Claude Desktop, Cursor, or VS Code, add this MCP server configuration:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=automation-lab/chicago-building-permits-scraper"
    }
  }
}
```

Example prompts:

- “Find up to 50 active Chicago solar permits from the last 30 days and summarize project costs.”
- “Look up permit B200477271 and list every contractor and applicant.”
- “Monitor high-value permits in wards 1, 27, and 42 and prepare a CRM import.”
- “Map recent permits by community area and work type.”

### Data quality and limitations

- The Actor only returns fields published in Chicago's official dataset.
- Contact slots usually contain names and mailing locality, not phone or email.
- `contactZip` refers to contact mailing ZIPs; the source does not expose a dedicated property ZIP field.
- Official labels and spellings can change as Chicago updates its schema.
- Some permits omit cost, coordinates, contacts, or fee components.
- A contact name may represent a person or company exactly as entered in the source.
- The Actor does not enrich, score, validate, or infer permit data.
- Upstream maintenance or anonymous API rate limits can temporarily delay a run.

### Is it legal to scrape Chicago building permits?

The Actor reads a public government open-data API. Public availability does not remove your responsibility to follow applicable laws, contractual obligations, privacy requirements, and outreach rules.

Use permit and contact information for legitimate purposes. Do not treat a public-record name or address as consent for unsolicited communication. Avoid sensitive profiling, harassment, discrimination, or automated decisions that require additional legal safeguards.

This documentation is general information, not legal advice.

### Troubleshooting

#### Why did my run return no permits?

The exact combination may have no matching source rows. Remove filters one at a time, check date order, and verify official capitalization/spelling for list filters. Try a small unfiltered recent run first.

#### Why is a contact phone or email missing?

Chicago's permit dataset does not normally publish those fields. The Actor preserves official contact names, types, cities, states, and ZIP codes but does not fabricate enrichment.

#### Why was my input rejected?

Dates must use `YYYY-MM-DD`; the start date cannot be later than the end date; and minimum project cost cannot exceed maximum project cost.

#### Why did a large run slow down?

The public API may rate-limit bursts. The Actor retries temporary errors with backoff. Narrow the issue-date range or lower `maxItems` for faster recurring jobs.

### Frequently asked questions

#### Does it support permit-number lookup?

Yes. Set `permitNumber` to an exact Chicago permit number. Date filters are intentionally ignored for that lookup.

#### Does it cover Cook County or other cities?

No. This Actor is intentionally optimized for the City of Chicago dataset. It does not claim equivalent fields or coverage outside that source.

#### Can I schedule it?

Yes. Apify schedules are ideal for daily or weekly fresh-permit monitoring. Use stable IDs to deduplicate downstream.

#### Are all contacts contractors?

No. Contacts are typed by the source and may include owners, web applicants, design professionals, general contractors, electrical contractors, or other roles.

#### Can I export to CSV or Excel?

Yes. Open the dataset after a run and choose CSV, XLSX, JSON, XML, RSS, or another supported format.

#### Is a proxy required?

No. The Actor uses Chicago's public Socrata API directly.

### Source and provenance

The source dataset is [City of Chicago Building Permits](https://data.cityofchicago.org/d/ydr8-5enu). Every output row includes:

- the official dataset identifier;
- the SoQL filter applied by the Actor;
- a direct API URL for the permit;
- the retrieval timestamp.

These fields help reviewers verify a record and help data teams reproduce a collection rule.

### Related Automation Lab actors

- [Plumber Lead Scraper](https://apify.com/automation-lab/plumber-lead-scraper) — find plumbing-business leads when you need company discovery rather than permit records.
- [Business Address Scraper](https://apify.com/automation-lab/business-address-scraper) — enrich a business list with public address context.
- [Google Maps Lead Finder](https://apify.com/automation-lab/google-maps-lead-finder) — discover local service businesses across many categories and locations.

Choose this Actor when the official Chicago permit is the core record and source-backed project details matter most.

### Support

If a valid Chicago permit appears in the official dataset but is missing or incorrectly normalized, open an issue from the Actor page. Include a small input, the permit number when available, and the run ID so the behavior can be reproduced.

# Actor input Schema

## `permitNumber` (type: `string`):

Look up one exact Chicago permit number, for example B200477271. When set, date filters are ignored.

## `startDate` (type: `string`):

Include permits issued on or after this date (YYYY-MM-DD). If both dates are empty, the Actor searches the last 30 days.

## `endDate` (type: `string`):

Include permits issued on or before this date (YYYY-MM-DD).

## `permitStatus` (type: `array`):

Keep exact official statuses, such as ACTIVE or INACTIVE. Leave empty for all statuses.

## `permitType` (type: `array`):

Keep exact official permit types, such as PERMIT – EXPRESS PERMIT PROGRAM.

## `workType` (type: `array`):

Keep exact official work types, such as Small-Scale Solar PV System.

## `reviewType` (type: `array`):

Keep exact official review types, such as EXPRESS PERMIT PROGRAM.

## `ward` (type: `array`):

Keep Chicago ward numbers as strings, for example 21.

## `communityArea` (type: `array`):

Keep official Chicago community area numbers, for example 73.

## `addressText` (type: `string`):

Find permits whose street address contains this text, for example MARSHFIELD.

## `contactZip` (type: `array`):

Keep permits where any owner, applicant, designer, or contractor contact has one of these ZIP codes.

## `contactName` (type: `string`):

Search all owner, applicant, design-professional, and contractor name slots case-insensitively.

## `minReportedCost` (type: `number`):

Keep permits with a reported project cost at or above this USD amount.

## `maxReportedCost` (type: `number`):

Keep permits with a reported project cost at or below this USD amount.

## `maxItems` (type: `integer`):

Stop after saving this many permit records. Use a small value for a quick first run.

## Actor input object example

```json
{
  "maxItems": 20
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/chicago-building-permits-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "maxItems": 20 }

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/chicago-building-permits-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "maxItems": 20
}' |
apify call automation-lab/chicago-building-permits-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=automation-lab/chicago-building-permits-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Chicago Building Permits & Contractor Leads Scraper",
        "description": "🏗️ Find newly issued Chicago permits and export official project, fee, property, owner, applicant, designer, and contractor details for leads and analysis.",
        "version": "0.1",
        "x-build-id": "Yk4kULwiB0IqOYOym"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/automation-lab~chicago-building-permits-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-automation-lab-chicago-building-permits-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/automation-lab~chicago-building-permits-scraper/runs": {
            "post": {
                "operationId": "runs-sync-automation-lab-chicago-building-permits-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/automation-lab~chicago-building-permits-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-automation-lab-chicago-building-permits-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "permitNumber": {
                        "title": "Permit number",
                        "type": "string",
                        "description": "Look up one exact Chicago permit number, for example B200477271. When set, date filters are ignored."
                    },
                    "startDate": {
                        "title": "Issued on or after",
                        "type": "string",
                        "description": "Include permits issued on or after this date (YYYY-MM-DD). If both dates are empty, the Actor searches the last 30 days."
                    },
                    "endDate": {
                        "title": "Issued on or before",
                        "type": "string",
                        "description": "Include permits issued on or before this date (YYYY-MM-DD)."
                    },
                    "permitStatus": {
                        "title": "Permit statuses",
                        "type": "array",
                        "description": "Keep exact official statuses, such as ACTIVE or INACTIVE. Leave empty for all statuses.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "permitType": {
                        "title": "Permit types",
                        "type": "array",
                        "description": "Keep exact official permit types, such as PERMIT – EXPRESS PERMIT PROGRAM.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "workType": {
                        "title": "Work types",
                        "type": "array",
                        "description": "Keep exact official work types, such as Small-Scale Solar PV System.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "reviewType": {
                        "title": "Review types",
                        "type": "array",
                        "description": "Keep exact official review types, such as EXPRESS PERMIT PROGRAM.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "ward": {
                        "title": "Wards",
                        "type": "array",
                        "description": "Keep Chicago ward numbers as strings, for example 21.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "communityArea": {
                        "title": "Community areas",
                        "type": "array",
                        "description": "Keep official Chicago community area numbers, for example 73.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "addressText": {
                        "title": "Address contains",
                        "type": "string",
                        "description": "Find permits whose street address contains this text, for example MARSHFIELD."
                    },
                    "contactZip": {
                        "title": "Contact ZIP codes",
                        "type": "array",
                        "description": "Keep permits where any owner, applicant, designer, or contractor contact has one of these ZIP codes.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "contactName": {
                        "title": "Contact or contractor name contains",
                        "type": "string",
                        "description": "Search all owner, applicant, design-professional, and contractor name slots case-insensitively."
                    },
                    "minReportedCost": {
                        "title": "Minimum reported project cost",
                        "minimum": 0,
                        "type": "number",
                        "description": "Keep permits with a reported project cost at or above this USD amount."
                    },
                    "maxReportedCost": {
                        "title": "Maximum reported project cost",
                        "minimum": 0,
                        "type": "number",
                        "description": "Keep permits with a reported project cost at or below this USD amount."
                    },
                    "maxItems": {
                        "title": "Maximum permits",
                        "minimum": 1,
                        "maximum": 50000,
                        "type": "integer",
                        "description": "Stop after saving this many permit records. Use a small value for a quick first run.",
                        "default": 20
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
