# State Legislation API: Bills, Legislators, Votes (Open States) (`nabeelbaghoor/state-legislature-bills-legislators-api`) Actor

Search US state legislation in all 50 states, DC and Puerto Rico: bills and resolutions with sponsors, actions, votes and versions, current state legislators by district or map point, committees, hearings and sessions, via the Open States API from Plural Policy. Bring your own key.

- **URL**: https://apify.com/nabeelbaghoor/state-legislature-bills-legislators-api.md
- **Developed by:** [Nabeel Hassan](https://apify.com/nabeelbaghoor) (community)
- **Categories:** Developer tools, Business, News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 state bill 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/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 Legislation API: Bills, Legislators, Votes (Open States)

Search and export US state legislation, state legislators, committees, hearings and legislative sessions for all 50 states, DC and Puerto Rico, as one clean dataset row per record.

Open States, run by Plural Policy, collects the bills, resolutions, sponsors, actions, roll call votes, bill text versions, legislators, committees and hearings of every state legislature into one public domain database. This actor wraps the read only Open States API v3 on v3.openstates.org: pick states and filters, or paste bill numbers and IDs, and get deduplicated rows with the bill number, title, session, chamber, status, latest action, sponsors and links already flattened, ready to download as JSON, CSV or Excel, schedule as a daily state bill tracking feed, or feed into policy monitoring dashboards, government affairs tools, Google Sheets, RAG pipelines and AI agents.

Bring your own API key: Open States keys are free (see below).

### What it does

- **State bills search**: bills, resolutions and constitutional amendments in one or many states, filtered by session, chamber of origin, bill type, subject, sponsor (primary or cosponsor), bill numbers, updated since, introduced since and latest action since, with full text search across bill text and titles in one state or all states.
- **Bill details on demand**: sponsors, abstracts, the full action history, roll call votes, bill text versions, documents such as fiscal notes, related bills, other titles and identifiers.
- **Lookup by bill number or ID**: single bills as CA 20252026 AB 1, as an open.pluralpolicy.com bill page URL, or as an ocd-bill ID; legislators, committees, events and states by their Open States IDs.
- **State legislators**: current members of every state legislature (and governors) by state, chamber, district or name, with party, district, email, capitol phone, office address and photo.
- **Find my state legislator**: the state legislators who represent a latitude and longitude.
- **Committees**: standing committees and subcommittees per state and chamber, with their members and roles.
- **Hearings and events**: committee hearings and floor sessions with dates, location, participants and the bills on the agenda (Open States still marks this data as experimental and it is not yet complete for every state).
- **States and sessions**: every state with its legislative session identifiers and dates, which the session filter takes.
- **Pay only for results**: refused and empty lookups become a free row that says why.

Nothing is written to any Open States account: only GET endpoints are called.

### How to use it

1. Get a free Open States API key: sign up at open.pluralpolicy.com/accounts/signup/, confirm your email address, then copy the key from open.pluralpolicy.com/accounts/profile/.
2. Paste it into the **API key** field (or set a `DATA_API_KEY` environment variable on the actor). It is sent only to v3.openstates.org in the X-API-KEY header and never logged.
3. Choose **What to get**, pick one or more states under **Jurisdictions**, set the filters you need and press Start.
4. Download the dataset, or schedule the actor with **Updated since** or **Action since** for a recurring state legislation tracker.

Free keys allow 10 requests a minute and 250 a day, so the actor paces itself at 9 a minute by default. A bills search reads 20 bills per request, so 100 bills take 5 requests and about 35 seconds. When the daily allowance is used up the run ends cleanly and says so; it resets at midnight UTC. Higher tiers can be requested from Plural Policy; raise **Requests per minute** to match.

### Input

| Field | Used by | Example |
|---|---|---|
| What to get | all | Bills search |
| Jurisdictions (states) | bills, legislators, committees, events, states | California, Texas |
| Full text search | Bills search | "data privacy" |
| Session | Bills search | 20252026 |
| Chamber | bills, legislators, committees | Upper (Senate) |
| Bill type, Subjects | Bills search | Bill, Education |
| Sponsor, Sponsor type | Bills search | a sponsor name or ocd-person ID, Primary sponsor |
| Bill numbers | Bills search | AB 1, SB 23 |
| Updated since, Introduced since, Action since | Bills search | 2025-01-01 |
| Sort | Bills search | Newest latest action first |
| Bill details to include | Bills search, lookup | Sponsors, Actions, Roll call votes |
| Bills and IDs to look up | Lookup | CA 20252026 AB 1 |
| Legislator name, District | Legislators search | Smith, 12 |
| Locations (latitude, longitude) | Legislators by location | 38.5767,-121.4934 |
| Legislator, committee, event, state details to include | the matching modes | Offices, Members, Agenda |
| Committee type, Parent committee ID | Committees | Subcommittees |
| Events after, Events before, Only events with bills | Hearings and events | 2025-03-01 |
| Max results | all | 100 |
| Requests per minute | all | 9 |
| API key | all | your Open States key |

Example input for California bills on privacy with a floor or committee action this year, newest action first:

```json
{
    "mode": "bills",
    "jurisdictions": ["ca"],
    "searchQuery": "privacy",
    "actionSince": "2025-01-01",
    "sort": "latest_action_desc",
    "billIncludes": ["sponsorships", "abstracts"],
    "maxResults": 100
}
```

### Example output

The shape of one bill row (values illustrative):

```json
{
    "mode": "bills",
    "recordType": "bill",
    "query": "California \"privacy\"",
    "found": true,
    "id": "ocd-bill/00000000-0000-0000-0000-000000000000",
    "name": "Consumer privacy: personal information",
    "jurisdiction": "California",
    "jurisdictionId": "ocd-jurisdiction/country:us/state:ca/government",
    "identifier": "AB 1234",
    "session": "20252026",
    "chamber": "lower",
    "classification": "bill",
    "subjects": null,
    "firstActionDate": "2025-02-20",
    "latestActionDate": "2025-06-30",
    "latestActionDescription": "Read second time. Ordered to third reading.",
    "latestPassageDate": null,
    "primarySponsor": "Jane Doe",
    "sponsors": "Jane Doe; John Roe",
    "sponsorCount": 2,
    "abstract": "An act to amend the Civil Code, relating to privacy.",
    "fullHistory": false,
    "openstatesUrl": "https://openstates.org/ca/bills/20252026/AB1234/",
    "updatedAt": "2025-07-01T08:12:44.000Z",
    "note": null,
    "record": { "id": "ocd-bill/...", "...": "the full Open States bill" }
}
```

Legislator rows carry `party`, `role`, `chamber`, `district`, `email`, `phone`, `address` and `image`; committee rows `classification`, `parentId`, `members` and `memberCount`; event rows `startDate`, `endDate`, `status`, `location` and `agendaBills`; state rows `sessions` and `latestSession`. Every row keeps the full Open States record under `record`.

### Pricing

| Event | Price |
|---|---|
| State bill returned | 0.005 USD |
| State bill with full history returned (actions, votes, versions or documents included) | 0.008 USD |
| State legislator returned | 0.005 USD |
| Committee, hearing or state session record returned | 0.005 USD |

Refused and empty lookups are free rows. Platform usage is included. The Open States key itself is free.

### FAQ

#### What is Open States?

Open States is a project of Plural Policy (part of SAI360) that scrapes and normalises the official websites of all 50 state legislatures, the DC Council and the Puerto Rico legislature into one database of bills, votes, legislators, committees and events. Its API v3 at v3.openstates.org is free with a key, and the data is in the public domain.

#### Do I need an API key?

Yes. Open States answers nothing without a key, and the actor ends the run with instructions if none is set. The key is free: sign up at open.pluralpolicy.com/accounts/signup/, confirm your email, and copy the key from open.pluralpolicy.com/accounts/profile/.

#### How do I track new bills in a state every day?

Choose Bills search, pick the state, set Updated since (or Action since) to yesterday's date and Sort to newest first, and schedule the actor daily. Add a full text search, subject or sponsor to narrow it to the policy area you follow.

#### Can I search bills across all 50 states at once?

Yes. Leave Jurisdictions empty and type a full text search, such as "artificial intelligence": Open States searches every state. Or pick several states to run one filtered search per state.

#### How do I get a bill's full history, votes and text?

Add Actions, Roll call votes and Bill text versions under Bill details to include, in Bills search or in Lookup. Each bill then carries its counts and latest bill text link as columns, with every action, vote (with each legislator's vote) and version under record. These bills are priced as detailed bills.

#### How do I look up a specific bill?

Choose Lookup and give the bill as state, session and number, such as CA 20252026 AB 1, or paste its open.pluralpolicy.com page URL or its ocd-bill ID. The States and sessions mode lists each state's session identifiers.

#### Can I get state legislator contact details?

Yes. Legislators search returns current state senators and representatives with party, district, email, capitol phone and office address (include Offices). Legislators by location returns the legislators for a latitude and longitude, for "find my representative" tools.

#### Does it cover the US Congress?

This actor is built for the state legislatures. Open States covers federal data only in part (Legislators by location also returns members of Congress for a point); for Congress bills use a Congress.gov source.

#### How current is the data?

Open States scrapes each legislature's website on a regular schedule, most often while the legislature is in session. The States and sessions mode shows the latest bill and people update time for each state.

### Keyword map

State legislation API, state bills API, state bill tracking, legislative tracking for state legislatures, Open States API, OpenStates scraper, Plural Policy API, state legislature data, state legislators API, state senators and representatives, find my state legislator, legislator contact list, state committees, legislative hearings calendar, roll call votes, bill text, bill status, policy monitoring, government affairs, advocacy tools, LegiScan alternative.

### Data licence and terms

Open States data is in the public domain: Plural Policy claims no copyright over it and requires no attribution, so you may store, combine, publish and resell the rows this actor returns. Its terms of service (open.pluralpolicy.com/tos/) ask that no affiliation or endorsement be implied, and that usage limits on your key are not circumvented; the actor stays within your key's rate limits. This actor is not affiliated with or endorsed by Plural Policy, Open States or SAI360.

# Actor input Schema

## `mode` (type: `string`):

Bills search finds state bills and resolutions by state, session, chamber, type, subject, sponsor, dates or full text. Lookup fetches single bills by state, session and number (CA 20252026 AB 1) or bill page URL, and any record by its Open States ID. Legislators search lists current state legislators; Legislators by location finds the legislators who represent a latitude and longitude. Committees, Hearings and events, and States and sessions list those for the chosen states.

## `jurisdictions` (type: `array`):

Bills, legislators, committees, events and states and sessions. One lookup per state. Bills search needs a state unless a full text search is set; legislators need a state unless a name is set; committees and events need a state. Leave empty in States and sessions to list every state.

## `searchQuery` (type: `string`):

Bills search only. Words or a phrase searched in bill text and titles, such as "data privacy" or minimum wage; supports quotes, OR and -word. A bill number such as HB 1 matches that bill. Without a state it searches all states.

## `session` (type: `string`):

Bills search only, with a state. The Open States session identifier, such as 20252026 for California; the States and sessions mode lists them.

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

Bills: chamber the bill started in. Legislators: current chamber. Committees: chamber the committee belongs to.

## `billClassification` (type: `string`):

Bills search only. Keep only bills, resolutions, constitutional amendments or another Open States bill classification.

## `subjects` (type: `array`):

Bills search only. Keep bills tagged with all of these state subject terms, written as the state writes them, such as Education or Health.

## `sponsor` (type: `string`):

Bills search only. A sponsor name as Open States lists it, or an ocd-person ID from a Legislators search.

## `sponsorClassification` (type: `string`):

Bills search only, with a sponsor. Keep bills where that sponsor is a primary sponsor or a cosponsor.

## `billNumbers` (type: `array`):

Bills search only. Keep only these bill numbers, such as AB 1 or SB 23, up to 20.

## `updatedSince` (type: `string`):

Bills search only. Bills whose Open States record changed on or after this date, YYYY-MM-DD. Good for daily change feeds.

## `createdSince` (type: `string`):

Bills search only. Bills first added to Open States on or after this date, YYYY-MM-DD.

## `actionSince` (type: `string`):

Bills search only. Bills with a legislative action (hearing, vote, passage, signature) on or after this date, YYYY-MM-DD.

## `sort` (type: `string`):

Bills search only. Order of the bills.

## `billIncludes` (type: `array`):

Bills search and lookup. Extra bill details to return. Actions, votes, bill text versions or documents add the full history and price each bill as a detailed bill.

## `lookups` (type: `array`):

Lookup only. One per line: a bill as state, session and number (CA 20252026 AB 1 or ca/20252026/AB1), a bill page URL from open.pluralpolicy.com, or an Open States ID (ocd-bill/..., ocd-person/..., ocd-organization/..., ocd-event/..., ocd-jurisdiction/...). Up to 200.

## `legislatorName` (type: `string`):

Legislators search only. Part of a name, case insensitive. Without a state it searches all states.

## `district` (type: `string`):

Legislators search only, with a state. District name or number as the state writes it, such as 12.

## `locations` (type: `array`):

Legislators by location only. One point per line as latitude,longitude; returns the state legislators (and members of Congress) who represent it. Up to 200.

## `personIncludes` (type: `array`):

Legislators and lookup. Extra legislator details to return; offices carry phone numbers and addresses.

## `committeeClassification` (type: `string`):

Committees only.

## `parentCommitteeId` (type: `string`):

Committees only. An ocd-organization ID to list that committee's subcommittees.

## `committeeIncludes` (type: `array`):

Committees and lookup. Extra committee details to return.

## `eventsAfter` (type: `string`):

Hearings and events only. Events starting after this date, YYYY-MM-DD.

## `eventsBefore` (type: `string`):

Hearings and events only. Events starting before this date, YYYY-MM-DD.

## `requireBills` (type: `boolean`):

Hearings and events only.

## `eventIncludes` (type: `array`):

Hearings, events and lookup. Extra event details to return; the agenda lists the bills heard.

## `jurisdictionIncludes` (type: `array`):

States and sessions and lookup. Extra state details to return.

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

Stops after this many rows. Each page of up to 20 bills, committees or events (50 legislators) is one Open States request; free keys allow 250 requests a day.

## `requestsPerMinute` (type: `integer`):

Pacing ceiling. Free Open States keys allow 10 requests a minute (bronze 40, silver 80); raise this only for a higher tier.

## `apiKey` (type: `string`):

Your own free Open States API key: sign up at open.pluralpolicy.com/accounts/signup/, confirm the email, then copy the key from open.pluralpolicy.com/accounts/profile/. Sent only to v3.openstates.org in the X-API-KEY header and never logged. You can also set the DATA_API_KEY environment variable.

## Actor input object example

```json
{
  "mode": "bills",
  "jurisdictions": [
    "ca"
  ],
  "chamber": "any",
  "billClassification": "any",
  "sponsorClassification": "any",
  "sort": "updated_desc",
  "billIncludes": [
    "sponsorships",
    "abstracts"
  ],
  "personIncludes": [
    "links",
    "offices"
  ],
  "committeeClassification": "any",
  "committeeIncludes": [
    "memberships"
  ],
  "requireBills": false,
  "eventIncludes": [
    "participants",
    "agenda"
  ],
  "jurisdictionIncludes": [
    "legislative_sessions"
  ],
  "maxResults": 100,
  "requestsPerMinute": 9
}
```

# Actor output Schema

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

One row per record returned for the chosen mode.

# 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 = {
    "jurisdictions": [
        "ca"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("nabeelbaghoor/state-legislature-bills-legislators-api").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 = { "jurisdictions": ["ca"] }

# Run the Actor and wait for it to finish
run = client.actor("nabeelbaghoor/state-legislature-bills-legislators-api").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 '{
  "jurisdictions": [
    "ca"
  ]
}' |
apify call nabeelbaghoor/state-legislature-bills-legislators-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nabeelbaghoor/state-legislature-bills-legislators-api"
        }
    }
}
```

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/dc4BUNVDee3gyd10N/builds/WW5Bxjf1G15G2yDZY/openapi.json
