# California Attorney Scraper: State Bar Directory (`getascraper/ca-state-bar-attorney-scraper`) Actor

Scrape California State Bar attorney directory. Extract name, bar number, license status, city, and optional contact details. Drop-in for Salesforce, HubSpot, and legal CRMs. Skip manual lookup. $0.02 per record.

- **URL**: https://apify.com/getascraper/ca-state-bar-attorney-scraper.md
- **Developed by:** [GetAScraper](https://apify.com/getascraper) (community)
- **Categories:** Lead generation, AI, Agents
- **Stats:** 1 total users, 1 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 attorney 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/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.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.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/platform/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

### What does CA State Bar Attorney Scraper do?

Scrape **[California State Bar public attorney directory](https://apps.calbar.ca.gov/attorney/LicenseeSearch/QuickSearch)** by attorney name, partial name, or bar number. Extract core data (name, bar number, city, status, admitted date, detail page URL) or enrich with contact details and practice areas. The Actor queries the CA Bar's free search API (HTTP GET, no browser needed, no proxy required) and returns up to 500 results per search.

Try it in the Apify Console. Enter a search term (e.g., `Smith` or `Bar Number: 123456`), optionally toggle detail page enrichment, and hit Start. Download results as JSON, CSV, or Excel. Built on Apify, you also get: scheduled runs, HTTP API access, integrations with Zapier / n8n / Make, monitoring, and alerts.

### Why use CA State Bar Attorney Scraper?

- **Legal-tech data enrichment.** Bulk-verify attorney credentials, enrich client lists with bar numbers and admission dates.
- **Law firm lead generation.** Find attorneys by practice area, city, or bar number for outreach and partnership pipelines.
- **Compliance verification.** Check attorney status (Active, Inactive, Suspended) for due diligence, contract review, or risk assessment.
- **Journalist research.** Background checks, disciplinary history cross-reference, story leads on legal industry trends.
- **Competitive intelligence.** Track competitor attorneys, practice area presence, and firm growth across California.
- **Public record aggregation.** Bulk export attorney data for legal databases, directories, or RAG systems.

All data is public record. CA State Bar explicitly permits programmatic access to the attorney directory for legitimate research and compliance purposes.

### How to use CA State Bar Attorney Scraper

1. **Open the Actor** on Apify Store.
2. **Enter a search value**: attorney name (e.g., `Smith, John` or `Smith`), partial name, or bar number (e.g., `123456`).
3. **Set max results** (default 100, max 500 per search query).
4. **(Optional) Enable detail page enrichment** to fetch phone, email, address, and practice areas (this doubles API requests and cost).
5. **Click Start.** The Actor queries the CA Bar, extracts results, and pushes them to your dataset.
6. **Download results** from the Storage tab as JSON, CSV, or Excel.

For bulk searches, run the Actor multiple times with different names or use scheduled runs to refresh data weekly.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `searchValue` | string | required | Attorney name (e.g., `Smith` or `Smith, John`), partial name, or bar number (e.g., `123456`) |
| `maxResults` | integer | 100 | Maximum records to return per search (0 = unlimited, hard cap 500 from CA Bar API) |
| `includeDetails` | boolean | false | Fetch detail page for phone, email, address, practice areas (increases requests and cost) |

**Example input:**

```json
{
    "searchValue": "Smith",
    "maxResults": 100,
    "includeDetails": false
}
````

### Output

Each attorney becomes one dataset item. You can download the dataset in JSON, HTML, CSV, or Excel.

**Basic output (includeDetails: false):**

```json
{
    "name": "Smith, John A.",
    "barNumber": "123456",
    "city": "Los Angeles",
    "status": "Active",
    "admittedDate": "June 1998",
    "detailUrl": "https://apps.calbar.ca.gov/attorney/Licensee/Detail/123456"
}
```

**Enriched output (includeDetails: true):**

```json
{
    "name": "Smith, John A.",
    "barNumber": "123456",
    "city": "Los Angeles",
    "status": "Active",
    "admittedDate": "June 1998",
    "detailUrl": "https://apps.calbar.ca.gov/attorney/Licensee/Detail/123456",
    "phone": "(213) 555-0100",
    "email": "jsmith@lawfirm.com",
    "address": "123 Main St, Los Angeles, CA 90001",
    "practiceAreas": ["Civil Litigation", "Real Estate"]
}
```

### Data table

| Field | Type | Description |
|---|---|---|
| `name` | string | Attorney name as listed on CA Bar (formatted as Last, First, Middle) |
| `barNumber` | string | California bar license number (unique identifier) |
| `city` | string | City of record (mailing/office address) |
| `status` | string | License status: Active, Inactive, Suspended, Resigned, Deceased, Disbarred |
| `admittedDate` | string | Month and year admitted to California bar (e.g., `June 1998`) |
| `detailUrl` | string | Link to full detail page on CA Bar website |
| `phone` | string? | Phone number (present only if includeDetails: true) |
| `email` | string? | Email address (present only if includeDetails: true) |
| `address` | string? | Full office/mailing address (present only if includeDetails: true) |
| `practiceAreas` | string\[]? | Array of practice areas (e.g., `["Civil Litigation", "Real Estate"]`, present only if includeDetails: true) |

### How much does it cost to scrape the California State Bar?

**$0.02 per record** (pay-per-result, PPR).

#### Pricing breakdown

| Volume | Search mode | Cost |
|---|---|---|
| 100 records | Basic (no details) | ~$2.00 |
| 100 records | Enriched (with details) | ~$4.00 |
| 1,000 records | Basic | ~$20.00 |
| 1,000 records | Enriched | ~$40.00 |
| 10,000 records | Basic | ~$200.00 |
| 10,000 records | Enriched | ~$400.00 |

No subscription. No minimum. You pay only for successful records.

**Important:** The CA Bar returns up to 500 results per query. For searches returning fewer results, you pay for what you get. For generic names (e.g., `Smith`), you may hit the 500-cap and need to use more specific queries or bar numbers.

### Tips and advanced options

- **Use bar number for exact lookup.** Query `123456` or `Bar: 123456` to fetch a specific attorney instantly and skip partial-name searches.
- **Use last name + first initial to narrow results.** Instead of `Smith` (may hit 500-result cap), try `Smith, J` or `Smith, John` to reduce matches and cost.
- **Start with includeDetails: false.** Get core data first (~1 sec per 100 records), then selectively enrich records you need with a second run.
- **Schedule weekly runs.** Status changes (Suspended, Disbarred, Resigned) happen regularly. Keep your attorney database fresh with recurring searches.
- **Batch multiple queries.** Run separate Actor calls for different cities or practice areas to parallelize and reduce individual query cost.
- **Use CSV/Excel export.** Download as CSV for easy dedupe, filtering, and import into legal databases or CRM systems.

### FAQ, disclaimers, and support

#### Is scraping California State Bar legal?

Yes. The California State Bar explicitly publishes the attorney directory for public access at [apps.calbar.ca.gov/attorney/LicenseeSearch/QuickSearch](https://apps.calbar.ca.gov/attorney/LicenseeSearch/QuickSearch). This Actor respects the CA Bar's terms of service and uses their public API. All data is public record, not personal or confidential. Use the data responsibly and in compliance with California and federal law.

#### What is the 500-result cap?

The CA Bar API returns a maximum of 500 results per search query. If your search matches 500+ attorneys (e.g., all attorneys named `Smith`), you will only get 500. Refine your search with first names, bar numbers, or other criteria to narrow results.

#### Can I use this for spam or harassment?

No. Attorney contact data is public, but using it for spam, harassment, unsolicited bulk contact, or any illegal activity is prohibited and may violate California and federal law (CAN-SPAM Act, etc.). Use the data only for legitimate business, research, legal, or journalistic purposes.

#### What if includeDetails fails for some records?

If a detail page is unreachable or contains unexpected HTML, the Actor logs a soft failure and returns the basic record without contact fields. Phone, email, address, and practice areas may be null or missing. This is expected for a small percentage of detail pages.

#### How do I handle duplicate names?

The bar number is the unique identifier. Use `barNumber` to dedupe, merge, or verify records across datasets.

#### Custom requirements?

Need a different data format, automated scheduling, or custom fields? Use the **Issues** tab on the Actor's page to request features or report bugs. Custom solutions (e.g., batch database sync, real-time webhooks) are available through Apify's consulting team.

#### Support

Found a bug or want a feature? Use the **Issues** tab on the Actor's page. For questions, contact support via the Actor's Support link.

***

**Built with Apify + Cheerio + TypeScript.** Part of the [actorstack](https://github.com/Devansh-365/actorstack) portfolio. Scrape California State Bar attorney directory data for legal-tech, compliance, research, and competitive intelligence.

# Actor input Schema

## `searchValue` (type: `string`):

Attorney name (last name, or last name first name), partial name, or bar number to search.

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

Maximum number of attorney records to return. Set to 0 for unlimited.

## `includeDetails` (type: `boolean`):

Fetch each attorney detail page for phone, email, address, practice areas, and admission date. Increases run time and cost (~2x requests).

## Actor input object example

```json
{
  "searchValue": "Smith",
  "maxResults": 100,
  "includeDetails": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# 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 = {
    "searchValue": "Smith"
};

// Run the Actor and wait for it to finish
const run = await client.actor("getascraper/ca-state-bar-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 = { "searchValue": "Smith" }

# Run the Actor and wait for it to finish
run = client.actor("getascraper/ca-state-bar-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 '{
  "searchValue": "Smith"
}' |
apify call getascraper/ca-state-bar-attorney-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "California Attorney Scraper: State Bar Directory",
        "description": "Scrape California State Bar attorney directory. Extract name, bar number, license status, city, and optional contact details. Drop-in for Salesforce, HubSpot, and legal CRMs. Skip manual lookup. $0.02 per record.",
        "version": "0.0",
        "x-build-id": "davhXAawuHCbUspLa"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/getascraper~ca-state-bar-attorney-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-getascraper-ca-state-bar-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/getascraper~ca-state-bar-attorney-scraper/runs": {
            "post": {
                "operationId": "runs-sync-getascraper-ca-state-bar-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/getascraper~ca-state-bar-attorney-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-getascraper-ca-state-bar-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",
                "required": [
                    "searchValue"
                ],
                "properties": {
                    "searchValue": {
                        "title": "Search Value",
                        "type": "string",
                        "description": "Attorney name (last name, or last name first name), partial name, or bar number to search.",
                        "default": "Smith"
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum number of attorney records to return. Set to 0 for unlimited.",
                        "default": 100
                    },
                    "includeDetails": {
                        "title": "Include Detail Page Data",
                        "type": "boolean",
                        "description": "Fetch each attorney detail page for phone, email, address, practice areas, and admission date. Increases run time and cost (~2x requests).",
                        "default": false
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
