# California Contractor Directory by Trade & County (CSLB) (`fried_calamaries/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/fried\_calamaries/california-contractor-directory.md
- **Developed by:** [ByteMe](https://apify.com/fried_calamaries) (community)
- **Categories:** Lead generation, Real estate
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, NaN 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 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

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

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.

### 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 |
|---|---|---|---|---|
| `licenseClass` | yes | 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. |
| `county` | yes | string | `"Sacramento"` | Full California county name, e.g. 'Los Angeles', 'Sacramento', 'Orange'. |
| `maxResults` | no | integer | — | Cap on the number of license records returned in a single run. 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 — target licensed trades (electricians, plumbers, general builders) by county for suppliers, SaaS, insurers, and lenders.
- License verification & compliance — confirm a contractor's status, bond, and workers' comp coverage.
- Market analysis — size and segment the contractor market by classification and county.

### 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 classification + county per run.

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

# Actor input Schema

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

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

Full California county name, e.g. 'Los Angeles', 'Sacramento', 'Orange'.

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

Cap on the number of license records returned in a single run. 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
{
  "licenseClass": "C-10",
  "county": "Sacramento",
  "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",
    "county": "Sacramento"
};

// Run the Actor and wait for it to finish
const run = await client.actor("fried_calamaries/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",
    "county": "Sacramento",
}

# Run the Actor and wait for it to finish
run = client.actor("fried_calamaries/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",
  "county": "Sacramento"
}' |
apify call fried_calamaries/california-contractor-directory --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "California Contractor Directory by Trade & County (CSLB)",
        "description": "Every licensed California contractor in a county by trade — license #, business, contact, classifications, bond & workers' comp — from the official CSLB registry.",
        "version": "0.1",
        "x-build-id": "RGBbIRjnxP4X572ni"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/fried_calamaries~california-contractor-directory/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-fried_calamaries-california-contractor-directory",
                "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/fried_calamaries~california-contractor-directory/runs": {
            "post": {
                "operationId": "runs-sync-fried_calamaries-california-contractor-directory",
                "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/fried_calamaries~california-contractor-directory/run-sync": {
            "post": {
                "operationId": "run-sync-fried_calamaries-california-contractor-directory",
                "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",
                "required": [
                    "licenseClass",
                    "county"
                ],
                "properties": {
                    "licenseClass": {
                        "title": "License classification",
                        "type": "string",
                        "description": "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."
                    },
                    "county": {
                        "title": "County",
                        "type": "string",
                        "description": "Full California county name, e.g. 'Los Angeles', 'Sacramento', 'Orange'."
                    },
                    "maxResults": {
                        "title": "Maximum results",
                        "minimum": 1,
                        "maximum": 100000,
                        "type": "integer",
                        "description": "Cap on the number of license records returned in a single run. Leave empty to return all matches."
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Optional. CSLB is usually reachable directly; enable a proxy (e.g. residential) only if runs return no data because the IP is blocked.",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
