# Building Permits Feed: US City Open Data (`sapphire_studio/building-permits-feed`) Actor

Fresh building permits from 25 US city and county open-data portals in one format: permit number, work class (roof, solar, HVAC, pool, ADU, new homes), description, valuation, issue date, address, coordinates, contractor. Date range, filters, only-new mode for daily lead feeds.

- **URL**: https://apify.com/sapphire_studio/building-permits-feed.md
- **Developed by:** [Sapphire Studio](https://apify.com/sapphire_studio) (community)
- **Categories:** Real estate, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 permit delivereds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What this Actor does

Building Permits Feed collects freshly issued building permits from the official open-data portals of 25 US cities and counties and returns them in one normalized format. Pick the cities, a date window and optional filters; get one row per permit with the permit number, type, a normalized work class (roof, solar, HVAC, pool, ADU, new homes and more), description, valuation, issue date, street address, ZIP, coordinates, and the contractor's business name where the city publishes it.

Every city publishes permits differently: different portals (Socrata, CKAN, Carto, ArcGIS), different column names, text dates, money as strings, filler values such as "TBD". This Actor does the mapping for you, so a permit from Chicago and a permit from Raleigh look the same in your spreadsheet or CRM.

#### Who it is for

- Roofing, solar, HVAC, pool, window, siding and remodeling contractors looking for homeowners who just pulled a permit, and the suppliers and distributors who sell to those contractors.
- Generator, EV charger and home-service companies watching for matching work.
- Construction-tech and proptech teams that need a clean permit feed without maintaining 25 integrations.
- Real estate investors and analysts tracking new construction, ADUs, demolitions and renovation activity by neighborhood.

#### Built for daily lead feeds

Turn on **Only new since the last run** and schedule the Actor daily. Each run returns only permits that earlier runs with the same feed name have not delivered yet, so you are never charged twice for the same permit. Use different feed names for different schedules (for example `roofing-austin` and `solar-bay-area`).

### How to use it

1. Choose one or more cities in **Cities and counties**.
2. Set the window with **Issued in the last N days** (default 30) or with explicit **Issued from** and **Issued to** dates.
3. Optionally filter by **Work classes**, **Keywords** and **Minimum valuation**.
4. Set **Max permits per city** and start the run. Permits come newest first.

Example input (the prefill), which finishes in a few seconds:

```json
{
  "cities": ["austin-tx", "seattle-wa"],
  "maxItemsPerCity": 20
}
```

A roofing lead feed for the last week:

```json
{
  "cities": ["chicago-il", "austin-tx", "philadelphia-pa", "boston-ma"],
  "daysBack": 7,
  "workClasses": ["roof"],
  "maxItemsPerCity": 500,
  "onlyNewSinceLastRun": true,
  "feedName": "roofing-weekly"
}
```

### Input

| Field | Type | Description |
|---|---|---|
| `cities` | array of city IDs | Required. The datasets to read (see the list below). |
| `daysBack` | integer | Permits issued in the last N days, counting today. Default 30. |
| `dateFrom` | date | First issue date to include (YYYY-MM-DD). Overrides `daysBack`. |
| `dateTo` | date | Last issue date to include. Defaults to today; future dates are capped at today. |
| `workClasses` | array | Keep only permits whose primary `work_class` is one of these. |
| `keywords` | array of strings | Keep only permits whose type or description contains one of these phrases. |
| `minValuation` | integer | Keep only permits with a declared valuation of at least this many US dollars. |
| `maxItemsPerCity` | integer | Maximum permits per city, newest first. Default 200, maximum 5000. |
| `onlyNewSinceLastRun` | boolean | Skip permits already delivered by earlier runs with the same feed name. |
| `feedName` | string | Name of the memory used by the option above. Default `default`. |
| `maxConcurrency` | integer | Cities read in parallel (Advanced). Default 4. |
| `debug` | boolean | Saves the first raw record of each city to the key-value store (Advanced). |

#### Supported cities and counties

| City ID | Name | Portal |
|---|---|---|
| `austin-tx` | Austin, TX | Socrata |
| `chicago-il` | Chicago, IL | Socrata |
| `new-york-ny` | New York, NY (DOB NOW approved permits) | Socrata |
| `los-angeles-ca` | Los Angeles, CA | Socrata |
| `san-francisco-ca` | San Francisco, CA | Socrata |
| `seattle-wa` | Seattle, WA | Socrata |
| `new-orleans-la` | New Orleans, LA | Socrata |
| `cincinnati-oh` | Cincinnati, OH | Socrata |
| `mesa-az` | Mesa, AZ | Socrata |
| `montgomery-county-md` | Montgomery County, MD (residential) | Socrata |
| `montgomery-county-md-commercial` | Montgomery County, MD (commercial) | Socrata |
| `baton-rouge-la` | Baton Rouge (East Baton Rouge Parish), LA | Socrata |
| `cambridge-ma` | Cambridge, MA | Socrata |
| `orlando-fl` | Orlando, FL | Socrata |
| `norfolk-va` | Norfolk, VA | Socrata |
| `marin-county-ca` | Marin County, CA | Socrata |
| `corona-ca` | Corona, CA | Socrata |
| `college-station-tx` | College Station, TX | Socrata |
| `everett-wa` | Everett, WA | Socrata |
| `collin-county-tx` | Collin County, TX (all cities, via the appraisal district) | Socrata |
| `pierce-county-wa` | Pierce County, WA (unincorporated) | Socrata |
| `san-diego-county-ca` | San Diego County, CA (unincorporated) | Socrata |
| `boston-ma` | Boston, MA | CKAN |
| `philadelphia-pa` | Philadelphia, PA | Carto |
| `raleigh-nc` | Raleigh, NC | ArcGIS |

### Output

One row per permit, always with the same keys in the same order. Unknown values are `null`. A real ok row from a live run (Chicago, 25 cities run):

```json
{
  "city_id": "chicago-il",
  "city": "Chicago",
  "state": "IL",
  "status": "ok",
  "ok": true,
  "error": null,
  "permit_number": "B200517228",
  "permit_type": "EXPRESS PERMIT PROGRAM",
  "permit_subtype": "Reroofing",
  "work_class": "roof",
  "work_tags": ["roof"],
  "description": "SCOPE: ROOF REPLACEMENT. AREA: 2870 SQ. FT. ROOF COVERING: BUILT-UP ROOF. LOCATION: ROOFING AREA. IL ROOFING CONTRACTOR LICENSE: 104018154.",
  "permit_status": "ACTIVE",
  "property_use": null,
  "valuation": 157000,
  "square_feet": null,
  "housing_units": null,
  "applied_date": "2026-10-23",
  "issued_date": "2026-10-23",
  "address": "1834 E 71ST ST",
  "address_city": "Chicago",
  "zip": null,
  "latitude": 41.7663141197481,
  "longitude": -87.5798801125784,
  "contractor_name": "DMG HOME SERVICES LLC",
  "contractor_license": null,
  "permit_url": null,
  "source_portal": "socrata",
  "source_dataset": "https://data.cityofchicago.org/resource/ydr8-5enu.json",
  "checked_at": "2026-10-27T00:55:33.576Z",
  "attempts": 1,
  "fetch_mode": "api"
}
```

When a city returns nothing, you get one status row for it instead, so every requested city is accounted for. A real failed row from a live run (pool and solar permits, last 7 days):

```json
{
  "city_id": "cambridge-ma",
  "city": "Cambridge",
  "state": "MA",
  "status": "not_found",
  "ok": false,
  "error": "No permits issued 2026-10-21 to 2026-10-27 matched the filters (191 records checked).",
  "permit_number": null,
  "work_class": null,
  "source_portal": "socrata",
  "source_dataset": "https://data.cambridgema.gov/resource/3wsm-e5jx.json",
  "checked_at": "2026-10-27T00:56:19.308Z",
  "attempts": 1,
  "fetch_mode": "api"
}
```

(The remaining permit fields of that row are `null` and omitted here for brevity.)

#### Work classes

`work_class` is the primary class; `work_tags` lists every class that matched, primary first. Classes: `new_residential`, `new_commercial`, `adu`, `demolition`, `solar`, `pool`, `roof`, `hvac`, `generator`, `ev_charger`, `windows_doors`, `siding`, `fire_protection`, `electrical`, `plumbing`, `sign`, `fence`, `addition_alteration`, `other`. The class comes from the permit type, the work type and the description, plus structured flags some cities publish (ADU, solar, EV and re-roof flags). A passing mention ("floors 1, 2 and roof") only adds a tag; the primary class needs the permit type or an explicit scope such as "re-roof" or "roof replacement".

#### Status values

| Status | Meaning | Charged |
|---|---|---|
| `ok` | One permit. | Yes |
| `not_found` | The city had no matching permits in the window, or none that are new since the last run. | No |
| `invalid_input` | The city entry was not recognized (the input form normally prevents this). | No |
| `blocked` | The portal kept refusing or rate-limiting requests. | No |
| `timeout` | The run time limit was reached before or while reading this city. | No |
| `charge_limit_reached` | The maximum charge per run was reached. | No |
| `error` | The portal returned an error, for example after a dataset change. | No |

A run summary (counts by status, window, filters, per-city statistics) is saved as `SUMMARY` in the run's key-value store.

### Pricing

Pay per event: you pay for each delivered permit (event `permit`, one per `ok` row). Status rows for empty, failed or skipped cities are free. Set **Maximum charge per run** in the run options to cap your spend; the Actor stops cleanly when it is reached and lists the remaining cities as `charge_limit_reached`.

### Limitations

- Coverage is the 25 datasets above. Cities publish with a lag of one to several days, so "today" is often empty.
- Fields depend on what each city publishes: Los Angeles, San Francisco and Boston do not publish contractor names; Collin County and San Diego County do not publish coordinates; Cambridge publishes no descriptions or valuations.
- Seattle rarely publishes a contractor name: only about 6% of Seattle permits had one in our October 2026 test runs. Use other cities if contractor names matter to you.
- With filters, at most 50,000 records are scanned per city per run.
- The work class is a text-based classification; check `work_tags` and `description` for edge cases.
- Measured on the platform: 1,000 permits from all 25 cities in 25 seconds with 100% ok rows; the prefill run takes about 3 seconds.

### FAQ

**Do I need an API key or a proxy?** No. All sources are free official open-data APIs, so the Actor uses no proxy at all.

**Why does a permit have no contractor?** The city does not publish it, or the work is owner-builder. Contractor phone numbers, emails and addresses are never output.

**Can you add my city?** Yes, open an issue with the portal link. Cities on Socrata, CKAN, Carto or ArcGIS are quick to add.

### Legal disclaimer

This Actor is not affiliated with, endorsed by or sponsored by any of the cities, counties or portal vendors listed. City and product names are trademarks of their owners. It reads publicly available government open data only; no login. Owner, applicant and tenant names are never output, nor are any phone numbers or email addresses. You are responsible for using permit data in line with the terms of each portal and with applicable marketing laws (for example do-not-call and CAN-SPAM rules).

### Support

Open an issue on the Actor's Issues tab with the run ID and the input that did not work.

Built and maintained by Sapphire Studio.

# Changelog

This Actor's version history is a separate document: https://apify.com/sapphire_studio/building-permits-feed/changelog.md

# Actor input Schema

## `cities` (type: `array`):

The permit datasets to read, one per city or county. Every row carries the city_id, so you can mix several in one run. Unknown entries produce one invalid_input row each and are never charged.

## `daysBack` (type: `integer`):

Permits issued in the last N days, counting today. Ignored when "Issued from" is filled in.

## `dateFrom` (type: `string`):

Optional. First issue date to include (YYYY-MM-DD). Overrides "Issued in the last N days".

## `dateTo` (type: `string`):

Optional. Last issue date to include (YYYY-MM-DD). Defaults to today; future dates are capped at today.

## `workClasses` (type: `array`):

Optional. Keep only permits whose primary work_class is one of these, for example roof or solar. Leave empty for all permits. The class is derived from the permit type and description; every match is also listed in work_tags.

## `keywords` (type: `array`):

Optional. Keep only permits whose type or description contains at least one of these words or phrases (case-insensitive), for example "generator" or "heat pump".

## `minValuation` (type: `integer`):

Optional. Keep only permits with a declared job valuation of at least this many US dollars. Permits without a valuation are dropped when this is set.

## `maxItemsPerCity` (type: `integer`):

Maximum number of permits returned for each city, newest first. Only rows with status ok are charged.

## `onlyNewSinceLastRun` (type: `boolean`):

For scheduled lead feeds: skip permits that an earlier run with the same feed name already delivered. The first run returns the whole date window.

## `feedName` (type: `string`):

Used with "Only new since the last run" to keep separate memories for separate schedules, for example roofing-austin. Letters, digits, - and \_ only.

## `maxConcurrency` (type: `integer`):

Number of cities read in parallel. Each city is read one page at a time to stay well within the portals' fair-use limits.

## `debug` (type: `boolean`):

When enabled, the first raw record of each city is saved to the run's key-value store for troubleshooting. The dataset rows are the same either way.

## Actor input object example

```json
{
  "cities": [
    "austin-tx",
    "seattle-wa"
  ],
  "daysBack": 30,
  "maxItemsPerCity": 20,
  "onlyNewSinceLastRun": false,
  "feedName": "default",
  "maxConcurrency": 4,
  "debug": false
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset items: one row per permit, plus one row per city that returned nothing or failed.

## `summary` (type: `string`):

Counts by status, the date window and filters used, and per-city statistics.

# 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 = {
    "cities": [
        "austin-tx",
        "seattle-wa"
    ],
    "maxItemsPerCity": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("sapphire_studio/building-permits-feed").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 = {
    "cities": [
        "austin-tx",
        "seattle-wa",
    ],
    "maxItemsPerCity": 20,
}

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

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

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

```

## CLI example

```bash
echo '{
  "cities": [
    "austin-tx",
    "seattle-wa"
  ],
  "maxItemsPerCity": 20
}' |
apify call sapphire_studio/building-permits-feed --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,sapphire_studio/building-permits-feed"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/MswyHpV2JPAsO2UDe/builds/fwQq4B1dpgZjGMtqx/openapi.json
