# California Contractor License Scraper — Bond & WC Data (`scrapersdelight/cslb-contractor-scraper`) Actor

All 243,555 licensed California contractors from the official CSLB registry: business name, phone, address, trade classifications and license status, plus contractor bond (surety, amount, dates), workers' comp carrier and expiry, and disciplinary bonds. Filter by county, trade or renewal window.

- **URL**: https://apify.com/scrapersdelight/cslb-contractor-scraper.md
- **Developed by:** [Scrapers Delight](https://apify.com/scrapersdelight) (community)
- **Categories:** Lead generation, Business, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 per contractor license returneds

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 License Scraper — Bond & Workers' Comp

Every one of the **243,555 licensed contractors in California**, straight from the official CSLB
registry — with the qualification layer that turns a directory into a prospect list.

Other contractor scrapers give you a name and a phone number. This one also tells you whether the
contractor **can legally work right now**, who wrote their bond, when it expires, and whether they
carry workers' comp.

### Why that matters

| Segment | Statewide count | Who buys it |
|---|---|---|
| **Suspended for no contractor bond** | ~6,200 | Surety agencies — these contractors cannot legally work until they buy a bond |
| **Active with no workers' comp carrier on file** | ~115,000 | Workers' comp brokers |
| **Workers' comp expiring in the next 90 days** | ~28,000 | A dated, recurring renewal trigger |
| **License expiring in the next 90 days** | ~25,500 | Renewal and re-engagement campaigns |
| **Under a disciplinary bond** | ~1,800 | With the reason and case number attached |

Each of those is one input toggle away.

### Fields

`licenseNumber` · `businessName` · `businessType` · `mailingAddress` · `city` · `county` · `zipCode` ·
`businessPhone` · `primaryStatus` · `secondaryStatus` · `isActive` · `classifications` (78 codes:
B general building, C10 electrical, C36 plumbing, C20 HVAC, C33 painting, C39 roofing, A engineering…) ·
`issueDate` · `expirationDate` · `daysUntilLicenseExpiry` · `pendingSuspension` ·
`bondSuretyCompany` · `bondNumber` · `bondAmount` · `bondEffectiveDate` · `bondCancellationDate` ·
`wcCoverageType` · `wcInsuranceCompany` · `wcPolicyNumber` · `wcEffectiveDate` · `wcExpirationDate` ·
`daysUntilWcExpiry` · `hasWorkersComp` · `qualifierBond*` · `disciplinaryBondSurety` ·
`disciplinaryBondReason` · `disciplinaryCaseNo` · `isUnderDiscipline` · `sourceUrl` · `lastUpdate` ·
`dataSnapshotDate` · `dataSnapshotAgeHours` · `scrapedAt`

#### Measured fill — every field, counted on the whole file

Counted over all **244,204 rows** of the live CSLB file (2026-08-19), not a sample. Anything below
100% is below 100% because **CSLB does not publish it for that licensee** — the absence is the record,
and for the workers' comp and bond fields the absence is exactly the sales signal.

| Field | Fill | Why it is not 100% |
|---|---|---|
| `licenseNumber` `businessName` `mailingAddress` `city` `zipCode` `businessType` `primaryStatus` `classifications` `issueDate` `expirationDate` `daysUntilLicenseExpiry` `wcCoverageType` `sourceUrl` `lastUpdate` | **100%** | — |
| `businessPhone` | **99.9%** | 245 licensees list no phone |
| `bondSuretyCompany` `bondNumber` `bondAmount` `bondEffectiveDate` | **100%** | 121 licensees exempt from the bond requirement |
| `county` | **96.5%** | out-of-state and PO-box addresses carry no CA county |
| `wcInsuranceCompany` `wcPolicyNumber` | **50.1%** | **no workers' comp carrier on file — the broker lead** |
| `wcExpirationDate` `daysUntilWcExpiry` | **50.1%** | same: no policy, no expiry |
| `fullBusinessName` | **23.5%** | only DBAs and individuals carry a second legal name (57,492 rows: FullBusinessName 41,631 + BUS-NAME-2 21,156, less 5,295 carrying both) |
| `reissueDate` | **15.7%** | only licenses that were reissued |
| `bondCancellationDate` | **10.1%** | only bonds that were cancelled — **this is the surety trigger** |
| `inactivationDate` | **8.8%** | only licenses that went inactive |
| `qualifierBondSurety` `qualifierBondNumber` `qualifierBondAmount` | **5.6%** | 13,691 licensees carry a qualifying-individual bond |
| `secondaryStatus` | **2.4%** | only licenses with a secondary condition (probation, pending case) |
| `wcSuspendDate` | **1.3%** | only WC-suspended licenses |
| `wcCancellationDate` | **1.1%** | only cancelled WC policies |
| `disciplinaryBondSurety` `disciplinaryBondAmount` `disciplinaryBondReason` `isUnderDiscipline` | **0.8%** | 1,862 licensees are under a disciplinary bond order |
| `disciplinaryCaseNo` `disciplinaryCaseRegion` | **0.7%** | 1,830 of those 1,862 orders carry a case number |

`isActive`, `hasWorkersComp`, `isUnderDiscipline`, `pendingSuspension`, `dataSnapshotDate`,
`dataSnapshotAgeHours` and `scrapedAt` are computed, so they are populated on every row.

### Example

```json
{
  "businessName": "HYDRO BACKFLOW",
  "city": "WEST COVINA", "county": "Los Angeles",
  "businessPhone": "(844) 554 9376",
  "classifications": ["C36"],
  "primaryStatus": "Contr Bond Susp", "isActive": false,
  "bondSuretyCompany": "NORTH RIVER INSURANCE COMPANY (THE)",
  "bondAmount": 25000, "bondCancellationDate": "2026-07-15",
  "wcExpirationDate": "2026-10-23", "daysUntilWcExpiry": 73,
  "disciplinaryBondReason": "Conditional", "isUnderDiscipline": true
}
```

A plumbing contractor whose bond was cancelled in July, suspended as a result, under a conditional
disciplinary bond, with workers' comp lapsing in 73 days.

### Input

| input | default | notes |
|---|---|---|
| `counties` | `["Los Angeles"]` | Empty = whole state. LA 49,637 · San Diego 21,551 · Orange 20,175 |
| `classifications` | `["C36"]` | CSLB codes. Empty = all 98. Hyphen optional — `C8` and `C-8` both match |
| `statuses` | — | e.g. `CLEAR`, `Contr Bond Susp`, `Work Comp Susp` |
| `onlyActive` | `false` | Only licenses that are CLEAR |
| `bondSuspendedOnly` | `false` | The surety-lead segment |
| `missingWorkersCompOnly` | `false` | No WC carrier on file |
| `wcExpiringWithinDays` | — | Dated workers' comp renewal trigger |
| `licenseExpiringWithinDays` | — | License renewal trigger |
| `forceRefresh` | `false` | Bypass the snapshot cache and pull a new copy from CSLB. Needs a run timeout ≥ 15 min |
| `maxItems` | `5000` | Full file is 244,204 |

### How fresh is the data — and how you can tell

CSLB does not publish per-record queries; it publishes **one 77 MB bulk file**, and it serves that
file at about **175 KB/s**, so a single download takes **6–8 minutes** (measured on the platform:
443 s direct, 344 s through a proxy). Downloading it on every run would make every run cost eight
minutes of compute for data that changes a few hundred rows a day.

So this Actor **caches the verified file between runs** and refreshes it automatically once the
cached copy passes **24 hours old**. A normal run therefore reads a snapshot instead of re-downloading
the state of California.

You are never left guessing how old that snapshot is. Every run tells you **three** ways:

- the **run log**: `Serving: CSLB snapshot published 2026-08-17 (downloaded …, 3.2 h old, 244,204 licences…)`
- the **run status message**, same line, visible without opening the log
- **every row**, on `dataSnapshotDate` (the day CSLB published the snapshot), `scrapedAt` (when that
  file was pulled from CSLB — not when the row was emitted) and `dataSnapshotAgeHours`.
  `dataSnapshotDate` is also a column in the default dataset view.

Need this second's data? Set **`forceRefresh: true`** and give the run a timeout of at least
15 minutes. The run will pull a brand-new copy from CSLB, re-verify it, emit from it, and leave it
in the cache for everyone after you. If the timeout is too short for a 6–8 minute download, the run
says so in a warning and serves the cached snapshot rather than failing.

### Pricing

**$0.004 per license returned** ($4 per 1,000). The two other CSLB actors on the store charge
**$19–21 per 1,000** for license rows without the bond, workers' comp or disciplinary layer.

Every row is charged **before** it is written, so you are never billed for a row you did not receive
and never receive a row you were not billed for. If a run's **Max total charge (USD)** is lower than
`maxItems` × $0.004, the run stops at that limit, tells you so in the run status, and reports the
number of licenses you actually received — it does not quietly hand back a short file.

### Reliability note

CSLB publishes this as a single ~77 MB file that carries **no `content-length` and ignores `Range`**,
so a truncated response is still syntactically valid CSV and parses without error — a naive scraper
silently returns partial state data and reports success. Measured live: one attempt returned 97.3% of
the file, the next returned all of it.

This Actor validates every download (trailing newline, complete final record, and the file's legacy
tail ending at license 999999) and retries up to four times, refusing to emit anything rather than
report a false success. In testing, two consecutive attempts failed before the third came back
complete — that is a normal run, not an outage.

The same check is re-applied to the **cached** snapshot every time it is read, so a corrupted cache
can never become silent partial data either. Nothing is ever emitted, and nothing is ever cached,
that has not passed the completeness gate.

Data is a public record published by the California Contractors State License Board. You are
responsible for complying with CSLB's terms and with how you use the data.

# Actor input Schema

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

Limit to these California counties (e.g. Los Angeles, San Diego, Orange). Leave empty for the whole state.

## `classifications` (type: `array`):

CSLB classification codes: B general building, C10 electrical, C36 plumbing, C33 painting, C20 HVAC, C39 roofing, C8 concrete, A engineering. Empty = all 98. The hyphen is optional — C8 and C-8 both match, as do D3 and D03.

## `statuses` (type: `array`):

Filter on the exact status string, e.g. CLEAR, Contr Bond Susp, Work Comp Susp, Liab Ins Susp. Empty = all.

## `onlyActive` (type: `boolean`):

Keep only contractors whose license is CLEAR (currently active and able to work).

## `bondSuspendedOnly` (type: `boolean`):

Only contractors suspended for a missing contractor bond — they cannot legally work until they buy one. ~6,200 statewide.

## `missingWorkersCompOnly` (type: `boolean`):

Only contractors with no workers' comp carrier recorded. ~115,000 active statewide.

## `wcExpiringWithinDays` (type: `integer`):

Only contractors whose workers' comp policy expires within this many days — a dated renewal trigger. ~28,000 statewide at 90 days.

## `licenseExpiringWithinDays` (type: `integer`):

Only contractors whose license expires within this many days. ~25,500 statewide at 90 days.

## `forceRefresh` (type: `boolean`):

CSLB's 77 MB bulk file is cached between runs (it is refreshed automatically once the cached copy passes 24 hours old), which is what keeps a normal run under a minute instead of 8. Tick this to bypass the cache and pull a brand-new copy straight from CSLB. That download takes 6-8 minutes, so the run timeout must be at least 15 minutes — otherwise the run logs a warning and serves the cached snapshot. Every run reports its snapshot date in the log, in the run status, and on the dataSnapshotDate / dataSnapshotAgeHours fields of every row.

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

Cap the number of licenses returned. The full file holds 243,555.

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

CSLB needs no proxy; datacenter works. Configurable for rate-spreading.

## Actor input object example

```json
{
  "counties": [
    "Los Angeles"
  ],
  "classifications": [
    "C36"
  ],
  "onlyActive": false,
  "bondSuspendedOnly": false,
  "missingWorkersCompOnly": false,
  "forceRefresh": false,
  "maxItems": 5000,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `items` (type: `string`):

One row per license: business, phone, address, classifications, status, contractor bond, workers-comp and disciplinary records.

# 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 = {
    "counties": [
        "Los Angeles"
    ],
    "classifications": [
        "C36"
    ],
    "maxItems": 5000
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapersdelight/cslb-contractor-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 = {
    "counties": ["Los Angeles"],
    "classifications": ["C36"],
    "maxItems": 5000,
}

# Run the Actor and wait for it to finish
run = client.actor("scrapersdelight/cslb-contractor-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 '{
  "counties": [
    "Los Angeles"
  ],
  "classifications": [
    "C36"
  ],
  "maxItems": 5000
}' |
apify call scrapersdelight/cslb-contractor-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapersdelight/cslb-contractor-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/NIzxoHyAQPZpNJUOF/builds/p4kf40gmOsv7nuTjc/openapi.json
