# California State Bar Attorney Scraper (`blueorion/california-state-bar-attorney-scraper`)

Scrape attorney profiles from The State Bar of California, including name, license status, contact info, emails, law school, languages spoken, and disciplinary history. Use search keywords, and extracts up to 500 attorneys per query. Ideal for legal research, background checks, compliance workflows.

- **URL**: https://beta-securitybyobscurity.apify.com/blueorion/california-state-bar-attorney-scraper.md
- **Developed by:** [Blue Orion](https://beta-securitybyobscurity.apify.com/blueorion) (community)
- **Categories:** Lead generation, Other, Automation
- **Stats:** 15 total users, 5 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00 / 1,000 results

This Actor is paid per result. You are not charged for the Apify platform usage, but only a fixed price for dataset items the Actor outputs.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-result

# README

## 🧑‍⚖️ The State Bar of California Attorney Scraper

This Apify Actor scrapes public attorney profile data from [The State Bar of California](https://apps.calbar.ca.gov/attorney/LicenseeSearch/QuickSearch). It takes a list of search keywords (names or partial names), visits the search results, and extracts detailed information about each listed attorney — including contact info, license history, law school, languages, and more.

***

### 📥 Input Schema

The actor accepts the following input fields:

- `searchKeys` (array): **Required.** List of names or keywords to search for attorneys.
- `maxResult` (integer): Optional. Maximum number of attorneys to scrape per keyword (min: 10, max: 500).
- `similarSearch` (string): Optional. `"yes"` to include similar-sounding names via the State Bar's "Sounds Like" feature.

```json
{
  "searchKeys": ["Abc", "Andy"],
  "maxResult": 100,
  "similarSearch": "yes"
}
```

***

### 📤 Output Structure

Each attorney result is saved as a JSON object in the Apify dataset, including:

- Full name, license number, status, city, admission date
- Contact info: address, phone, fax, emails, website
- CLA sections and self-reported practice areas
- Languages spoken (by attorney and staff)
- Law school
- License status and disciplinary history (with dates and actions)

#### Output Example

Each attorney result is saved as a JSON object in the Apify dataset:

```json
{
  "name": "Aba, Isaac",
  "url": "/attorney/Licensee/Detail/319726",
  "status": "Active",
  "number": "319726",
  "city": "Los Angeles",
  "admissionDate": "December 2017",
  "address": "2052 S Bundy Dr Pmb 1073, Los Angeles, CA 90025-6102",
  "phone": "310-903-7377",
  "fax": "Not Available",
  "emails": [
    "acjfj@phf.org",
    "lkggns@jcrktwcn.gov",
    "slpwisjy@qjrtg.gov",
    "rbynoccru@engpa.com",
    "mtyoh@donapa.org",
    "appuqj@dqcwh.edu",
    "igtctna@rfaystb.com",
    "wodccafq@ftnyljt.gov",
    "nwmj@ugbnwrqd.org",
    "qaksa@yhwmcto.gov",
    "tmfqye@jinkkl.com",
    "kiqlyjqy@uic.net",
    "cdwaaksre@eetn.net",
    "Abayahou@usc.edu",
    "irohcr@day.gov",
    "wdhuttefl@uoneop.org",
    "nmepqonq@jsyko.com",
    "walt@fwbt.edu",
    "iulio@hhoqb.net",
    "eoedim@jpkl.com"
  ],
  "website": "Not Available",
  "claSections": "None",
  "practiceAreas": "None reported",
  "languages": {
    "attorney": "None",
    "staff": "None"
  },
  "lawSchool": "Southwestern Univ SOL; Los Angeles CA",
  "licenseHistory": [
    {
      "date": "Present",
      "licenseStatus": "Active",
      "discipline": "",
      "adminAction": ""
    },
    {
      "date": "12/20/2017",
      "licenseStatus": "Admitted to the State Bar of California",
      "discipline": "",
      "adminAction": ""
    }
  ]
}
```

***

### ⚙️ How It Works

1. **Search Page Fetch**\
   For each keyword, the actor constructs a search URL and sends a direct HTTP request (not using browser rendering) to get the full HTML.

2. **List Parsing**\
   All attorney rows are parsed from the HTML (not limited by visible DOM), up to the `maxResult` limit.

3. **Profile Visit**\
   The actor visits each attorney’s detail page to scrape deeper info such as email, law school, CLA, languages, and history.

4. **Deduplication & Limits**\
   Scraping respects the per-keyword max and avoids re-processing duplicates.

***

### 🛡️ Respectful Use Notice

All data comes from [calbar.ca.gov](https://www.calbar.ca.gov/) and is publicly available. Use this tool only for legal, ethical purposes. Avoid overloading the website.

***

### 🚀 How to Run on Apify

1. Go to [Apify Console](https://console.apify.com).
2. Add or deploy this actor.
3. Provide your input (keywords, result limits, etc.).
4. Run the actor and view results in the **Dataset** tab.

***

### 📦 Downloading Results

You can export data in:

- JSON
- CSV
- Excel
- JSONL

from the Dataset view in Apify.

***

### 🧠 Tips

- Split your keywords if scraping many names (to avoid timeouts).
- Enable `"similarSearch": "yes"` to capture spelling variations.
- Use email arrays to reach multiple listed addresses.

***

### 🧰 Tech Stack

- Apify SDK
- Node.js (ESM)
- Cheerio
- Axios or native fetch

***

### 📬 Support & Feedback

Maintained by **\[BlueOrion]**\
Questions or suggestions? Contact us in Issues tab.

# Actor input Schema

## `searchKeys` (type: `array`):

Enter Name or keywords to search for attorneys

## `maxResult` (type: `integer`):

The maximum number of attorneys to extract per place search keyword (between 10 and 500).

## `similarSearch` (type: `string`):

If set to 'yes', the search will include attorneys whose names sound similar to the keywords. This helps capture alternative spellings or phonetically similar matches.

## Actor input object example

```json
{
  "searchKeys": [
    "Abc",
    "Andy"
  ],
  "maxResult": 10,
  "similarSearch": "yes"
}
```

# 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 = {
    "searchKeys": [
        "Abc",
        "Andy"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("blueorion/california-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 = { "searchKeys": [
        "Abc",
        "Andy",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("blueorion/california-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 '{
  "searchKeys": [
    "Abc",
    "Andy"
  ]
}' |
apify call blueorion/california-state-bar-attorney-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "California State Bar Attorney Scraper",
        "description": "Scrape attorney profiles from The State Bar of California, including name, license status, contact info, emails, law school, languages spoken, and disciplinary history. Use search keywords, and extracts up to 500 attorneys per query. Ideal for legal research, background checks, compliance workflows.",
        "version": "0.0",
        "x-build-id": "vOZcUqX8ygY99SphO"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/blueorion~california-state-bar-attorney-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-blueorion-california-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/blueorion~california-state-bar-attorney-scraper/runs": {
            "post": {
                "operationId": "runs-sync-blueorion-california-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/blueorion~california-state-bar-attorney-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-blueorion-california-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",
                "properties": {
                    "searchKeys": {
                        "title": "Search Keyword to look for attorneys",
                        "type": "array",
                        "description": "Enter Name or keywords to search for attorneys",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxResult": {
                        "title": "Maximum Number of Attorney to scrape",
                        "minimum": 10,
                        "maximum": 500,
                        "type": "integer",
                        "description": "The maximum number of attorneys to extract per place search keyword (between 10 and 500).",
                        "default": 10
                    },
                    "similarSearch": {
                        "title": "Include similar sounding names",
                        "enum": [
                            "yes",
                            "no"
                        ],
                        "type": "string",
                        "description": "If set to 'yes', the search will include attorneys whose names sound similar to the keywords. This helps capture alternative spellings or phonetically similar matches.",
                        "default": "yes"
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
