# 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, 100.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 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 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

Download the OpenAPI definition: https://api.apify.com/v2/actors/hZvUPcAhK2W2K5clI/builds/MKIsp9VQztTesi9z9/openapi.json
