# California State Bar Attorney Scraper — Phone, Firm, License (`scrapersdelight/ca-attorney-scraper`) Actor

Scrape licensed California attorneys from the State Bar directory — name, bar number, firm, mailing address, city, phone, website, license status, law school and admission date. Filter by city, name, firm or bar-number range. No login. Export JSON/CSV.

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

## Pricing

$4.00 / 1,000 per attorney 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## California State Bar Attorney Scraper

Turn the official **State Bar of California** licensee directory into a structured, ready-to-use attorney lead list — one clean row per licensed attorney, with phone, firm, mailing address and license status.

California is the largest bar in the United States (250k+ licensees) — the definitive contact universe for anyone who sells to attorneys.

### What you get

One row per attorney:

- `name`, `barNumber`, `licenseStatus` (Active / Inactive / Not Eligible / Resigned / Disbarred / Suspended)
- `firmName`, `address`, `city`, `state`, `zip` — parsed from the published mailing address
- `phone`, `fax` — in **plaintext** on the source
- `website` — when the attorney lists one
- `county`, `lawSchool`, `admissionDate`, `practiceAreas` (self-reported)
- `hasDisciplinaryRecord` — boolean, derived from the public license-history table
- `profileUrl`, `scrapedAt`

> **Email is NOT returned.** The State Bar obfuscates attorney emails with JavaScript decoys (about 20 fake `mailto:` spans per page, only the real one un-hidden by client-side script at runtime), so no HTTP/HTML scrape can reliably pick the real address. This actor returns **phone, firm and mailing address**, which the State Bar publishes in plaintext. No email is claimed anywhere.

### Use cases

- Build **malpractice-insurance** prospect lists (carriers & brokers)
- **Legal-SaaS** outbound (practice-management, e-signature, billing)
- **CLE / bar-prep** marketing lists
- **Legal recruiting** and lateral sourcing
- **Expert-witness** and co-counsel sourcing
- Attorney **license verification** (status + bar number + admission date)

### Inputs

Two modes:

**1. Search (default)** — targeted pulls:
- `queries` — free-text terms (a last name, a firm, or `lastname, city`). Each query returns up to **500** attorneys (the site's hard cap). If a query hits 500, the log tells you to narrow it (e.g. add a city or split by last-name prefix).
- `cities` — exact-match city search (Advanced Search) when you want everyone in a city.
- `statusFilter` — keep only the license statuses you want (e.g. just `Active`). Empty = keep all.

**2. Bar-number range** — full-coverage crawl:
- `barNumberStart` / `barNumberEnd` — bar numbers are sequential, so a range walks every profile in `[start, end]`.

`maxRecords` caps how many attorneys the run returns (cost/speed guard).

#### Example input

```json
{
  "searchMode": "search",
  "queries": ["smith"],
  "cities": ["Los Angeles"],
  "statusFilter": ["Active"],
  "maxRecords": 1000
}
````

### Output sample

```json
{
  "barNumber": "290151",
  "name": "Aaron Thomas Smith",
  "licenseStatus": "Active",
  "firmName": "Aaron T. Smith PC",
  "address": "1550 NW Eastman Pkwy, Ste 180, Gresham, OR 97030-3848",
  "city": "Gresham",
  "state": "OR",
  "zip": "97030-3848",
  "county": "",
  "phone": "503-667-5300",
  "fax": null,
  "website": null,
  "email": null,
  "lawSchool": "Thomas Jefferson SOL; San Diego CA",
  "admissionDate": "6/6/2013",
  "practiceAreas": "Elder Law; Trusts & Estates; Wills & Probate",
  "hasDisciplinaryRecord": false,
  "profileUrl": "https://apps.calbar.ca.gov/attorney/Licensee/Detail/290151",
  "scrapedAt": "2026-07-07T00:00:00.000Z"
}
```

Export as JSON, CSV, Excel or via the Apify API.

### Pricing

**Pay per result** — you are charged **per attorney record** returned (the `attorney-scraped` event). No subscription, no monthly minimum. Set `maxRecords` to bound spend on any run.

### Legal note

This data is **public record** published by the State Bar of California. Use it only for lawful B2B outreach and license verification. You are responsible for complying with applicable laws (including anti-spam and privacy rules) when contacting attorneys.

# Actor input Schema

## `searchMode` (type: `string`):

Search = partition by your queries (each ≤500 results). Range = crawl every bar number in \[start,end].

## `queries` (type: `array`):

Free-text QuickSearch terms — a last name, firm, or 'lastname, city'. Each query returns up to 500 attorneys.

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

City names for AdvancedSearch (exact match). Use when you want everyone in a city.

## `statusFilter` (type: `array`):

Keep only these statuses. Empty = keep all.

## `barNumberStart` (type: `integer`):

Range mode only.

## `barNumberEnd` (type: `integer`):

Range mode only.

## `maxRecords` (type: `integer`):

Cap on attorneys returned this run (cost/speed guard).

## Actor input object example

```json
{
  "searchMode": "search",
  "queries": [
    "smith"
  ],
  "cities": [
    "Los Angeles"
  ],
  "statusFilter": [
    "Active"
  ],
  "barNumberStart": 300000,
  "barNumberEnd": 300500,
  "maxRecords": 25
}
```

# Actor output Schema

## `records` (type: `string`):

The dataset of scraped California attorneys (one item per licensee).

# 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 = {
    "queries": [
        "smith"
    ],
    "cities": [
        "Los Angeles"
    ],
    "statusFilter": [
        "Active"
    ],
    "barNumberStart": 300000,
    "barNumberEnd": 300500,
    "maxRecords": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapersdelight/ca-attorney-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 = {
    "queries": ["smith"],
    "cities": ["Los Angeles"],
    "statusFilter": ["Active"],
    "barNumberStart": 300000,
    "barNumberEnd": 300500,
    "maxRecords": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("scrapersdelight/ca-attorney-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 '{
  "queries": [
    "smith"
  ],
  "cities": [
    "Los Angeles"
  ],
  "statusFilter": [
    "Active"
  ],
  "barNumberStart": 300000,
  "barNumberEnd": 300500,
  "maxRecords": 25
}' |
apify call scrapersdelight/ca-attorney-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "California State Bar Attorney Scraper — Phone, Firm, License",
        "description": "Scrape licensed California attorneys from the State Bar directory — name, bar number, firm, mailing address, city, phone, website, license status, law school and admission date. Filter by city, name, firm or bar-number range. No login. Export JSON/CSV.",
        "version": "0.1",
        "x-build-id": "syJZZjpY045w46ers"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrapersdelight~ca-attorney-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrapersdelight-ca-attorney-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/scrapersdelight~ca-attorney-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scrapersdelight-ca-attorney-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/scrapersdelight~ca-attorney-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scrapersdelight-ca-attorney-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "searchMode": {
                        "title": "Mode",
                        "enum": [
                            "search",
                            "barNumberRange"
                        ],
                        "type": "string",
                        "description": "Search = partition by your queries (each ≤500 results). Range = crawl every bar number in [start,end].",
                        "default": "search"
                    },
                    "queries": {
                        "title": "Search terms",
                        "type": "array",
                        "description": "Free-text QuickSearch terms — a last name, firm, or 'lastname, city'. Each query returns up to 500 attorneys.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "cities": {
                        "title": "Cities (Advanced)",
                        "type": "array",
                        "description": "City names for AdvancedSearch (exact match). Use when you want everyone in a city.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "statusFilter": {
                        "title": "License status filter",
                        "type": "array",
                        "description": "Keep only these statuses. Empty = keep all.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "Active",
                                "Inactive",
                                "Not Eligible",
                                "Resigned",
                                "Disbarred",
                                "Suspended"
                            ]
                        }
                    },
                    "barNumberStart": {
                        "title": "Bar # start",
                        "type": "integer",
                        "description": "Range mode only."
                    },
                    "barNumberEnd": {
                        "title": "Bar # end",
                        "type": "integer",
                        "description": "Range mode only."
                    },
                    "maxRecords": {
                        "title": "Max records",
                        "type": "integer",
                        "description": "Cap on attorneys returned this run (cost/speed guard).",
                        "default": 1000
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
