# CA Contractor Licenses (`hydra_search/ca-contractor-licenses`) Actor

California contractor license records from CSLB's official public bulk files: license status, classifications, bonds, workers' comp, and personnel, with provenance on every record.

- **URL**: https://apify.com/hydra_search/ca-contractor-licenses.md
- **Developed by:** [HYDRA SEARCH](https://apify.com/hydra_search) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.98 / 1,000 california contractor license records

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/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

## CA Contractor Licenses

Get statewide California contractor license records as clean, structured data, built on the **official public bulk files** that the California Contractors State License Board (CSLB) publishes for free. **All three free CSLB files — License Master, Workers' Comp, and Personnel — are joined by default**, one record per license, with status, classifications, bonds, workers' compensation details, personnel, and a clear note of **how fresh each record is and where it came from**. The data is **as of the bulk file date, not live** — see "Dates and freshness" below.

> Not affiliated with, endorsed by, or sponsored by CSLB or the State of California. This is not legal advice. Always confirm a license on CSLB's own [Instant License Check](https://www2.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx) before you rely on it for a decision.

### What you get

- **Every license CSLB lists publicly:** about 245,000 on the files checked in November 2026 (active, suspended, and expired-but-renewable licenses).
- **Filter by** classification (for example `B`, `C10`, `C-36`), county, city, and status, or take everything.
- **Workers' comp that tells the truth about itself.** CSLB's main file and its workers' comp file sometimes disagree. This Actor joins them with a documented rule and tells you which one each record used (`wcSource`), whether coverage is current (`wcCurrent`), and whether a license is exempt (`wcExempt`).
- **Provenance on every record:** `sourceFileDate` per file, `dataAsOf`, `fetchedAt`, and CSLB's own disclaimer. You always know how old the data is.
- **Clean values:** ISO dates, trimmed text, numeric bond amounts, normalized status next to CSLB's exact status.
- **No scraping of the live lookup.** The Actor reads CSLB's official download files. It never touches the search form, so there is nothing to block and no CAPTCHA to get around.

### Quick start

1. Open the Actor and press **Start**. The default input returns 10 active Sacramento County licenses so you can see the output for a few cents.
2. Change the filters and raise **Maximum results** when you are ready.
3. Download the dataset as JSON, CSV or Excel, or read it through the API.

### Input

| Field | What it does | Default |
|---|---|---|
| `licenseTypes` | CSLB classification codes. A license matches if it holds **any** code you list. Case, spaces and hyphens do not matter (`C-10` = `c10`). | all |
| `counties` | County of the address on file. "County" is optional. | all |
| `cities` | City of the address on file. | all |
| `statuses` | `active` (CSLB status CLEAR), `suspended` (any suspension), `other`. | `["active"]` |
| `maxResults` | Stop after this many records (1 to 300,000). You pay per record, so this is also your cost cap. | 100 |
| `includeWorkersComp` | Join CSLB's workers' comp file for the latest policy data. | on |
| `includePersonnel` | Add the **named individuals** CSLB lists on each license. Personal data, published by CSLB's free Personnel file and joined **by default**; turn off if you don't need it. | on |
| `useLivePortal` | Download directly from CSLB this run instead of reading the daily prebuilt copy. See "Where the data comes from" below. | off |

An empty filter means "do not filter on this". An empty `statuses` list returns all statuses.

### Where the data comes from

By default, this Actor does **not** download from CSLB on every run. It reads a copy of all three free CSLB
files, already joined, from a prebuilt daily snapshot refreshed once a day from a machine with reliable CSLB
access, and applies your filters to that. This exists because a live download from CSLB can get cut off
partway through when it runs on Apify's cloud infrastructure, even though the same download works fine
elsewhere.

- Every record carries **`prebuiltBuildTimestamp`**: when that daily snapshot was last refreshed. This is
  different from `sourceFileDate`/`dataAsOf`, which say when CSLB itself last published each file — the
  snapshot can lag CSLB's own file by up to the time since the last daily refresh.
- If the prebuilt snapshot is more than 3 days old, the run still uses it but logs a clear warning.
- If no prebuilt snapshot exists at all, the run returns 0 records with a clear warning, rather than
  silently falling back to a live download.
- The Actor fetches this snapshot over plain HTTPS from two permanent, signed public URLs, not through
  Apify's own storage API — its cloud runs use Apify's "Limited permissions" mode, which can't open a
  named dataset/store it didn't create itself from inside a run. See `CLAUDE.md` "Prebuilt data access".
- Set **`useLivePortal: true`** to skip the snapshot and download directly from CSLB for that run instead
  (the exact same direct-download behavior this Actor always had). This may be slower, and can fail on
  Apify's cloud for the reason above.

### Output

One dataset item per license. A shortened example (made-up business and policy data, shown to illustrate the shape):

```json
{
  "licenseNumber": "9000002",
  "businessName": "TEST BUILDERS INC",
  "businessType": "Corporation",
  "mailingAddress": { "street": "200 EXAMPLE AVENUE", "city": "SACRAMENTO", "state": "CA", "zip": "95801", "county": "Sacramento" },
  "status": "active",
  "statusRaw": "CLEAR",
  "issueDate": "2001-05-02",
  "expirationDate": "2027-06-30",
  "daysToExpiry": 222,
  "classifications": ["A", "B", "C10", "C36"],
  "bonds": { "contractor": { "suretyCompany": "EXAMPLE SURETY CO", "bondNumber": "TST-0002", "effectiveDate": "2026-09-14", "amount": 25000 }, "wb": null, "disciplinary": null },
  "wcCoverageTypeMaster": "Workers' Compensation Insurance",
  "wcCurrent": true,
  "wcExempt": false,
  "wcExemptInferred": false,
  "workersComp": { "carrier": "EXAMPLE INSURANCE CO", "policyNumber": "POL-0002", "effectiveDate": "2026-03-01", "expirationDate": "2027-03-01" },
  "wcSource": "workers_comp_file",
  "personnelInFile": true,
  "personnel": [
    { "name": "EXAMPLE PERSON", "nameTypes": ["P"], "recordType": "Principal", "titles": ["RMO"], "classifications": ["B"], "associatedDates": ["2020-01-15"], "disassociatedDates": [null] }
  ],
  "sourceFileDate": { "master": "2026-11-18", "workersComp": "2026-11-20", "personnel": "2026-11-16" },
  "dataAsOf": "2026-11-16",
  "fetchedAt": "2026-11-20T12:00:00.000Z",
  "prebuiltBuildTimestamp": "2026-11-20T06:00:00.000Z"
}
```

#### How to read the workers' comp fields

CSLB publishes workers' comp information in two files, and they are not identical. Across the 123,158 licenses in both files (checked in November 2026), they agreed on coverage type, carrier, policy number and both policy dates for 97.1% of licenses. This is how the Actor handles the rest:

- **`wcSource`** says which file the policy details came from. When a workers' comp record exists and was updated on or after the license record, it is used. Otherwise the main license file is.
- **`wcCurrent`**: `true` when the license file lists a coverage type, `false` when it says the license **does not have current workers' comp**, and `null` for exempt or unknown. A license with `wcCurrent: false` keeps its previous policy in **`lastPolicy`**, so you can see what lapsed and when.
- **`wcExempt`** (and `wcExemptSince`): the license file says the contractor certified they have no employees. Many licenses have no workers' comp record for this reason, which is normal.
- **`wcExemptInferred`**: `true` when the license file claims coverage but lists no carrier, policy or expiration and the workers' comp file has no record. In our checks the live CSLB page showed these as exempt (3 of 3 looked up), so this is **an inference to treat with care, not a CSLB statement**. It is `null` when `includeWorkersComp` is off.

#### Dates and freshness

CSLB refreshes its three files on different days, so they never share one date. `sourceFileDate` shows the date CSLB posts for each file used, and `dataAsOf` is the **oldest** of them. `prebuiltBuildTimestamp` is a separate thing: when this Actor's own daily snapshot was last refreshed (null if you set `useLivePortal: true`). License changes can happen at any time, so use CSLB's Instant License Check for a decision that matters. Fields that CSLB leaves empty come back as `null`.

> **Status is as of the bulk file date, not live.** `status`, `statusRaw` and `secondaryStatus` show what CSLB's published file said on the date in `sourceFileDate`, which can be days or weeks old. CSLB's live page can already show a newer state. In one spot check on 2026-11-20, a license that read `CLEAR` in the bulk data showed as suspended (a contractor's bond suspension) on CSLB's live license page. Before you rely on a status, check the record's `sourceUrl` and CSLB's Instant License Check.

#### Personnel (on by default; set `includePersonnel` to false to turn off)

Each person has a name, the type of name record, `titles`, `classifications`, `associatedDates` and `disassociatedDates`. CSLB writes the last four as lists that line up by position, so the Actor keeps them aligned. A slot CSLB leaves blank is `null`. For example, `disassociatedDates: [null, "2023-12-26"]` means the first association has no end date and the second ended on that day. A license with no rows in CSLB's personnel file returns `personnelInFile: false`, which says nothing else about the license.

### What this data does not include

- **Cancelled, revoked and expired non-renewable licenses.** CSLB leaves them out of its master file. Expired licenses that can still be renewed (within five years) are included.
- **Email addresses.** CSLB does not publish them (California Business and Professions Code section 27), and this Actor does not look for them.
- **Complaint and disciplinary detail, bond history and workers' comp history.** These appear only on CSLB's individual license pages, not in the bulk files. The disciplinary bond fields that are in the file are returned under `bonds.disciplinary`.
- **Classification names.** You get CSLB's codes (`C10`), not their descriptions. CSLB publishes the list of classifications on its site.
- **Home improvement salespersons.**
- **A guarantee of completeness or timeliness.** The data is exactly as CSLB publishes it, with CSLB's own caveat that information may not yet be entered.
- The `bonds.wb` group is returned as CSLB provides it. CSLB does not define it in the file.

### Responsible use

- The records come from a **public** CSLB data portal. Many licenses belong to **sole owners**, so the business name, address and phone number can identify a private individual. Use the data lawfully and respect the rules that apply to you, including applicable privacy, telemarketing and anti-spam laws.
- **Personnel** are named individuals. CSLB publishes this in its own free Personnel file, so it's joined by default; turn `includePersonnel` off if you don't have a lawful need for it.
- The Actor reads only CSLB's official public download files, at a polite pace, and stops with a clear error if CSLB changes its file format instead of returning wrong data.

### Pricing

Pay per event: you are charged for each license record returned, plus the standard Actor start event. The current prices are on the **Pricing** tab. **Maximum results** and your run's maximum total charge both cap what a run can cost, and the Actor stops cleanly when your charge limit is reached.

### Use it from code

Python:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("<THIS_ACTOR_ID>").call(run_input={
    "counties": ["Fresno"],
    "licenseTypes": ["C10"],
    "statuses": ["active"],
    "maxResults": 500,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["licenseNumber"], item["businessName"], item["daysToExpiry"])
```

JavaScript:

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('<THIS_ACTOR_ID>').call({ cities: ['Sacramento'], maxResults: 100 });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.length);
```

### FAQ

**Why not scrape CSLB's license lookup page?** CSLB already publishes the same public data as free bulk files. Using them gives complete statewide coverage in one pass, is gentler on CSLB's servers, and avoids the per-record page lookups other tools rely on.

**Is it complete?** It matches what CSLB lists in its public files. Licenses CSLB has dropped from the master file (cancelled, revoked, expired non-renewable) are not returned.

**How fresh is it?** Each record shows the date CSLB posted the file it came from (`sourceFileDate`, `dataAsOf`), plus `prebuiltBuildTimestamp` for when this Actor's own daily snapshot was last refreshed. By default the Actor reads that daily snapshot rather than downloading fresh every run; set `useLivePortal: true` to download fresh from CSLB for that run instead.

**Why do I see `wcCurrent: false` and a `lastPolicy`?** CSLB's license file says the license has no current workers' comp, but a previous policy is on file. `lastPolicy` shows it.

**Why is a workers' comp field `null`?** Either the license is exempt, CSLB has no policy on file, or `includeWorkersComp` is off.

**Can I get changes since my last run?** Not yet. See below.

### Planned

These are planned and **not part of this version**:

- Change monitoring: new, changed, expiring and delisted licenses between runs.
- A backup download route. If CSLB ever changes the addresses of its download files, the Actor currently stops with a clear error instead of returning wrong data.

### Changelog

- **0.1** Initial version: bulk files from CSLB, filters, workers' comp and personnel joins (both on by default, each can be turned off), provenance fields, pay per result. Reads a daily prebuilt snapshot by default instead of downloading from CSLB each run (`useLivePortal` restores the direct download).

### Feedback

Found a mismatch with CSLB's own site, or need another field? Open an issue from the Actor page.

# Actor input Schema

## `licenseTypes` (type: `array`):

CSLB classification codes, for example A, B, C10, C-10 or HAZ. Case, spaces and hyphens do not matter. A license matches if it holds any of the codes you list. Leave empty for all classifications.

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

California county names as CSLB files them, for example Sacramento or Los Angeles. The word "County" is optional. Matches the county of the address on file. Leave empty for all.

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

City names of the address on file, for example Fresno. Leave empty for all.

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

Active = CSLB status CLEAR. Suspended = any suspension status. Other = anything else. The exact CSLB status is always returned in statusRaw. Default: active only.

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

Stop after this many records. You are charged per record returned, so this also caps your cost.

## `includeWorkersComp` (type: `boolean`):

Adds the most recent policy data from CSLB's workers' comp file where it is newer than the license record. Adds a minute or so to the run. When off, only the workers' comp fields in the main license file are used.

## `includePersonnel` (type: `boolean`):

Adds the people CSLB lists on each license (officers, owners and similar) with their titles. This is personal information, published by CSLB in its free Personnel file and joined by default. Turn off if you do not need it.

## `useLivePortal` (type: `boolean`):

By default this Actor reads CSLB's three free files from a prebuilt copy refreshed once a day (see scripts/build-and-upload.js), because a live download from CSLB can be cut off partway through on the Apify cloud. Turn this on to download directly from CSLB every run instead, as this Actor's v0.1 always did. Prebuilt data is as of the last daily build, not live either way.

## Actor input object example

```json
{
  "licenseTypes": [],
  "counties": [
    "Sacramento"
  ],
  "cities": [],
  "statuses": [
    "active"
  ],
  "maxResults": 10,
  "includeWorkersComp": true,
  "includePersonnel": true,
  "useLivePortal": false
}
```

# Actor output Schema

## `licenses` (type: `string`):

One row per CA contractor license (license status, classifications, bonds, workers' comp, personnel), using the "overview" view defined in dataset_schema.json.

# 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 = {
    "licenseTypes": [],
    "counties": [
        "Sacramento"
    ],
    "cities": [],
    "statuses": [
        "active"
    ],
    "maxResults": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("hydra_search/ca-contractor-licenses").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 = {
    "licenseTypes": [],
    "counties": ["Sacramento"],
    "cities": [],
    "statuses": ["active"],
    "maxResults": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("hydra_search/ca-contractor-licenses").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 '{
  "licenseTypes": [],
  "counties": [
    "Sacramento"
  ],
  "cities": [],
  "statuses": [
    "active"
  ],
  "maxResults": 10
}' |
apify call hydra_search/ca-contractor-licenses --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hydra_search/ca-contractor-licenses"
        }
    }
}
```

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/6rKGtrdQHYQGXqB45/builds/0AajltkD1U0MsXWuy/openapi.json
