# Multi-State Licensed Contractor & Trade Leads Scraper (`apex-b2b-data/state-contractor-licenses-leads`) Actor

Extract verified trade contractor leads (HVAC/AC, Electricians, Plumbers, General Contractors, Elevators, Towing) from official state licensing registries (Texas TDLR and Washington L\&I). Includes business names, owner/principal names, direct phone numbers, full addresses, license status, expiration

- **URL**: https://apify.com/apex-b2b-data/state-contractor-licenses-leads.md
- **Developed by:** [George Barnes](https://apify.com/apex-b2b-data) (community)
- **Categories:** Lead generation, 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

from $1.05 / 1,000 results

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

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

## State Contractor & Trade Licenses Leads Scraper (`$1.50 / 1K`)

**Extract verified, active trade contractors and licensed commercial specialists (HVAC/Air Conditioning, Electricians, Plumbers, General Contractors, Elevators, Tow Trucks, Appliance Installers) directly from official state licensing registries.**

This Actor queries official state occupational and contractor licensing registries powered by Socrata open-data portals:

1. **Texas Department of Licensing & Regulation (TDLR)** — Dataset `7358-krk7` on `data.texas.gov`. Covers A/C Contractors, Technicians, Electrical Contractors, Journeymen, Apprentice Electricians, Elevator Contractors, Towing Companies, Appliance Installers, and CE Providers.
2. **Washington State Department of Labor & Industries (L\&I)** — Dataset `m8qx-ubtq` on `data.wa.gov`. Covers Construction Contractors, General Contractors, HVAC/R Mechanics, Electrical Contractors, Plumbing, Glazing, Demolition, and Specialty Trades.

Every contractor lead is automatically normalized with **verified E.164 phone numbers**, **CRM-ready display formatting `(XXX) XXX-XXXX`**, **standardized street addresses, cities, and ZIP codes**, **license status validation**, **renewal urgency (days until expiration)**, and an algorithmic **0–100 B2B Contractor Lead Score**.

***

### Why Choose This Contractor Licenses Actor? (Comparison)

| Capability | This Actor | Google Maps / YellowPages Scrapers | Manual State Licensing Search | Legacy B2B Contact Databases |
| :--- | :--- | :--- | :--- | :--- |
| **Pricing per 1,000 Records** | **`$1.50 / 1K` (`$0.0015` / record)** | `$3.00 – $6.00 / 1K` + proxy fees | Free (hours of manual labor) | `$100 – $500 / 1K` (minimum commit) |
| **Official License Verification** | ✅ Verified state license # on record | ❌ No license data | ✅ Yes (1-by-1 manual search) | ❌ Self-reported or outdated |
| **Direct Phone Number Formatting** | ✅ E.164 (`+1...`) & `(XXX) XXX-XXXX` | ⚠️ Raw phone or call center switchboard | ⚠️ Unformatted raw strings | ⚠️ Frequently stale or missing |
| **Principal / Owner Name Included** | ✅ Individual owner or qualifying master | ❌ Generic contact page scraping | ⚠️ Buried in PDF / detail modals | ⚠️ Often wrong gatekeeper |
| **License Expiration & Renewal Urgency** | ✅ Auto-calculated `days_until_expiration` | ❌ No | ⚠️ Raw date strings only | ❌ No |
| **Trade & Specialty Classification** | ✅ Exact state trade classifications | ⚠️ Guessed from website keywords | ✅ Yes | ⚠️ Broad NAICS/SIC codes |
| **Stateful Deduplication (`monitorMode`)**| ✅ Built-in Apify Key-Value store | ❌ No | ❌ No | ❌ Requires custom database |
| **Zero Residential Proxy Overhead** | **`$0.00` (Direct public API queries)**| High proxy and CAPTCHA cost | Manual CAPTCHA limits | Subscription lock-in |

***

### Transparent Pricing (`$1.50` per 1,000 Leads)

You are charged **only for contractor leads actually returned** (`$0.0015` per record via Apify Pay-Per-Event), with zero upfront commitments or subscription tiers:

| Workflow | Records Returned | Total Cost |
| :--- | :--- | :--- |
| **Quick Test Run** (verify data quality and schema) | `20` leads | **`$0.03` (3 cents)** |
| **Daily License Expiration / Renewal Feed** | `~200` leads / day | **`$0.30 / day` (`~$9 / month`)** |
| **Targeted Metro Trade Pull** (e.g. Houston HVAC) | `1,000` leads | **`$1.50`** |
| **Full Regional TAM Export** (Texas + Washington) | `10,000` leads | **`$15.00`** |

***

### High-Intent B2B Playbooks (Copy-Paste JSON Inputs)

#### 1. HVAC & Refrigeration Contractors in Texas (Equipment, Wholesale & Tool Distributors)

Target licensed Air Conditioning & Refrigeration (A/C) contractors across Texas with verified telephone numbers and physical shop addresses:

```json
{
  "state": "TX",
  "licenseType": "A/C",
  "requirePhone": true,
  "activeOnly": true,
  "limit": 500
}
```

#### 2. Commercial Surety, Bonding & Insurance Brokers (Urgent Expirations Within 90 Days)

Find contractors whose state license requires renewal in the next 90 days. These contractors must prove active surety bonding and general liability insurance to renew their credentials with the state:

```json
{
  "state": "ALL",
  "licenseType": "General",
  "requirePhone": true,
  "activeOnly": true,
  "limit": 1000
}
```

#### 3. Washington State General & Specialty Construction Contractors (Subcontractor & Staffing Recruitment)

Extract licensed construction contractors in Washington State (Seattle, Spokane, Tacoma, Vancouver) with active credentials and direct owner/principal names:

```json
{
  "state": "WA",
  "licenseType": "CONSTRUCTION CONTRACTOR",
  "requirePhone": true,
  "activeOnly": true,
  "limit": 500
}
```

#### 4. Daily Automated Lead Pipeline (Stateful Monitor Mode)

Schedule daily runs to extract only net-new licensed trade contractors without re-downloading previously seen leads:

```json
{
  "state": "ALL",
  "licenseType": "Electrician",
  "requirePhone": true,
  "activeOnly": true,
  "monitorMode": true,
  "monitorStoreName": "daily-electrician-contractor-leads",
  "limit": 250
}
```

***

### Sample Output Record

```json
{
  "license_number": "1715",
  "state": "TX",
  "license_type": "A/C CE Provider",
  "business_name": "EASYLR 24 ONLINE TRAINING SCHOOL INC",
  "owner_name": "EASYLR 24 ONLINE TRAINING SCHOOL INC",
  "phone_number": "(210) 485-1491",
  "street_address": "10042 TEZEL RD",
  "city": "SAN ANTONIO",
  "zip_code": "78254",
  "expiration_date": "2026-12-02",
  "license_status": "ACTIVE",
  "b2b_lead_score": 100,
  "extracted_at": "2026-11-04T00:21:55.564682+00:00",
  "phone_formatted": "(210) 485-1491",
  "phone_e164": "+12104851491",
  "license_subtype": "A/C Contractor",
  "county": "BEXAR",
  "days_until_expiration": 28,
  "is_active": true,
  "lead_segments": [
    "VERIFIED_PHONE",
    "ACTIVE_LICENSE",
    "VERIFIED_ADDRESS",
    "UPCOMING_RENEWAL"
  ],
  "source_registry": "TX_TDLR"
}
```

***

### Integration Code Snippets

#### 1. REST API / cURL (Clay.com, n8n, Make.com)

Run the Actor synchronously and retrieve the dataset items in one HTTP call:

```bash
curl -X POST "https://api.apify.com/v2/acts/YOUR_USERNAME~state-contractor-licenses-leads/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "state": "TX",
    "licenseType": "A/C",
    "requirePhone": true,
    "limit": 50
  }'
```

#### 2. Python (Apify Client SDK)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run_input = {
    "state": "TX",
    "licenseType": "Electrician",
    "requirePhone": True,
    "activeOnly": True,
    "limit": 100,
}

run = client.actor("YOUR_USERNAME/state-contractor-licenses-leads").call(run_input=run_input)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"Contractor: {item['business_name']} | Phone: {item['phone_number']} | Trade: {item['license_type']} | Score: {item['b2b_lead_score']}")
```

#### 3. Standalone CLI Execution (Zero Apify Dependency)

```bash
## Clone the repository
git clone https://github.com/YOUR_USERNAME/state-contractor-licenses-leads.git
cd state-contractor-licenses-leads

## Run directly with Python 3.10+
python3 src/main.py

## Results will be saved to:
## storage/datasets/default/results.json
```

#### 4. Model Context Protocol (MCP) Tool Definition

Integrate this Actor directly into Claude Desktop, Cursor, or your AI Agent workflow via MCP:

```json
{
  "mcpServers": {
    "state-contractor-licenses": {
      "command": "python3",
      "args": ["-m", "src.main"],
      "env": {
        "ACTOR_INPUT_PATH": "input.json"
      }
    }
  }
}
```

# Actor input Schema

## `state` (type: `string`):

Select state registry to query: TX (Texas TDLR), WA (Washington State L\&I), or ALL.

## `licenseType` (type: `string`):

Trade or license type to search (e.g. 'A/C', 'Electrician', 'Elevator', 'Tow', 'General', 'Plumbing', 'ALL').

## `city` (type: `string`):

Optional city name to filter (e.g. 'Houston', 'Dallas', 'Austin', 'Seattle', 'Spokane').

## `county` (type: `string`):

Optional county name (e.g. 'Harris', 'Dallas', 'Travis', 'Bexar', 'King').

## `businessName` (type: `string`):

Optional keyword to match against contractor business or DBA name.

## `requirePhone` (type: `boolean`):

Only return contractor leads with a direct phone number on file.

## `activeOnly` (type: `boolean`):

Filter for currently active and unexpired contractor licenses.

## `limit` (type: `integer`):

Maximum number of contractor leads to extract.

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

Alias for limit parameter.

## `monitorMode` (type: `boolean`):

Persist seen license numbers to an Apify Key-Value store to prevent duplicates on recurring runs.

## `monitorStoreName` (type: `string`):

Named Key-Value Store used for stateful deduplication.

## Actor input object example

```json
{
  "state": "TX",
  "licenseType": "A/C",
  "city": "",
  "county": "",
  "businessName": "",
  "requirePhone": true,
  "activeOnly": true,
  "limit": 10,
  "maxItems": 10,
  "monitorMode": false,
  "monitorStoreName": "contractor-seen-licenses"
}
```

# Actor output Schema

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

Structured JSON records produced by Multi-State Licensed Contractor & Trade Leads Scraper 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 = {
    "state": "TX",
    "licenseType": "A/C",
    "limit": 10,
    "maxItems": 10,
    "monitorStoreName": "contractor-seen-licenses"
};

// Run the Actor and wait for it to finish
const run = await client.actor("apex-b2b-data/state-contractor-licenses-leads").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 = {
    "state": "TX",
    "licenseType": "A/C",
    "limit": 10,
    "maxItems": 10,
    "monitorStoreName": "contractor-seen-licenses",
}

# Run the Actor and wait for it to finish
run = client.actor("apex-b2b-data/state-contractor-licenses-leads").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 '{
  "state": "TX",
  "licenseType": "A/C",
  "limit": 10,
  "maxItems": 10,
  "monitorStoreName": "contractor-seen-licenses"
}' |
apify call apex-b2b-data/state-contractor-licenses-leads --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,apex-b2b-data/state-contractor-licenses-leads"
        }
    }
}
```

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/qfTS6goLrefaTZHIk/builds/mHmNPCeiQsRIWX4P6/openapi.json
