# California CSLB Scraper — Contractor Licenses (`muhammadafzal/cslb-california-scraper`) Actor

Scrape California CSLB contractor licenses, classifications, status, business details, personnel, bonds, and public compliance data.

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

## Pricing

from $25.00 / 1,000 license records

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/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 CSLB Scraper — Contractor Licenses

Scrape the California Contractors State License Board (CSLB) public database for full contractor license records. Search by license number, business name, personnel name, or ZIP code — get status, all classifications, bonds, workers' comp, disciplinary actions, personnel, and full contact details in structured JSON.

### Use cases

- **Contractor verification** — confirm a contractor is licensed and in good standing before hiring
- **Compliance monitoring** — detect newly expired, suspended, or revoked licenses for vendor lists on recurring schedules
- **Lead generation** — build targeted lists of licensed contractors by ZIP code, city, classification, or active status
- **Subcontractor sourcing** — find qualified subcontractors by specialty classification and region
- **Insurance underwriting** — score contractors using disciplinary actions, bond cancellation history, and workers' comp status
- **Due diligence** — check complaint and legal action history before signing contracts
- **Market research** — analyze contractor density by county/classification, track new-license issuance trends

### Input

The actor supports four search modes. Use any one or combine multiple:

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `licenseNumbers` | array | no | `[]` | Direct license-number lookup (fastest). Example: `["1000001", "812345"]` |
| `businessName` | string | no | `""` | Full or partial business name. Example: `"Smith Construction"` |
| `personnelLastName` | string | no | `""` | Last name of license-holding individual |
| `personnelFirstName` | string | no | `""` | Optional first name to narrow personnel search |
| `zipCodes` | array | no | `[]` | California ZIP codes for region-based search. Example: `["92101", "90012"]` |
| `city` | string | no | `""` | Client-side filter on business address city |
| `classification` | string | no | `""` | Filter by CSLB classification code (e.g. `"C-10"`, `"B"`) |
| `status` | select | no | `"any"` | Filter by license status: `any`, `active`, `expired`, `suspended`, `revoked`, `canceled`, `inactive` |
| `maxResults` | integer | no | `100` | Hard cap on records returned |
| `customProxyUrl` | string | no | `""` | Premium residential proxy URL for maximum reliability |
| `proxyConfiguration` | object | no | residential | Apify proxy settings |

**At least one search mode is required.**

#### Example inputs

**License number lookup:**

```json
{
    "licenseNumbers": ["842951", "1000001"],
    "maxResults": 2
}
```

**Business name search:**

```json
{
    "businessName": "Pacific Construction",
    "status": "active",
    "maxResults": 50
}
```

**ZIP code lead generation:**

```json
{
    "zipCodes": ["92101", "92102"],
    "classification": "C-20",
    "status": "active",
    "maxResults": 200
}
```

**Personnel name search:**

```json
{
    "personnelLastName": "Smith",
    "personnelFirstName": "John",
    "maxResults": 25
}
```

### Output

Each record contains the full public record for one contractor license:

| Field | Type | Description |
|-------|------|-------------|
| `license_number` | string | CSLB license number |
| `business_name` | string | Legal business name |
| `license_status` | string | Active, Expired, Suspended, Revoked, Canceled, or Inactive |
| `entity_type` | string|null | CORPORATION, LLC, SOLE OWNER, etc. |
| `issue_date` | string|null | Original license issue date (ISO 8601) |
| `expiration_date` | string|null | License expiration date (ISO 8601) |
| `business_address` | string|null | Full street address |
| `city` | string|null | Business address city |
| `county` | string|null | California county (derived from ZIP) |
| `zip_code` | string|null | Business address ZIP |
| `business_phone` | string|null | Business phone number |
| `classifications` | array | All license classifications `[{code, description}]` |
| `bonds` | array | All bonds: contractor's bond, qualifier bond `[{type, company, amount_usd, bond_number, effective_date, cancellation_date}]` |
| `workers_comp` | object|null | Workers' comp carrier, policy, dates, or exempt status |
| `qualifiers` | array | Qualifying individuals `[{name, association}]` |
| `personnel` | array | All listed personnel `[{name, classification, license_number, status}]` |
| `disciplinary_actions` | array | Disciplinary actions `[{date, type, summary}]` |
| `administrative_actions` | array | Administrative actions `[{date, type, summary}]` |
| `detail_url` | string | Direct CSLB detail page link |
| `scraped_at` | string | ISO 8601 timestamp |
| `source_url` | string | Source page URL |

### Pricing

| Event | Price |
|-------|-------|
| Actor Start | $0.00005 |
| License Record | $0.025 per record |

You only pay for records successfully scraped. Start with a small `maxResults` to test before scaling.

### Technical notes

- **Residential proxy required**: CSLB's F5 BIG-IP WAF blocklists datacenter IPs. The actor uses Apify residential proxy by default. For production bulk runs, provide a premium residential proxy via `customProxyUrl` (Decodo/Bright Data/IPRoyal) for maximum reliability.
- **Scheduled downtime**: The CSLB database is unavailable Sundays 8 PM through Monday 6 AM Pacific Time. Avoid scheduling runs during this window.
- **Search limits**: Business name searches return up to 50 names per page (pagination handled automatically). Personnel name searches return up to 100 names per page.
- **Classification codes**: See the [CSLB classification list](https://www.cslb.ca.gov/About_Us/Library/Licensing_Classifications/) for all 40+ specialty codes.

### Integration

Export scraped data, run the scraper via API, schedule and monitor runs, or integrate with other tools. The output dataset is compatible with:

- CSV/JSON/Excel export from Apify Console
- Zapier and Make webhooks
- Direct API access via Apify REST API
- CRM import (HubSpot, Salesforce) with field mapping
- AI agent tool calls via Apify MCP server

### What is California CSLB Scraper?

**California CSLB Scraper** turns the target data into structured, reusable results on Apify. Use it when you need repeatable collection for sales teams, agencies, recruiters, market researchers, and data-enrichment workflows without maintaining a custom scraper or one-off integration. Run it manually, schedule recurring jobs, call it through the Apify API, or connect it to an AI agent through the Apify MCP server.

The Actor stores results in an Apify dataset, where they can be previewed and exported as JSON, CSV, Excel, XML, or RSS. Availability and completeness depend on the source, supplied inputs, public visibility, authentication requirements, and upstream rate limits.

### Use cases for California CSLB Scraper

- Build structured datasets for research, reporting, enrichment, or monitoring.
- Automate repetitive collection with schedules, webhooks, and API calls.
- Feed clean records into spreadsheets, databases, CRMs, BI tools, AI agents, or RAG pipelines.
- Track changes over time by running the same validated input on a schedule.
- Replace fragile manual copy-and-paste work with a reproducible Apify workflow.

### How to use California CSLB Scraper

1. Open the Actor input page and choose a focused, valid target.
2. Set a conservative result limit for the first run.
3. Start the Actor and inspect the dataset for coverage and field availability.
4. Export the results or connect the dataset to your downstream system.
5. Scale gradually and use scheduling, pagination, or proxies when supported.

#### Important input options

- `licenseNumbers` — Look up specific CSLB license numbers (e.g. '1000001', '812345'). Fastest search method — direct single-record lookup, no pagination. Use this field when the user provides exact license numb
- `businessName` — Full or partial contractor business name. CSLB matches case-insensitively against the legal business name AND associated personnel/owner names — so 'Smith' returns both 'Smith Construction C
- `personnelLastName` — Last name of an individual on a contractor license (owner, officer, or qualifier). Use this field together with personnelFirstName to search by person. Returns up to 100 names per search; pa
- `personnelFirstName` — Optional first name to narrow a personnel-name search. Only applies when personnelLastName is set. Leave blank to search by last name only (returns more results).
- `zipCodes` — List of 5-digit California ZIP codes (e.g. '92101', '90012') to find licensed contractors in each area. Use this when the user wants contractors by region or for building territory-based lea
- `city` — Filter results to a specific California city (e.g. 'San Diego', 'Los Angeles'). Applied as a client-side filter on the business address city. Use this to narrow ZIP-code or business-name sea
- `classification` — Filter results to a specific CSLB classification code. Common codes: 'A' (General Engineering), 'B' (General Building), 'C-10' (Electrical), 'C-36' (Plumbing), 'C-20' (HVAC), 'C-33' (Paintin
- `status` — Filter results by current license status. 'Active' is the common choice for lead-generation and insurance use cases. 'Any' returns all records regardless of status.

### API and automation example

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('muhammadafzal/cslb-california-scraper').call({
  // Add the same input fields you use in the Apify Console.
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Related Apify Actors

Use these dedicated tools when a neighboring data source or workflow is a better match:

- [Leads Finder Pro - B2B Leads with Emails \[Apollo Alternative\]](https://apify.com/muhammadafzal/leads-finder-pro)
- [Yellow Pages US Scraper — Business Leads & Reviews](https://apify.com/muhammadafzal/yellow-pages-us-scraper)
- [Yellow Pages Australia Scraper — Business Leads & Reviews](https://apify.com/muhammadafzal/yellow-pages-au-scraper)
- [Instagram Followers & Following Scraper — With Cookies](https://apify.com/muhammadafzal/instagram-following-scraper)
- [OpenTable Restaurants, Ratings & Reviews Scraper](https://apify.com/muhammadafzal/opentable-scraper)
- [Etsy Scraper Pro — Products, Prices, Reviews & Shop Data](https://apify.com/muhammadafzal/etsy-scraper-pro)
- [YouTube Thumbnail Downloader](https://apify.com/muhammadafzal/youtube-thumbnail-downloader)
- [AllTrails Scraper — Hiking Trails, Reviews & GPS Data](https://apify.com/muhammadafzal/alltrails-scraper)
- [Email Validator — Syntax, MX & Risk Checks](https://apify.com/muhammadafzal/email-address-validator)
- [Google Play Reviews Scraper](https://apify.com/muhammadafzal/google-play-reviews-scraper)

### Frequently asked questions

#### How many results can I scrape with California CSLB Scraper?

The practical total depends on the source, input limits, pagination, available records, run timeout, and upstream restrictions. Start with a small run, verify the output, and increase the limit gradually.

#### Can I integrate California CSLB Scraper with other apps?

Yes. Use Apify integrations, webhooks, schedules, dataset exports, Make, Zapier, Google Sheets, cloud storage, or your own application.

#### Can I use California CSLB Scraper with the Apify API?

Yes. Start runs with the Apify REST API or an official Apify client, then retrieve records from the run's default dataset. Keep your API token in a secret or environment variable.

#### Can I use California CSLB Scraper through an MCP Server?

Yes. The Apify MCP server can expose the Actor to compatible AI clients and agents. Review the input and expected cost before allowing an autonomous workflow to run it at scale.

#### Do I need proxies?

It depends on the source and volume. Use the default configuration first. For larger or geographically sensitive jobs, select an appropriate proxy configuration only when the Actor supports it.

#### Is it legal to scrape this data?

Scraping rules vary by source, jurisdiction, data type, and intended use. Collect only data you are authorized to access, respect applicable terms and privacy laws, and avoid restricted or personal data misuse. This documentation is not legal advice.

#### Your feedback

If a field is missing, a source layout has changed, or you need a supported use case documented, open an issue on the Actor page with a reproducible input and run ID.

# Actor input Schema

## `licenseNumbers` (type: `array`):

Look up specific CSLB license numbers (e.g. '1000001', '812345'). Fastest search method — direct single-record lookup, no pagination. Use this field when the user provides exact license numbers or a list of licenses to verify. Do NOT use this when the user describes a trade, region, or company name — use businessName, personnelLastName, or zipCodes instead.

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

Full or partial contractor business name. CSLB matches case-insensitively against the legal business name AND associated personnel/owner names — so 'Smith' returns both 'Smith Construction Co' (business) and 'Johnie Cement Work' (owned by John Smith). Use this when the user gives a company name. Returns up to 50 names per search; pagination is handled automatically. Do NOT use this for license-number lookups — use licenseNumbers instead.

## `personnelLastName` (type: `string`):

Last name of an individual on a contractor license (owner, officer, or qualifier). Use this field together with personnelFirstName to search by person. Returns up to 100 names per search; pagination is handled automatically. Use this when the user provides a person's name rather than a company name. Do NOT use this for business-name searches — use businessName instead.

## `personnelFirstName` (type: `string`):

Optional first name to narrow a personnel-name search. Only applies when personnelLastName is set. Leave blank to search by last name only (returns more results).

## `zipCodes` (type: `array`):

List of 5-digit California ZIP codes (e.g. '92101', '90012') to find licensed contractors in each area. Use this when the user wants contractors by region or for building territory-based lead lists. The CSLB ZIP search returns contractors registered in that ZIP. Combine with classification and status filters to narrow results. Do NOT use this for a single license lookup — use licenseNumbers instead.

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

Filter results to a specific California city (e.g. 'San Diego', 'Los Angeles'). Applied as a client-side filter on the business address city. Use this to narrow ZIP-code or business-name searches to one city. Not a standalone search mode — combine with zipCodes or businessName.

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

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

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

Filter results by current license status. 'Active' is the common choice for lead-generation and insurance use cases. 'Any' returns all records regardless of status.

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

Hard cap on records pushed to the dataset. Protects against accidental large runs — billing is per record pushed. Start low (10-50) to validate output quality before scaling up. Free users are limited to 100 results; paid users can request up to 1,000,000.

## `customProxyUrl` (type: `string`):

Optional premium residential proxy URL (e.g. 'http://user:pass@proxy.decodo.com:10000'). CSLB's edge (F5 BIG-IP) blocklists Apify's shared datacenter IPs and may throttle shared residential. For production runs, provide your own premium residential proxy (Decodo/Bright Data/IPRoyal) for maximum reliability. If left blank, the actor uses Apify residential proxy automatically.

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

Apify proxy settings. Residential proxy is recommended — CSLB's F5 BIG-IP WAF blocklists datacenter IP pools, causing 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.

## Actor input object example

```json
{
  "licenseNumbers": [],
  "businessName": "Smith Construction",
  "zipCodes": [],
  "status": "any",
  "maxResults": 10,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Link to the dataset containing all extracted CSLB contractor 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 = {
    "licenseNumbers": [],
    "businessName": "Smith Construction",
    "personnelLastName": "",
    "personnelFirstName": "",
    "zipCodes": [],
    "city": "",
    "classification": "",
    "status": "any",
    "maxResults": 10,
    "customProxyUrl": "",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammadafzal/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 = {
    "licenseNumbers": [],
    "businessName": "Smith Construction",
    "personnelLastName": "",
    "personnelFirstName": "",
    "zipCodes": [],
    "city": "",
    "classification": "",
    "status": "any",
    "maxResults": 10,
    "customProxyUrl": "",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

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

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/7e2Q22saxd45WhTqe/builds/mGyhHisML2BLW4zTN/openapi.json
