# State Legislators Scraper: Contacts & Committees (Open States) (`talcoe/openstates-legislators`) Actor

Scrape US state legislators from Open States data: email, phone, office address, party, district and committee roles, filtered by state, chamber, party or keyword, priced per result.

- **URL**: https://apify.com/talcoe/openstates-legislators.md
- **Developed by:** [M Usama](https://apify.com/talcoe) (community)
- **Categories:** Lead generation, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## State Legislators Scraper: Contacts & Committees (Open States)

### Data source

Reads the public Open States `openstates/people` dataset on GitHub (official, CC0 licensed), which is updated by the Open States team as members and committees change.

### What does State Legislators Scraper do?

It returns one clean record per US state legislator: name, state, chamber, district, party, official email, phone, capitol office address, committee seats with roles (chair, vice chair, member), photo, term start date and official websites. Filter by state, chamber, party or a keyword (name, district, city or committee), and pay per result returned.

### Why use it?

- Build advocacy, lobbying and government relations contact lists for any set of states.
- Map who sits on which committee, and who chairs it, before a bill hearing.
- Keep a CRM or voter outreach tool in sync with current office holders by scheduling the Actor.
- Replace a manual copy from 50 legislature websites or a paid contact database.

### How to use it

1. Open the Actor and set the filters.
2. Click Start. Download results as JSON, CSV or Excel, or read them through the API.
3. Add a Schedule and an Integration (Slack, Google Sheets, webhook) to get refreshed records automatically.

### Input

| Field | Description |
|---|---|
| `states` | Two letter state codes, for example `wa`, `ca`, `ny`. Default `wa`. |
| `chamber` | `any`, `upper` (Senate) or `lower` (House or Assembly). |
| `party` | Keep legislators whose party contains this text, for example `democratic`. |
| `searchText` | Keep legislators whose name, district, office address or committee names contain this text. |
| `includeRetired` | Also return former legislators (no committee data). Default off. |
| `maxResults` | Hard stop for the run. You are billed per result, so this caps the cost. |
| `proxyConfiguration` | Optional. Helps if GitHub rate limits your IP. |

Example input:

```json
{ "states": ["wa", "ny"], "chamber": "upper", "party": "democratic", "maxResults": 100 }
```

### Output

Every record has the same shape (trimmed):

```json
{
  "id": "ocd-person/9eddb3cd-868e-42ba-831a-b415fd7ed445",
  "name": "Adam Bernbaum",
  "state": "WA",
  "chamber": "lower",
  "chamberLabel": "House",
  "district": "24",
  "party": "Democratic",
  "email": "adam.bernbaum@leg.wa.gov",
  "phone": "360-786-7916",
  "capitolAddress": "Room 418, John L. O'Brien Building P.O. Box 40600, Olympia, WA 98504",
  "committees": [
    { "name": "Transportation", "role": "vice chair", "chamber": "lower" }
  ],
  "isCurrent": true,
  "photoUrl": "https://leg.wa.gov/memberphoto/34240.jpg",
  "termStart": "2024-12-06",
  "websites": ["https://leg.wa.gov/legislators/member/adam-bernbaum"],
  "scrapedAt": "2026-10-09T08:37:39.377Z"
}
```

| Field | Meaning |
|---|---|
| `id` | Open States person ID, stable and safe for deduplication between runs |
| `chamber` / `chamberLabel` | `upper` or `lower`, and Senate or House |
| `committees` | Committee name, role and chamber for each seat |
| `districtOfficePhone`, `districtOfficeAddress` | District office details when published |
| `termStart`, `termEnd` | ISO dates from the current role |

### Pricing

Pay per event: a small fee when a run starts, then a fixed price per result returned. You only pay for records that pass your filters. Set `maxResults` to cap any run.

### Limitations

- Covers legislators and committees only. Bills and votes are not included: the Open States bill API and website require an account or a bot check, so they are not read.
- Committee data is only as complete as the Open States people dataset for that state, and some states list few or no committees.
- Each state costs one GitHub API request, limited to 60 per hour per IP. Use the proxy option for very large multi state runs.
- Data comes from the dataset as published, so it can lag a special election or resignation by days.

### FAQ

**Is this legal?** The Actor reads a public dataset released under CC0 and stores only the official contact details legislators publish for their public offices. You are responsible for how you use the data.

**Something is missing or broken?** Open an issue in the Issues tab; response time is usually under a day.

# Actor input Schema

## `states` (type: `array`):

Two letter state codes, for example wa, ca, ny. Also accepts dc and pr. Each state costs one GitHub API request, which is limited to 60 per hour per IP.

## `chamber` (type: `string`):

Limit to the upper chamber (Senate), the lower chamber (House or Assembly), or both.

## `party` (type: `string`):

Keep only legislators whose party contains this text, for example democratic or republican. Leave empty for all.

## `searchText` (type: `string`):

Keep only legislators whose name, district, office address or committee names contain this text, for example finance or Seattle.

## `includeRetired` (type: `boolean`):

Also return legislators who have left office. Committee membership is only available for current members.

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

Hard stop for the run. You are billed per result, so this caps the cost.

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

Apify proxy is optional. It can help if GitHub rate limits your IP.

## Actor input object example

```json
{
  "states": [
    "wa"
  ],
  "chamber": "any",
  "party": "",
  "searchText": "",
  "includeRetired": false,
  "maxResults": 200,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (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 = {
    "states": [
        "wa"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("talcoe/openstates-legislators").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 = {
    "states": ["wa"],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("talcoe/openstates-legislators").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "states": [
    "wa"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call talcoe/openstates-legislators --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,talcoe/openstates-legislators"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

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