# CSLB California Contractor License Scraper (`stackrelay/cslb-california-scraper`) Actor

Bulk-scrape California CSLB contractor licenses to JSON. Full public record per license: status, all classifications, bonds, workers'-comp, disciplinary history, personnel, phone, address. Search by license number or business/owner name; filter by city, county, ZIP, classification, status.

- **URL**: https://apify.com/stackrelay/cslb-california-scraper.md
- **Developed by:** [StackRelay](https://apify.com/stackrelay) (community)
- **Categories:** Lead generation, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 30 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $19.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## CSLB California Contractor License Scraper

> Bulk-scrape California contractor licenses from the CSLB (Contractors State License Board) public database. One result = one California contractor's public-record data — license status, classifications, bond info, workers-comp coverage, disciplinary/administrative history, personnel, and addresses.

> **Disclaimer — please read before running.** This actor is an independent data tool built by **StackRelay**. It is **not affiliated with, endorsed by, or operated by** the California Contractors State License Board (CSLB) or the State of California. Results are a **best-effort, point-in-time snapshot** of the public CSLB license-check pages, provided **AS-IS with no warranty** of accuracy, completeness, or timeliness — license status, bonds, workers-comp, and disciplinary/administrative entries can change at any time after a record is fetched, and some upstream filings lag by days to weeks. Every record carries a `source_url` linking to the official CSLB detail page and a `scraped_at` timestamp: **verify independently at the source before acting on any record.** Disciplinary and administrative action entries are **verbatim, point-in-time reproductions of what CSLB published — not adjudications or determinations by StackRelay**; confirm each at its `source_url` before relying on or repeating it. Output contains **personal data** (owner/qualifying-party names and addresses); if you process data about EU/UK residents you may be an independent data controller under **GDPR/UK GDPR**. **This actor's output is not a consumer report and must not be used for FCRA-regulated purposes** — employment, tenant, or credit screening decisions about an individual. By running this actor you agree to the [Developer Terms of Use](./DEVELOPER_TERMS.md).

Built for compliance teams verifying subcontractors, insurance underwriters pricing contractor policies, construction PMs vetting subs, and B2B sales teams prospecting California contractors (roofing, HVAC, electrical, plumbing, general building — every CSLB classification is searchable).

### What makes this actor different

CSLB publishes an unusually rich public contractor dataset — bond info, workers-comp, and disciplinary/administrative history are all on file. **Many competing CSLB scrapers return only license number, name, and status.** This actor returns the fields CSLB publishes on its public detail pages, with a stable JSON schema. Field completeness varies by license and by what CSLB has on file.

| Feature | This actor | Typical CSLB actor |
|---|---|---|
| Search by license number | ✅ | ✅ |
| Search by business name | ✅ | Partial |
| Narrow by city / county / ZIP / classification / status | ✅ | ❌ |
| All license classifications per row | ✅ | Primary only |
| Bond info (company, amount, effective / cancellation dates) | ✅ | ❌ |
| Workers-comp (carrier, policy number, effective / expiration dates) | ✅ | ❌ |
| Disciplinary actions | ✅ | ❌ |
| ZIP → county auto-fill (CA ZIP crosswalk, ~2,600 ZIPs) | ✅ | ❌ |
| Transparent pay-per-result pricing | ✅ | Often pay-per-event, opaque |

### How search works

Pick ONE **primary search** field:

- `licenseNumber` — direct lookup (fastest, cheapest)
- `businessName` — partial or full, matched case-insensitively against **both the legal business name and associated personnel/owner names**. `"Acme"` matches `"Acme Construction Co"`, `"Acme Plumbing Inc"`, etc.; `"Smith"` also matches `"Johnie Cement Work"` (owned by John Smith). If you need strict business-name-only matching, filter downstream on the `business_name` output field.

Optionally **narrow the results** with any combination of `city`, `county`, `zipCode`, `classification`, and `status`. These filters apply client-side after the primary search (CSLB doesn't publish a way to enumerate contractors by city/county alone — so a primary search is required).

### Example inputs

**Single-license lookup** — cheapest, one record:

```json
{
    "licenseNumber": "123456"
}
```

**Find SMITH-named contractors in the City of Los Angeles, cap at 25:**

```json
{
    "businessName": "SMITH",
    "city": "Los Angeles",
    "maxResults": 25
}
```

**Find every "Green Building" in the ZIP 94703, active status:**

```json
{
    "businessName": "Green Building",
    "zipCode": "94703",
    "status": "active"
}
```

**Bulk scrape "Acme" businesses, cap at 1,000:**

```json
{
    "businessName": "Acme",
    "maxResults": 1000
}
```

### Example output (one record)

```json
{
    "license_number": "123456",
    "business_name": "ACME CONSTRUCTION CO",
    "business_address": "123 MAIN ST, LOS ANGELES, CA 90012",
    "business_phone": "(213) 555-1234",
    "mailing_address": null,
    "city": "Los Angeles",
    "county": "Los Angeles",
    "zip_code": "90012",
    "issue_date": "2015-06-14",
    "expiration_date": "2026-06-30",
    "status": "active",
    "entity_type": "corporation",
    "classifications": [
        { "code": "B", "description": "GENERAL BUILDING CONTRACTOR" },
        { "code": "C-10", "description": "ELECTRICAL" }
    ],
    "qualifiers": [
        { "name": "JANE SMITH", "association": "RESPONSIBLE MANAGING OFFICER" }
    ],
    "bonds": [
        {
            "type": "contractor_bond",
            "company": "OLD REPUBLIC SURETY",
            "amount_usd": 25000,
            "effective_date": "2023-07-01",
            "cancellation_date": null
        }
    ],
    "workers_comp": {
        "carrier": "STATE COMPENSATION INSURANCE FUND",
        "policy_number": "9999999",
        "effective_date": "2024-01-01",
        "expiration_date": "2025-01-01"
    },
    "disciplinary_actions": [],
    "administrative_actions": [
        {
            "type": "LICENSE REISSUED TO ANOTHER ENTITY",
            "date": "2018-09-28",
            "summary": "09/28/2018 - LICENSE REISSUED TO ANOTHER ENTITY"
        }
    ],
    "source_name": "California CSLB (Contractors State License Board) public license lookup",
    "source_url": "https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/LicenseDetail.aspx?LicNum=123456",
    "scraped_at": "2026-04-22T10:00:00.000Z"
}
```

#### Field notes

- `license_number` is the stable primary key — use it to deduplicate across runs.
- `classifications`, `qualifiers`, `bonds`, `disciplinary_actions`, and `administrative_actions` are always arrays (may be empty `[]`, never `null`).
- **`disciplinary_actions` vs `administrative_actions`.** CSLB lists both genuine enforcement actions (citations, accusations, revocations, probation, judgments) and routine administrative/lifecycle codes (license reissued to another entity, Secretary of State dissolution, bond posted/cancelled, workers-comp exemption changes, partner disassociation, continuances) in one place. We split them: `disciplinary_actions` holds probable real discipline, and `administrative_actions` holds the lifecycle/clerical codes. Classification is conservative and heuristic — any code we don't recognize as administrative stays in `disciplinary_actions`, so a genuine action is unlikely to be hidden, but a non-empty `disciplinary_actions` array is a **flag to review, not a confirmed finding**. Both fields are verbatim, point-in-time reproductions of CSLB's published codes; **verify each entry at the record's `source_url` before relying on or repeating it** (see the disclaimer at the top of this README).
- `workers_comp` is an object or `null` (null when the contractor has a valid exemption).
- `county` is derived from `zip_code` via a bundled 2,623-ZIP California crosswalk; out-of-state mailing addresses return `null`.
- `mailing_address` is always `null` from this source — CSLB's detail page does not expose it separately from the business address. (Kept in schema for downstream compatibility.)
- Dates are ISO-8601 (`YYYY-MM-DD`); `scraped_at` is ISO-8601 UTC.

### Common use cases

- **Lead generation** for companies selling TO California contractors — insurance, fleet, SaaS, equipment, supplies, workwear. Filter by classification (C-10 electrical, C-36 plumbing, C-20 HVAC, C-33 painting, C-39 roofing, C-27 landscaping, B general building, A general engineering) and `status: active` for a clean ICP list.
- **Subcontractor due diligence** — verify license status, bond coverage, workers-comp, and disciplinary history before hiring. Pull by `licenseNumber` or business name.
- **Insurance underwriting** — score contractors by active disciplinary actions, bond cancellation history, and workers-comp status.
- **Compliance monitoring** — schedule weekly runs to flag newly expired, suspended, or revoked licenses in your vendor list.
- **Market research** — count active C-10 electrical contractors per county, map bond-amount distributions, track new-license issuance trends.

### Popular use cases

**Verify a license by trade**

- [Verify a C-10 electrical contractor license](https://apify.com/stackrelay/cslb-california-scraper/examples/verify-c10-electrical-contractor-license-california)
- [Verify a C-36 plumbing contractor license](https://apify.com/stackrelay/cslb-california-scraper/examples/verify-c36-plumbing-contractor-license-california)
- [Verify a general building (B) contractor license](https://apify.com/stackrelay/cslb-california-scraper/examples/verify-b-general-building-contractor-license-california)
- [Verify a C-33 painting contractor license](https://apify.com/stackrelay/cslb-california-scraper/examples/verify-c33-painting-contractor-license-california)
- [Verify a C-39 roofing contractor license](https://apify.com/stackrelay/cslb-california-scraper/examples/verify-c39-roofing-contractor-license-california)
- [Verify a C-27 landscaping contractor license](https://apify.com/stackrelay/cslb-california-scraper/examples/verify-c27-landscaping-contractor-license-california)
- [Verify a C-20 HVAC contractor license](https://apify.com/stackrelay/cslb-california-scraper/examples/verify-c20-hvac-contractor-license-california)
- [Verify a general engineering (A) contractor license](https://apify.com/stackrelay/cslb-california-scraper/examples/verify-a-general-engineering-contractor-license-california)
- [Verify a C-46 solar contractor license](https://apify.com/stackrelay/cslb-california-scraper/examples/verify-c46-solar-contractor-license-california)
- [Verify a C-53 swimming pool contractor license](https://apify.com/stackrelay/cslb-california-scraper/examples/verify-c53-pool-contractor-license-california)

**Find contractors by city**

- [Find licensed contractors in Los Angeles](https://apify.com/stackrelay/cslb-california-scraper/examples/find-licensed-contractors-los-angeles)
- [Find licensed contractors in San Diego](https://apify.com/stackrelay/cslb-california-scraper/examples/find-licensed-contractors-san-diego)
- [Find licensed contractors in San Francisco](https://apify.com/stackrelay/cslb-california-scraper/examples/find-licensed-contractors-san-francisco)
- [Find licensed contractors in Sacramento](https://apify.com/stackrelay/cslb-california-scraper/examples/find-licensed-contractors-sacramento)
- [Find licensed contractors in San Jose](https://apify.com/stackrelay/cslb-california-scraper/examples/find-licensed-contractors-san-jose)
- [Find licensed contractors in Oakland](https://apify.com/stackrelay/cslb-california-scraper/examples/find-licensed-contractors-oakland)
- [Find licensed contractors in Fresno](https://apify.com/stackrelay/cslb-california-scraper/examples/find-licensed-contractors-fresno)
- [Find licensed contractors in Orange County](https://apify.com/stackrelay/cslb-california-scraper/examples/find-licensed-contractors-orange-county)

**Compliance & due diligence**

- [Verify a contractor's license before hiring](https://apify.com/stackrelay/cslb-california-scraper/examples/verify-contractor-license-before-hiring-california)
- [Subcontractor license compliance check for GCs](https://apify.com/stackrelay/cslb-california-scraper/examples/subcontractor-license-compliance-check-california)
- [Contractor bond and workers' comp check for insurance underwriting](https://apify.com/stackrelay/cslb-california-scraper/examples/contractor-bond-workers-comp-check-insurance-underwriting)
- [Vendor license compliance check for property managers](https://apify.com/stackrelay/cslb-california-scraper/examples/property-manager-vendor-license-compliance-california)
- [Vet a contractor for a client referral](https://apify.com/stackrelay/cslb-california-scraper/examples/vet-contractor-for-client-referral-california)
- [Verify a contractor's license before a construction loan draw](https://apify.com/stackrelay/cslb-california-scraper/examples/construction-loan-contractor-license-verification-california)
- [Check a contractor's disciplinary history](https://apify.com/stackrelay/cslb-california-scraper/examples/check-contractor-disciplinary-history-california)

**License status monitoring**

- [Find suspended contractor licenses](https://apify.com/stackrelay/cslb-california-scraper/examples/find-suspended-contractor-licenses-california)
- [Find expired contractor licenses](https://apify.com/stackrelay/cslb-california-scraper/examples/find-expired-contractor-licenses-california)
- [Find revoked contractor licenses](https://apify.com/stackrelay/cslb-california-scraper/examples/find-revoked-contractor-licenses-california)
- [Find inactive or canceled contractor licenses](https://apify.com/stackrelay/cslb-california-scraper/examples/find-canceled-inactive-contractor-licenses-california)

**Lead generation**

- [Build a lead list for suppliers](https://apify.com/stackrelay/cslb-california-scraper/examples/contractor-lead-list-for-suppliers-california)
- [Export active contractor data for market research](https://apify.com/stackrelay/cslb-california-scraper/examples/export-active-cslb-contractor-data-market-research)
- [Get a list of active licensed contractors](https://apify.com/stackrelay/cslb-california-scraper/examples/active-licensed-contractors-list-california)
- [Export contractor licenses to CSV or JSON](https://apify.com/stackrelay/cslb-california-scraper/examples/export-california-contractor-licenses-csv-json)
- [Get a lead list by ZIP code](https://apify.com/stackrelay/cslb-california-scraper/examples/contractor-lead-list-by-zip-code-california)

**Find contractors by trade + city**

- [Find licensed electricians in Los Angeles](https://apify.com/stackrelay/cslb-california-scraper/examples/find-licensed-electricians-los-angeles)
- [Find licensed plumbers in San Diego](https://apify.com/stackrelay/cslb-california-scraper/examples/find-licensed-plumbers-san-diego)
- [Find licensed roofers in Sacramento](https://apify.com/stackrelay/cslb-california-scraper/examples/find-licensed-roofers-sacramento)
- [Find licensed HVAC contractors in San Jose](https://apify.com/stackrelay/cslb-california-scraper/examples/find-licensed-hvac-contractors-san-jose)
- [Find licensed general contractors in Orange County](https://apify.com/stackrelay/cslb-california-scraper/examples/find-licensed-general-contractors-orange-county)
- [Find licensed painters in Fresno](https://apify.com/stackrelay/cslb-california-scraper/examples/find-licensed-painters-fresno)

### Pricing

Pay-per-result. See the Store listing for the current per-1,000-records rate.

Only fully-formed records are pushed to the Dataset. If a scrape fails mid-record we discard the row — **you don't pay for broken data**. The `maxResults` input caps spend per run.

### Limitations

- **California only.** For Texas licenses, see the companion TDLR Texas Contractor License Scraper. For other states, see the portfolio.
- **No email addresses.** CSLB's public record set does not include contractor emails — only business phone and address. For email enrichment, feed the business name + address to LinkedIn, Apollo, ZoomInfo, or Clearbit downstream.
- **Mailing address is always `null`.** CSLB's public detail page does not separate mailing from business address.
- **Disciplinary action summaries are short codes only** (e.g. `"10/16/2023 - WC EXEMPT CANCELLED-LIC INACTIVATED"`). Full complaint narratives live on a separate CSLB page and are not scraped here.
- **Workers-comp data lags real-world changes** by up to ~30 days (CSLB filing delay, not this actor).
- **Residential proxy is required**, not optional. CSLB's edge (F5 BIG-IP) blocklists Apify's datacenter IP pool, which causes searches to silently return the empty form instead of results. The default proxy configuration uses Apify Residential and adds only a fraction of a cent per record in proxy traffic — we recommend leaving it on. Default `maxConcurrency: 8` and 3 retries handle CSLB's actual rate-limit behavior; lower concurrency further if you see retries climb.
- **Not affiliated with CSLB or the State of California.** Only publicly available data is scraped.

### FAQ

**Is scraping CSLB legal?** Yes. California license data is public record by statute (Business and Professions Code §7000 et seq.) and explicitly published by CSLB for public use. This actor does not use login, does not bypass any paywall, and collects only data CSLB publishes on its public license-check pages.

**Does this include contractor email addresses?** No — CSLB's public record set does not include email. You get `business_phone` and `business_address` on every record (plus a full personnel list with names and titles). If you need emails, pipe `business_name` + `business_address` into LinkedIn Sales Navigator, Apollo, ZoomInfo, or Clearbit — the combo resolves most CA contractors cleanly.

**Why does `businessName: "Smith"` return a contractor whose business name doesn't contain "Smith"?** CSLB's name search matches against **both the legal business name and associated personnel/owner names**. So `"Smith"` returns `Smith Construction Co` (business-name match) *and* `Johnie Cement Work` owned by John Smith (personnel match). This is useful for due-diligence and background-check workflows — you can find every CA license associated with a person, not just the ones with their name on the door. If you need strict business-name-only matching, filter the output downstream on the `business_name` field.

**How fresh is the data?** Each record is scraped live at run time and is a point-in-time snapshot — accurate only as of its `scraped_at` timestamp. It is as current as CSLB's published detail page at that moment (often same-day for status changes; workers-comp and bond filings can lag CSLB by roughly 1–30 days upstream, sometimes longer for amendments). Always re-verify at the record's `source_url` before relying on it.

**Can I run this on a schedule?** Yes. Apify Schedules handles cron. Weekly is a common cadence for keeping a contractor database fresh; daily is fine for narrow active-status monitoring.

**How do I export to Google Sheets / CSV / Airbyte / my database?** Every field is available via the Apify Dataset API in JSON, CSV, Excel, and HTML formats. Native integrations cover Zapier, Make, n8n, Airbyte, and direct Google Sheets push.

**Can I call this from Claude / Cursor / Cline or another MCP client?** Yes — any Apify actor is callable via Apify's official MCP server. Point your MCP client at `apify-mcp-server` and invoke this actor with the same input shape documented above.

**Why isn't there a "search everything" option (no primary filter)?** CSLB's public search doesn't expose a way to enumerate every California contractor — you must search by license number or business name (which as noted above also matches personnel/owner names). City, county, ZIP, and classification are narrowing filters only. This is a CSLB constraint, not a product choice.

**Why does this actor require Apify Residential proxy instead of datacenter?** CSLB's web edge (F5 BIG-IP) blocklists commercial datacenter IP ranges. A search routed through datacenter proxies silently returns the empty search form — the actor cannot tell the difference between "your search has no matches" and "you've been blocked," so runs error out with no records. Residential routes traffic through real consumer ISP connections, which CSLB serves normally. The cost difference is small (well under 1% of revenue at our pricing); the success-rate difference is not.

**How do I deduplicate across runs?** Use `license_number` — it's CSLB's stable primary key. Re-running the same search returns the same license numbers.

**Can you add TDLR Texas / Florida DBPR / other state contractor boards?** Yes — that's the roadmap. Each state ships as a separate actor so you only pay for the states you need.

### Data accuracy & legal notes

- **What this data is.** A best-effort, point-in-time snapshot of the public CSLB license-check pages. The actor is a pipe, not an oracle: fields are passed through from CSLB with formatting normalization only (title-casing, date formats, ZIP→county lookup). Coverage and field completeness vary by license and by what CSLB has on file.
- **It can be wrong or stale.** License status, bonds, workers-comp, and disciplinary/administrative entries change over time; some upstream filings lag CSLB by days to weeks. A record is accurate only as of its `scraped_at` timestamp. Every record carries a `source_url` to the official CSLB detail page — **independently verify any record there before relying on it.**
- **Disciplinary/administrative entries are verbatim source data.** They are point-in-time reproductions of what CSLB published, **not adjudications or determinations by StackRelay**. The `disciplinary_actions` vs `administrative_actions` split is a conservative heuristic — treat a non-empty `disciplinary_actions` array as a flag to review at `source_url`, not a confirmed finding. Do not republish these entries as fact without verifying them at the source.
- **Personal data.** Output includes personal data about individuals (owner/qualifying-party names, business addresses, phone). If you process data about EU/UK residents you may be an independent **data controller** under GDPR/UK GDPR and are responsible for a lawful basis and honoring data-subject rights.
- **Prohibited uses.** The output is **not a "consumer report"** and StackRelay is not a consumer reporting agency. **Do not use this data for FCRA-regulated purposes** — determining an individual's eligibility for employment, housing/tenancy, credit, or insurance. Verifying a contractor's license/bond/workers-comp status for compliance and due-diligence is the intended use. Do not use the data to harass, stalk, or profile individuals.
- **Not affiliated.** This actor is independently developed by StackRelay and is not affiliated with, endorsed by, or operated by CSLB or the State of California. Only publicly available data is scraped.
- **A disclaimer travels with every run** in the key-value store record `META`, and every dataset row carries `source_name`, `source_url`, and `scraped_at` provenance fields.

Full terms: see [DEVELOPER_TERMS.md](./DEVELOPER_TERMS.md). *These notes are for the developer's protection and are not legal advice.*

### Changelog

- `0.1` (April 2026) — Initial release. Direct license lookup, business-or-owner-name search with pagination (matches CSLB's native business + personnel name index), post-filters for city/county/ZIP/classification/status, ZIP→county auto-fill for all 58 California counties, normalized status and classification codes, full schema per record.
- `0.1.1` (July 2026) — Documented the `source_name` provenance field in the Store's dataset schema (was already shipping on every row, just wasn't declared). Added a third dataset view, **Compliance**, exposing `bonds`, `workers_comp`, `disciplinary_actions`, and `administrative_actions` for underwriting, due-diligence, and status-monitoring use cases. No output field or input schema changes.
- `0.1.2` (July 2026) — Published 40 SEO-optimized example Task pages on the Store listing (license verification by trade, city and county lookups, compliance/due-diligence, status monitoring, lead generation, and combined trade+city searches). Added a "Popular use cases" section below linking to all 40 for internal crawl/authority flow. No output field or input schema changes.
- `0.1.3` (July 2026) — Fixed a pagination/timeout bug affecting low-candidate-density searches (narrow businessName + city/classification combos): the SEARCH handler's multi-page pagination loop could exceed Crawlee's 60s per-request timeout, triggering a retry that started a second pagination loop without cancelling the first — runs still reported `SUCCEEDED` but with 0 results after ~4 minutes. Added an internal 45s time budget to the SEARCH loop so it always exits cleanly, plus disabled retries on SEARCH requests. Confirmed fix on the 3 affected example Task pages: runtime dropped from ~240–260s to ~51–58s with zero errors or retries. No output field or input schema changes.

# Actor input Schema

## `licenseNumber` (type: `string`):

Exact CSLB license number, e.g. '123456'. Fastest path — single-record direct lookup, no pagination. If set, Business Name is ignored. You must provide either this OR Business Name; leaving both blank will immediately fail the run.

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

Full or partial name. CSLB matches case-insensitively against the legal business name AND associated personnel/owner names — so 'Smith' returns both 'Smith Construction Co' (business name) and 'Johnie Cement Work' (owned by John Smith). You must provide either this OR License Number; leaving both blank will immediately fail the run. Use the filters below to narrow results.

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

Narrow the primary search to a California city, e.g. 'Los Angeles'. Matched case-insensitively against the business address city.

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

Narrow to a California county, e.g. 'Los Angeles', 'Orange', 'San Diego'. Do not include the word 'County'. ZIP-to-county mapping is applied automatically.

## `zipCode` (type: `string`):

5-digit California ZIP code, e.g. '90012'.

## `classification` (type: `string`):

CSLB classification code. Common codes: 'B' (General Building), 'A' (General Engineering), 'C-10' (Electrical), 'C-36' (Plumbing), 'C-20' (HVAC), 'C-33' (Painting), 'C-39' (Roofing), 'C-27' (Landscaping). See cslb.ca.gov for the full classification list.

## `status` (type: `string`):

Filter by current license status. 'Active' is the common choice for lead-generation and insurance use cases.

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

Hard cap on records pushed to the Dataset. Protects you from accidental large runs — billing is per record pushed. Start low (50–100) to validate output quality before scaling up.

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

Apify Residential proxy is required — CSLB's edge (F5 BIG-IP) blocklists datacenter IP pools, which causes the search to silently return the empty form instead of results. Residential adds a fraction of a cent per record in proxy traffic, well within billing margin.

## `maxConcurrency` (type: `integer`):

Parallel request slots. Measured peak throughput plateaus at concurrency 4 for this actor because search pagination is inherently sequential. Default 8 gives a safe margin; lower to 2–4 for the gentlest footprint.

## Actor input object example

```json
{
  "licenseNumber": "123456",
  "businessName": "Acme Construction",
  "status": "any",
  "maxResults": 10,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "maxConcurrency": 8
}
```

# Actor output Schema

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

Full CSLB public record per license (status, classifications, bonds, workers'-comp, disciplinary/administrative history, personnel, phone, address). One row per unique license_number; every row carries source_url and scraped_at.

# 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 = {
    "businessName": "Smith Construction",
    "maxResults": 10,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("stackrelay/cslb-california-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 = {
    "businessName": "Smith Construction",
    "maxResults": 10,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("stackrelay/cslb-california-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 '{
  "businessName": "Smith Construction",
  "maxResults": 10,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call stackrelay/cslb-california-scraper --silent --output-dataset

```

## MCP server setup

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