# Building Permit Lead Finder & Scorer (`orkanaltinsoy/permit-contractor-lead-enricher`) Actor

Turns raw building permits from 8 US cities into scored, trade-classified contractor leads. Filter by trade (roofing, HVAC, plumbing, electrical, solar, remodel...), get A/B/C tiered leads with valuation, recency and contact signals.

- **URL**: https://apify.com/orkanaltinsoy/permit-contractor-lead-enricher.md
- **Developed by:** [Orkan Altınsoy](https://apify.com/orkanaltinsoy) (community)
- **Categories:** Lead generation, Real estate
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $15.00 / 1,000 qualified leads

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/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.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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

## Building Permit Lead Finder & Scorer

Stop scrolling raw permit lists. This Actor scans **fresh building permits across 8 major US cities**, classifies them by trade, scores every lead 0-100, and delivers only the ones worth your time.

### Who is this for?

**Suppliers & service providers** (building materials, equipment rental, dumpsters, insurance, financing): get active job sites with **contractor name and phone**, sorted by project value.

**Contractors** (roofing, HVAC, plumbing, electrical, solar, remodel): find high-value projects **without an assigned contractor** — homeowners and GCs who still need subs, the week the permit drops.

### How scoring works

Each lead gets a transparent 0-100 score and tier (A/B/C):

| Signal | Points |
|---|---|
| Project valuation ($10K → $500K+) | up to 40 |
| Recency (issued last 7 days scores highest) | up to 30 |
| Contractor identified + phone (supplier mode) | up to 25 |
| No contractor assigned yet (contractor mode) | 20 |
| Trade matched from official permit type | 10 |

Every score comes with human-readable reasons — no black box.

### Example output

```json
{
  "lead_score": 82, "lead_tier": "A",
  "trade_primary": "roofing",
  "lead_reasons": ["valuation $148,000 (+32)", "issued 3d ago (+30)", "contractor identified (+15)", "..."],
  "city": "austin", "issued_date": "2026-06-09",
  "address": "4512 Duval St", "valuation": 148000,
  "contractor_name": "LONE STAR ROOFING", "contractor_phone": "512-555-0148",
  "work_description": "Full roof replacement, composition shingle"
}
````

### Cities & data quality

Austin (contractor+phone ~90%), Seattle (valuations 100%), Denver, Chicago, NYC, SF, LA, Fort Worth. Official city open-data sources, refreshed daily by most cities. Trade classification is deterministic (keyword rules on official permit types + descriptions) — no AI hallucinations in your lead list.

### Tips

- Schedule it **daily** with `daysBack: 7` — fresh A-tier leads in your inbox/CRM every morning (works with Google Sheets, webhooks, Make/Zapier/n8n integrations)
- Start with `minScore: 50` (B+ leads only) to keep volume manageable
- Supplier mode + Austin/Denver = leads with direct phone numbers

### Pricing

Pay per qualified lead delivered — scanning and filtering is free; you only pay for leads that pass your score threshold.

# Actor input Schema

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

Cities to scan for leads.

## `trades` (type: `array`):

Which trades to find leads for.

## `mode` (type: `string`):

supplier: you sell products/services TO contractors (leads with contractor name+phone score higher). contractor: you ARE a contractor looking for jobs (permits without an assigned contractor score higher).

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

Scan permits issued in the last N days.

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

Skip permits below this project value (records with missing valuation are kept).

## `minScore` (type: `integer`):

Only deliver leads at/above this score. 70+=A, 50+=B, 30+=C.

## `maxLeads` (type: `integer`):

Best-scoring leads are delivered first.

## `maxPermitsPerCity` (type: `integer`):

Safety cap on how many raw permits are scanned per city before filtering. Scanning is free — you only pay for delivered leads.

## `socrataAppToken` (type: `string`):

Free token raises rate limits for heavy runs.

## Actor input object example

```json
{
  "cities": [
    "austin",
    "seattle",
    "denver_res",
    "chicago"
  ],
  "trades": [
    "roofing",
    "hvac",
    "plumbing",
    "electrical",
    "remodel"
  ],
  "mode": "supplier",
  "daysBack": 14,
  "minValuation": 0,
  "minScore": 30,
  "maxLeads": 1000,
  "maxPermitsPerCity": 3000
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("orkanaltinsoy/permit-contractor-lead-enricher").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("orkanaltinsoy/permit-contractor-lead-enricher").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 '{}' |
apify call orkanaltinsoy/permit-contractor-lead-enricher --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=orkanaltinsoy/permit-contractor-lead-enricher",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Building Permit Lead Finder & Scorer",
        "description": "Turns raw building permits from 8 US cities into scored, trade-classified contractor leads. Filter by trade (roofing, HVAC, plumbing, electrical, solar, remodel...), get A/B/C tiered leads with valuation, recency and contact signals.",
        "version": "0.1",
        "x-build-id": "nsbPWCxv7CfdRQmdH"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/orkanaltinsoy~permit-contractor-lead-enricher/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-orkanaltinsoy-permit-contractor-lead-enricher",
                "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/orkanaltinsoy~permit-contractor-lead-enricher/runs": {
            "post": {
                "operationId": "runs-sync-orkanaltinsoy-permit-contractor-lead-enricher",
                "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/orkanaltinsoy~permit-contractor-lead-enricher/run-sync": {
            "post": {
                "operationId": "run-sync-orkanaltinsoy-permit-contractor-lead-enricher",
                "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": {
                    "cities": {
                        "title": "Cities",
                        "type": "array",
                        "description": "Cities to scan for leads.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "chicago",
                                "austin",
                                "seattle",
                                "nyc_bis",
                                "nyc_dobnow",
                                "sf",
                                "la",
                                "denver_res",
                                "fortworth"
                            ],
                            "enumTitles": [
                                "Chicago, IL",
                                "Austin, TX",
                                "Seattle, WA",
                                "New York City (BIS)",
                                "New York City (DOB NOW)",
                                "San Francisco, CA",
                                "Los Angeles, CA",
                                "Denver, CO (residential)",
                                "Fort Worth, TX"
                            ]
                        },
                        "default": [
                            "austin",
                            "seattle",
                            "denver_res",
                            "chicago"
                        ]
                    },
                    "trades": {
                        "title": "Trades",
                        "type": "array",
                        "description": "Which trades to find leads for.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "roofing",
                                "hvac",
                                "plumbing",
                                "electrical",
                                "solar",
                                "remodel",
                                "pool",
                                "demolition",
                                "new_construction",
                                "fence_deck"
                            ],
                            "enumTitles": [
                                "Roofing",
                                "HVAC / Mechanical",
                                "Plumbing",
                                "Electrical",
                                "Solar / Battery",
                                "Remodel / Addition",
                                "Pool / Spa",
                                "Demolition",
                                "New construction",
                                "Fence / Deck"
                            ]
                        },
                        "default": [
                            "roofing",
                            "hvac",
                            "plumbing",
                            "electrical",
                            "remodel"
                        ]
                    },
                    "mode": {
                        "title": "Lead mode",
                        "enum": [
                            "supplier",
                            "contractor"
                        ],
                        "type": "string",
                        "description": "supplier: you sell products/services TO contractors (leads with contractor name+phone score higher). contractor: you ARE a contractor looking for jobs (permits without an assigned contractor score higher).",
                        "default": "supplier"
                    },
                    "daysBack": {
                        "title": "Days back",
                        "minimum": 1,
                        "maximum": 365,
                        "type": "integer",
                        "description": "Scan permits issued in the last N days.",
                        "default": 14
                    },
                    "minValuation": {
                        "title": "Minimum valuation (USD)",
                        "type": "integer",
                        "description": "Skip permits below this project value (records with missing valuation are kept).",
                        "default": 0
                    },
                    "minScore": {
                        "title": "Minimum lead score (0-100)",
                        "minimum": 0,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Only deliver leads at/above this score. 70+=A, 50+=B, 30+=C.",
                        "default": 30
                    },
                    "maxLeads": {
                        "title": "Max leads to deliver",
                        "minimum": 1,
                        "maximum": 50000,
                        "type": "integer",
                        "description": "Best-scoring leads are delivered first.",
                        "default": 1000
                    },
                    "maxPermitsPerCity": {
                        "title": "Max permits scanned per city",
                        "minimum": 100,
                        "maximum": 100000,
                        "type": "integer",
                        "description": "Safety cap on how many raw permits are scanned per city before filtering. Scanning is free — you only pay for delivered leads.",
                        "default": 3000
                    },
                    "socrataAppToken": {
                        "title": "Socrata app token (optional)",
                        "type": "string",
                        "description": "Free token raises rate limits for heavy runs."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
