# Building Permit History Scraper - Address Lookup | $15/1k (`rickyz1x/permit-history-scraper`) Actor

Permit history for any contractor license, company, phone or address across 6 US cities, plus WA license, insurance & bond status. HTTP API + MCP server.

- **URL**: https://apify.com/rickyz1x/permit-history-scraper.md
- **Developed by:** [ZHANG RUIQI](https://apify.com/rickyz1x) (community)
- **Categories:** Lead generation, Real estate, MCP servers
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $15.00 / 1,000 lookups

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## Building Permit History Scraper - Address Lookup

Look up the building-permit history of a contractor (license number, company name or phone) or a job-site address across 6 US open-data portals, plus Washington license, insurance and bond status, as a batch run, an HTTP API or an MCP tool.

### Sample output

| Query | Permits | By category | Last issued | Charged |
|---|---|---|---|---|
| Base Power | 6 | battery_storage 6 | 2026-11-05 | yes ($0.015) |
| Vikta Energy | 2 | solar 2 | 2026-11-05 | yes ($0.015) |
| South Texas Solar Systems | 1 | solar 1 | 2026-11-04 | yes ($0.015) |
| Now Energy LLC | 1 | solar 1, roofing 1 | 2026-11-04 | yes ($0.015) |

*Real rows: demo mode (`useFixtures: true`): official portal data recorded 2026-11-06. The Output section below documents every field.*

### Pricing (pay per event)

| Event | Charged when | Price per event | Per 1,000 |
|---|---|---:|---:|
| `lookup` (primary) | once per lookup that matched at least one permit or license | $0.015 | $15 |
| `apify-actor-start` | once per run (Apify platform start event) | $0.00005 | - |

| Example run | Events charged at most | Cost at most |
|---|---|---:|
| Console prefill or API default (1 lookup) | 1 x `lookup` | $0.015 |
| 1,000 matched lookups | 1,000 x `lookup` | $15.00 |

Never charged: lookups with no match; invalid queries; Standby requests refused with HTTP 402 because your max charge is reached.

Set **Max cost per run** (`maxTotalChargeUsd` in the API) to cap any run. The Actor checks the budget before every charge and stops cleanly when it is reached; add-on data that no longer fits is withheld, never given away. If the budget is below the price of a single record, the run delivers one free sample row and says so in its status message.

### Try it: copy-paste input

This is the Console prefill (the same input the Example run table prices):

```json
{
  "queries": [
    {
      "contractorName": "Sunrun"
    }
  ],
  "sources": [
    "austin_tx",
    "san_diego_ca"
  ]
}
```

### Use it from the API, MCP or n8n

Run it and get the dataset in one call (the `maxTotalChargeUsd` query parameter caps what this run can cost):

```bash
curl -X POST "https://api.apify.com/v2/acts/rickyz1x~permit-history-scraper/run-sync-get-dataset-items?maxTotalChargeUsd=0.50" \
  -H "Authorization: Bearer $APIFY_TOKEN" -H "Content-Type: application/json" \
  -d '{"queries":[{"contractorName":"Sunrun"}],"sources":["austin_tx","san_diego_ca"]}'
```

Real-time lookups (Standby): `GET https://rickyz1x--permit-history-scraper.apify.actor/lookup?contractorName=Sunrun` with the same `Authorization: Bearer` header. MCP clients connect to `https://rickyz1x--permit-history-scraper.apify.actor/mcp`.

- **AI agents (MCP):** add `https://mcp.apify.com/?actors=rickyz1x/permit-history-scraper` to Claude, Cursor or any MCP client.
- **n8n, Make, Clay:** importable templates with record limits and a max-cost cap are in the [workflow templates repository](https://github.com/Ricky-X1Z/us-permit-contractor-workflows).

### How it works

Send a contractor license number, company name, phone or job-site address and get back the permit history: counts by job type (solar, battery storage, roofing, HVAC, EV charger, ADU, pool), first and last permit dates, the exact number of matching permits, the most recent permits, and, for Washington contractors, license status, insurance expiration and bond cancellation from WA L\&I. The selected portals are queried in parallel under a 25-second deadline. It works as a batch run, a real-time HTTP API (Standby) and an MCP tool.

### Typical uses

- **Clay enrichment:** add *license status · insurance expiry · 12-month permit volume · top job category* to any contractor list.
- **AI agents (MCP):** answer questions like "show permits pulled by this contractor in the last year" or "is their insurance current?"
- **Lead qualification and vetting:** check a contractor's real install volume before you partner with them or lend to them.
- **Address history:** see what has been permitted at a property, such as solar, a re-roof or an ADU.

### Lookup keys

| Key | Searches |
|---|---|
| `licenseNumber` | WA L\&I (profile + Seattle permits), CA CSLB (San Diego County, LA legacy), NYC DOB permittee license |
| `contractorName` | Contractor/company fields on all sources (case-insensitive, legal suffixes ignored) + WA L\&I name match |
| `phone` | Permit feeds that publish contractor phones (Austin, San Diego County, NYC BIS) + WA L\&I |
| `address` | Job-site address (house number + street) |

### Real-time API (Standby)

```bash
curl -H "Authorization: Bearer $APIFY_TOKEN" \
  "https://rickyz1x--permit-history-scraper.apify.actor/lookup?contractorName=Example%20Solar&monthsBack=12"
```

`POST /lookup` accepts the same fields as a JSON body. Standby requests without `sources` search all six jurisdictions; add `&sources=austin_tx,san_diego_ca` to restrict them. The response looks like this (synthetic values):

```json
{
  "query": {"contractorName": "Example Solar"},
  "window": {"since": "2025-11-07", "until": "2026-11-07", "months_back": 12},
  "matched": true,
  "license": null,
  "permits_summary": {"total": 142, "sampled": 142, "last_12_months": 142, "by_category": {"solar": 120, "battery_storage": 61},
                      "by_source": {"austin_tx": 142},
                      "top_contractors": [{"company_name": "Example Solar LLC", "permits": 142,
                                           "name_variants": ["Example Solar LLC", "EXAMPLE SOLAR"]}],
                      "first_issued": "2025-11-10", "last_issued": "2026-11-05", "valuation_usd_total": 3120000.0},
  "recent_permits": ["…v1 permit records…"],
  "charged": true,
  "errors": {},
  "elapsed_s": 6.9
}
```

`license` is filled for WA contractors:

```json
{"license_number": "EXAMPLS800XX", "license_state": "WA", "license_status": "ACTIVE",
 "license_expiration_date": "2027-05-02", "insurance_expiration_date": "2026-11-21",
 "bond_cancel_date": null, "phone_e164": "+12065550100"}
```

### MCP (Claude Desktop, Cursor, any MCP client)

The Standby server exposes a Streamable-HTTP MCP endpoint at `/mcp` with one tool, `permit_history_lookup`:

```json
{
  "mcpServers": {
    "permit-history": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://rickyz1x--permit-history-scraper.apify.actor/mcp",
               "--header", "Authorization: Bearer ${APIFY_TOKEN}"],
      "env": {"APIFY_TOKEN": "YOUR_APIFY_API_TOKEN"}
    }
  }
}
```

More snippets, plus the Clay HTTP-column setup, are in `templates/clay/`.

### Batch mode

Run the Actor with `queries`. Each query produces one dataset item. The batch default searches Austin and San Diego County (the fast demo); pass `sources` to search all six:

```json
{"queries": [{"contractorName": "Example Solar"}, {"licenseNumber": "1000000"}, {"address": "1234 MAIN ST"}],
 "sources": ["austin_tx", "san_diego_ca", "nyc_dob", "seattle_wa", "los_angeles_ca", "chicago_il"],
 "monthsBack": 12, "maxPermitsPerLookup": 10}
```

### Coverage

Measured live on 2026-11-07 over permits issued 2026-10-08 … 2026-11-07 (volume = exact count; fill rates = the 300 most recent permits per source run through the full pipeline).

| Source | Permits (30 d) | Contractor name | Phone | License # | ≥1 job category | Phone comes from |
|---|---:|---:|---:|---:|---:|---|
| Austin, TX | 4,975 | 87% | 87% | 0% | 26% | permit feed |
| San Diego County (unincorporated), CA | 913 | 80% | 80% | 80% | 57% | permit feed + CSLB sidecar |
| New York City, NY | 15,026 | 100% | 92% | 100% | 5% | BIS feed + license join |
| Seattle, WA | 526 | 4% | 0% | 0% | 7% | WA L\&I name match |
| Los Angeles, CA | 4,756 | 0% | 0% | 0% | 33% | n/a (CSLB join in V1.1) |
| Chicago, IL | 2,683 | 97% | 0% | 0% | 12% | n/a (name only) |

Volume-weighted contractor-phone fill across all sources: **65%**. Spec extractor precision on the golden set: **100.0%** (208 labeled real descriptions).

WA L\&I (Actor #2): 76,335 active contractors (100% with phone); next 30 days: 3,790 insurance policies expire, 157 bonds cancel, 1,175 active licenses expire.

### Compliance notice

**B2B use only.**

- The data comes from official government open-data portals.
- **No homeowner or owner names are returned.**
- **You, the buyer, are solely responsible** for complying with the TCPA, the National Do-Not-Call Registry, state telemarketing laws and CAN-SPAM before contacting anyone.
- This is not legal advice.

### Limitations and coverage

- Six jurisdictions: Austin TX, San Diego County CA (unincorporated), New York City, Seattle WA, Los Angeles CA and Chicago IL, plus Washington L\&I for license, insurance and bond status. The coverage table above shows which fields each portal publishes.
- Lookups run live against the official portals. Measured from our test host on 2026-11-10: 7-13 s for the default Austin + San Diego County demo; searching all six returns at the 25-second deadline, because the New York City portal is often slower, and names the sources that did not answer in time in `errors` (the rest of the answer is still returned).
- `permits_summary.total` is an exact server-side count. The `by_category`, `by_source` and `top_contractors` breakdowns cover the most recent few hundred permits returned; `top_contractors` merges spelling variants of the same company and lists them in `name_variants`.
- Los Angeles contractor names and licenses are only available for permits issued before May 2023, because the city stopped publishing that table.
- If one source fails, the lookup still succeeds; the failure is reported in `errors`.

### Companion B2B & Lead Generation Actors by RickyZ1X

| Actor | Best for | Apify Store link |
| :--- | :--- | :--- |
| **Building Permits Scraper - Contractor Leads & Phone** | New permits with contractor phone and parsed job specs (6 US portals) | [rickyz1x/building-permits-scraper](https://apify.com/rickyz1x/building-permits-scraper) |
| **Contractor License Scraper - Insurance & Bond Expiry** | WA contractors with expiring insurance, bonds or licenses | [rickyz1x/contractor-license-scraper](https://apify.com/rickyz1x/contractor-license-scraper) |
| **Building Permit History Scraper - Address Lookup** | Permit history by contractor, phone or address (HTTP API + MCP) (this Actor) | [rickyz1x/permit-history-scraper](https://apify.com/rickyz1x/permit-history-scraper) |
| **Career Site Jobs Scraper - Greenhouse, Lever, Ashby** | Open jobs and hiring signals from 6 ATS platforms | [rickyz1x/career-site-jobs-scraper](https://apify.com/rickyz1x/career-site-jobs-scraper) |
| **Google Ads Transparency Scraper - Ad Library & Leads** | Which domains run Google Ads, with advertiser and creatives | [rickyz1x/google-ads-scraper](https://apify.com/rickyz1x/google-ads-scraper) |
| **Keyword Search Volume & CPC Scraper - Google & Bing** | Modeled search volume, CPC, difficulty and intent from autocomplete | [rickyz1x/keyword-volume-scraper](https://apify.com/rickyz1x/keyword-volume-scraper) |
| **Product Hunt & YC Scraper - Startup & Founder Leads** | New Product Hunt, YC and Show HN startups with founders and contacts | [rickyz1x/product-hunt-scraper](https://apify.com/rickyz1x/product-hunt-scraper) |
| **Tech Stack & Pixel Scraper - BuiltWith Alternative** | Technologies, ad pixels, GTM IDs and Shopify data for any website | [rickyz1x/tech-stack-scraper](https://apify.com/rickyz1x/tech-stack-scraper) |
| **Luma, Eventbrite & Meetup Scraper - Organizer Leads** | Upcoming events with organizer, host and sponsor leads | [rickyz1x/luma-events-scraper](https://apify.com/rickyz1x/luma-events-scraper) |

# Actor input Schema

## `contractorName` (type: `string`):

Single lookup by company name (case-insensitive, legal suffixes ignored).

## `licenseNumber` (type: `string`):

WA L\&I (e.g. ABCDEF\*123AB style), CA CSLB number (San Diego County, LA legacy) or NYC DOB license.

## `address` (type: `string`):

Street address starting with the house number, e.g. 1234 MAIN ST.

## `phone` (type: `string`):

US phone number in any format.

## `queries` (type: `array`):

Array of objects, each with any of licenseNumber, contractorName, address, phone. One dataset item per query; a query is charged $0.015 only when it matches at least one permit or license. Identical queries in one run are looked up (and charged) once.

## `sources` (type: `array`):

Official open-data permit feeds to search, queried in parallel (25 s overall deadline; a slow portal is reported in errors). The demo default is Austin + San Diego County; all six are selectable.

## `monthsBack` (type: `integer`):

Look back window in months for matching permits.

## `maxPermitsPerLookup` (type: `integer`):

Maximum number of individual permit records attached to each lookup response.

## `useFixtures` (type: `boolean`):

For testing integrations: returns a recorded, privacy-scrubbed sample instead of live data.

## Actor input object example

```json
{
  "queries": [
    {
      "contractorName": "Sunrun"
    }
  ],
  "sources": [
    "austin_tx",
    "san_diego_ca"
  ],
  "monthsBack": 12,
  "maxPermitsPerLookup": 25,
  "useFixtures": false
}
```

# Actor output Schema

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

All output records stored in the default dataset.

# 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 = {
    "queries": [
        {
            "contractorName": "Sunrun"
        }
    ],
    "sources": [
        "austin_tx",
        "san_diego_ca"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rickyz1x/permit-history-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 = {
    "queries": [{ "contractorName": "Sunrun" }],
    "sources": [
        "austin_tx",
        "san_diego_ca",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("rickyz1x/permit-history-scraper").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 '{
  "queries": [
    {
      "contractorName": "Sunrun"
    }
  ],
  "sources": [
    "austin_tx",
    "san_diego_ca"
  ]
}' |
apify call rickyz1x/permit-history-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rickyz1x/permit-history-scraper"
        }
    }
}
```

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/W25talDkM8LHepF1D/builds/ugRKGUcaLlbg6tl7y/openapi.json
