# California Contractor Directory by Trade & County (CSLB) (`scrapebench/california-contractor-directory`) Actor

Every licensed California contractor in a county by trade — license #, business, contact, classifications, bond & workers' comp — from the official CSLB registry.

- **URL**: https://apify.com/scrapebench/california-contractor-directory.md
- **Developed by:** [ScrapeBench](https://apify.com/scrapebench) (community)
- **Categories:** Lead generation, Real estate
- **Stats:** 53 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.002 / dataset-item

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## California Contractor Directory by Trade & County (CSLB)

### Pain points

- CSLB's data portal does export contractors, but only 10 classifications x 10 counties at a time, as a manual .xls download you cannot put on a schedule.
- Building a contractor lead list by trade means manual searching and copy-paste.
- Raw registry pages aren't structured for a CRM, outreach tool, or analysis.

### What we solve

- Pull every licensed contractor in a California county, filtered by trade, in one run.
- Clean, structured rows: business, contact, license status, classifications, bond, workers' comp.
- Straight from the official CSLB registry — ready for lead-gen, CRM import, or market sizing.
- Pay per result; no charge for empty runs.

### Summary

Pull every licensed contractor in a California county by trade — business name, contact details, license status, classifications, bond, and workers' comp — straight from the official CSLB registry. One run returns a clean, structured list ready for lead generation, CRM import, license verification, or market analysis.

### Who it's for

- B2B sales and lead-gen teams targeting California trades
- Suppliers, SaaS, insurers, and lenders building prospect lists
- Agencies running outreach campaigns by trade and county
- Market researchers sizing the California contractor market

### How to use

Set the input, run the actor, and collect results from the run's dataset (export to JSON/CSV/Excel, or pull via the Apify API). Example input:

```json
{
  "licenseClass": "C-10",
  "county": "Los Angeles",
  "maxResults": 1000
}
```

See **Inputs** below for every available field.

### What you get

One row per record:

| Field | Description |
|---|---|
| `license_number` | CSLB license number |
| `business_name` | Licensed business name |
| `business_type` | Sole Owner, Corporation, LLC, Partnership… |
| `address` | Business street address |
| `city` | City |
| `county` | County |
| `zip_code` | ZIP code |
| `phone` | Business phone |
| `classifications` | All classification codes held (e.g. \["A","C10"]) |
| `status` | License status (e.g. CLEAR) |
| `issue_date` | Original license issue date |
| `expiration_date` | License expiration date |
| `surety_company` | Contractor bond surety company |
| `bond_number` | Contractor bond number |
| `workers_comp_type` | Workers' comp coverage type (Insurance / Exempt / …) |
| `workers_comp_company` | Workers' comp insurance carrier |
| `source_url` | Link to the official CSLB license detail page |

Sample:

```json
{
  "license_number": "22726",
  "business_name": "RANSOME COMPANY",
  "business_type": "Corporation",
  "address": "1933 WILLIAMS STREET",
  "city": "SAN LEANDRO",
  "county": "Alameda",
  "zip_code": "94577",
  "phone": "(510) 686 9900",
  "classifications": [
    "A",
    "C10"
  ],
  "status": "CLEAR",
  "issue_date": "07/01/1932",
  "expiration_date": "10/31/2027",
  "surety_company": "HARCO NATIONAL INSURANCE COMPANY",
  "bond_number": "354811",
  "workers_comp_type": "Workers' Compensation Insurance",
  "workers_comp_company": "TRAVELERS PROPERTY CASUALTY COMPANY OF AMERICA",
  "source_url": "https://www.cslb.ca.gov/onlineservices/checklicenseII/LicenseDetail.aspx?LicNum=22726"
}
```

### Inputs

| Field | Required | Type | Default | Description |
|---|---|---|---|---|
| `listCountiesOnly` | no | boolean | `false` | If true, skip the scrape and just return every valid California county name (from the live CSLB form) as the dataset. Free — not charged. Use this to look up the exact county spelling before running a real scrape. |
| `licenseClass` | no | string | `"C-10"` | CSLB classification code, e.g. 'B' (General Building), 'C-10' (Electrical), 'C-36' (Plumbing). Returns every active contractor holding this classification in the chosen county. Required unless 'Discovery Mode' is on. |
| `licenseClasses` | no | array | `["C-10", "C-20"]` | Pull several trades in ONE run, e.g. C-10 and C-20 and C-36. Combined with 'License classification' if you fill both. Every selected trade is fetched for every selected county, and a contractor holding two of them is returned (and billed) once, not twice. |
| `county` | no | string | `"Sacramento"` | Full California county name, e.g. 'Los Angeles', 'Sacramento', 'Orange'. Required unless 'Discovery Mode' is on. |
| `counties` | no | array | `["Sacramento", "Placer"]` | Pull several counties in ONE run, e.g. Los Angeles and Orange and San Diego. Combined with 'County' if you fill both. Use Discovery Mode to list every valid county name first. |
| `maxResults` | no | integer | — | Cap on the number of license records returned PER trade+county download, not per run — so adding counties can never silently truncate the ones later in the list. Leave empty to return all matches. |
| `proxyConfiguration` | no | object | `{"useApifyProxy": false}` | Optional. CSLB is usually reachable directly; enable a proxy (e.g. residential) only if runs return no data because the IP is blocked. |

### Pricing (Pay Per Event)

You pay per result (`dataset-item`) — **no charge for empty runs**. Example: **500 C-10 electricians in Los Angeles County** at *$0.002/result* ≈ **$1.00**.

Illustrative — the final per-result price is set at publish time. Apify platform usage (compute) is billed separately per your plan.

### Use cases

- B2B lead lists — suppliers, SaaS, and insurers target licensed electricians, plumbers, or builders by county.
- Agency outreach — pull a county-by-trade list, score it, and export to a CRM for campaigns.
- Market sizing — segment the California contractor market by classification and county.
- List enrichment — add license, bond, and workers'-comp data to contractors you already track.

### Why this actor

- Bulk export by trade + county — not one-license-at-a-time lookups.
- Clean, structured, CRM-ready rows straight from the official CSLB registry.
- Pay per result; empty runs are free.

### Limitations & updates

Covers California's CSLB public registry only (public record under Business & Professions Code §7000 et seq.). Results reflect the live registry and change as it updates. One run can cover several classifications and counties at once (every trade is pulled for every county).

### FAQ

**What does one run return?**

Every active licensed contractor in the chosen California county for the chosen license class/trade — business, contact, classifications, bond, and workers' comp.

**Where's the data from?**

The official California CSLB registry — public license records.

**How do I target a trade?**

Use the `licenseClass` input (e.g. C-10 electrical, B general building, C-36 plumbing) plus the `county`.

**How am I charged?**

Pay-per-result — you only pay for the contractor rows returned, and empty runs are free.

**Is this lead data compliant?**

It's public, non-personal business-license data from CSLB — not consumer or PII data.

**How fresh is it?**

It reflects the live CSLB registry at run time.

### Which actor to choose

Part of the California CSLB contractor suite — pick the one that fits your goal:

- **California Contractor Directory by Trade & County (CSLB)** *(this actor)* — You want a bulk lead list — every licensed contractor of a given trade (classification) in a county, in one run.
- **California Contractor License Lookup & Verify (CSLB)** — You want to verify or look up specific contractors — by license number, business name, or a person's name (owner/personnel).

### Guides & use cases

Written up on **[scrapebench.dev](https://scrapebench.dev)** — the bench that runs and verifies this actor against the live source every night:

- **How-to:** [How to run California Contractor Directory by Trade & County (CSLB)](https://scrapebench.dev/guides/how-to-california-contractor-directory/)
- **Use case:** [All Licensed Electricians in Los Angeles County](https://scrapebench.dev/use-cases/los-angeles-electricians-c10/)
- **Use case:** [General Building Contractors in San Diego County](https://scrapebench.dev/use-cases/san-diego-general-building-contractors/)
- **Use case:** [Plumbing Contractors in Orange County](https://scrapebench.dev/use-cases/orange-county-plumbers-c36/)

More actors, coverage and nightly verification results: **[scrapebench.dev](https://scrapebench.dev)**

# Actor input Schema

## `listCountiesOnly` (type: `boolean`):

If true, skip the scrape and just return every valid California county name (from the live CSLB form) as the dataset. Free — not charged. Use this to look up the exact county spelling before running a real scrape.

## `licenseClass` (type: `string`):

CSLB classification code, e.g. 'B' (General Building), 'C-10' (Electrical), 'C-36' (Plumbing). Returns every active contractor holding this classification in the chosen county. Required unless 'Discovery Mode' is on.

## `licenseClasses` (type: `array`):

Pull several trades in ONE run, e.g. C-10 and C-20 and C-36. Combined with 'License classification' if you fill both. Every selected trade is fetched for every selected county, and a contractor holding two of them is returned (and billed) once, not twice.

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

Full California county name, e.g. 'Los Angeles', 'Sacramento', 'Orange'. Required unless 'Discovery Mode' is on.

## `counties` (type: `array`):

Pull several counties in ONE run, e.g. Los Angeles and Orange and San Diego. Combined with 'County' if you fill both. Use Discovery Mode to list every valid county name first.

## `maxResults` (type: `integer`):

Cap on the number of license records returned PER trade+county download, not per run — so adding counties can never silently truncate the ones later in the list. Leave empty to return all matches.

## `proxyConfiguration` (type: `object`):

Optional. CSLB is usually reachable directly; enable a proxy (e.g. residential) only if runs return no data because the IP is blocked.

## Actor input object example

```json
{
  "listCountiesOnly": false,
  "licenseClass": "C-10",
  "licenseClasses": [
    "C-10",
    "C-20"
  ],
  "county": "Sacramento",
  "counties": [
    "Sacramento",
    "Placer"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `contractors` (type: `string`):

The full contractor list — license #, business, contact, classifications, bond and workers' comp.

# 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 = {
    "licenseClass": "C-10",
    "licenseClasses": [
        "C-10",
        "C-20"
    ],
    "county": "Sacramento",
    "counties": [
        "Sacramento",
        "Placer"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapebench/california-contractor-directory").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 = {
    "licenseClass": "C-10",
    "licenseClasses": [
        "C-10",
        "C-20",
    ],
    "county": "Sacramento",
    "counties": [
        "Sacramento",
        "Placer",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("scrapebench/california-contractor-directory").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 '{
  "licenseClass": "C-10",
  "licenseClasses": [
    "C-10",
    "C-20"
  ],
  "county": "Sacramento",
  "counties": [
    "Sacramento",
    "Placer"
  ]
}' |
apify call scrapebench/california-contractor-directory --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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