# US Congress API
> Every member of the United States Congress as an API — all 12,766 legislators, current and historical, from 1789 to today. Look up any member by Bioguide or GovTrack id, or search and filter the full roster by name, US state, party and chamber (Senate / House), and list the current members of Congress. Each record carries the member's name, gender, birthday, party, state and district, chamber, the number of terms served and the complete term-by-term history with start and end dates, plus cross-reference ids (GovTrack, OpenSecrets, FEC, Wikipedia, Wikidata). Ideal for civic-tech, news, government-transparency, lobbying and political-research apps. Data from the public-domain @unitedstates project.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/congress-api/..."
```

## Pricing
- **Free** (Free) — 3,800 calls/Mo, 2 req/s
- **Starter** ($6/Mo) — 53,000 calls/Mo, 8 req/s
- **Pro** ($16/Mo) — 270,000 calls/Mo, 20 req/s
- **Mega** ($39/Mo) — 1,280,000 calls/Mo, 50 req/s

## Endpoints

### Congress

#### `GET /v1/current` — Current members of Congress

**Parameters:**
- `chamber` (query, optional, string) — senate | house Example: `senate`
- `state` (query, optional, string) — US state, 2-letter
- `party` (query, optional, string) — Party filter
- `limit` (query, optional, string) — Results per page (1-600, default 50) Example: `50`
- `offset` (query, optional, string) — Pagination offset Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/congress-api/v1/current?chamber=senate&limit=50&offset=0"
```

**Response:**
```json
{
    "data": {
        "count": 50,
        "limit": 50,
        "total": 100,
        "offset": 0,
        "filters": {
            "party": null,
            "state": null,
            "chamber": "senate"
        },
        "results": [
            {
                "name": "Maria Cantwell",
                "party": "Democrat",
                "state": "WA",
                "chamber": "senate",
                "current": true,
                "bioguide": "C000127",
                "district": null,
                "govtrack": 300018,
                "served_to": "2031-01-03",
                "term_count": 6,
                "served_from": "1993-01-05"
            },
            {
                "name": "Amy Klobuchar",
                "party": "Democrat",
                "state": "MN",
                "chamber": "senate",
                "current": true,
                "bioguide": "K000367",
                "district": null,
                "govtrack": 412242,
                "served_to": "2031-01-03",
                "term_count": 4,
                "served_from": "2007-01-04"
            },
            {
                "name": "Bernard Sanders",
                "party": "Independent",
                "state": "VT",
                "chamber": "senate",
                "current": true,
                "bioguide": "S000033",
                "district": null,
                "govtrack": 400357,
                "served_to": "2031-01-03",
                "term_count": 12,
 
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/legislator` — One legislator by id

**Parameters:**
- `id` (query, required, string) — Bioguide id, e.g. C000127 (Maria Cantwell) Example: `C000127`
- `govtrack` (query, optional, string) — GovTrack id (alternative to id)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/congress-api/v1/legislator?id=C000127"
```

**Response:**
```json
{
    "data": {
        "legislator": {
            "last": "Cantwell",
            "name": "Maria Cantwell",
            "first": "Maria",
            "party": "Democrat",
            "state": "WA",
            "terms": [
                {
                    "end": "1995-01-03",
                    "type": "rep",
                    "party": "Democrat",
                    "start": "1993-01-05",
                    "state": "WA",
                    "district": 1
                },
                {
                    "end": "2007-01-03",
                    "type": "sen",
                    "party": "Democrat",
                    "start": "2001-01-03",
                    "state": "WA"
                },
                {
                    "end": "2013-01-03",
                    "type": "sen",
                    "party": "Democrat",
                    "start": "2007-01-04",
                    "state": "WA"
                },
                {
                    "end": "2019-01-03",
                    "type": "sen",
                    "party": "Democrat",
                    "start": "2013-01-03",
                    "state": "WA"
                },
                {
                    "end": "2025-01-03",
                    "type": "sen",
                    "party": "Democrat",
                    "start": "2019-01-03",
                    "state": "WA"
                },
                {
                    "end": "2031-01-03",
                    "type": 
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/search` — Search current + historical legislators

**Parameters:**
- `name` (query, optional, string) — Name search (matched against full name) Example: `smith`
- `state` (query, optional, string) — US state, 2-letter, e.g. CA
- `party` (query, optional, string) — Party, e.g. Democrat, Republican
- `chamber` (query, optional, string) — senate | house
- `current` (query, optional, string) — true = only current members
- `limit` (query, optional, string) — Results per page (1-100, default 20) Example: `20`
- `offset` (query, optional, string) — Pagination offset Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/congress-api/v1/search?name=smith&limit=20&offset=0"
```

**Response:**
```json
{
    "data": {
        "count": 20,
        "limit": 20,
        "total": 144,
        "offset": 0,
        "filters": {
            "name": "smith",
            "party": null,
            "state": null,
            "chamber": null,
            "current": null
        },
        "results": [
            {
                "name": "Adam Smith",
                "party": "Democrat",
                "state": "WA",
                "chamber": "house",
                "current": true,
                "bioguide": "S000510",
                "district": 9,
                "govtrack": 400379,
                "served_to": "2027-01-03",
                "term_count": 15,
                "served_from": "1997-01-07"
            },
            {
                "name": "Adrian Smith",
                "party": "Republican",
                "state": "NE",
                "chamber": "house",
                "current": true,
                "bioguide": "S001172",
                "district": 3,
                "govtrack": 412217,
                "served_to": "2027-01-03",
                "term_count": 10,
                "served_from": "2007-01-04"
            },
            {
                "name": "Christopher H. Smith",
                "party": "Republican",
                "state": "NJ",
                "chamber": "house",
                "current": true,
                "bioguide": "S000522",
                "district": 4,
                "govtrack": 400380,
                "served_to": "202
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Totals & breakdown

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/congress-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "Every member of the US Congress, current and historical (1789-present). chamber: senate | house. Look up by bioguide id, search/filter by name/state/party/chamber, or list current members.",
        "total": 12766,
        "fields": [
            "bioguide",
            "govtrack",
            "wikidata",
            "name",
            "gender",
            "birthday",
            "current",
            "chamber",
            "state",
            "district",
            "party",
            "term_count",
            "terms"
        ],
        "source": "@unitedstates/congress-legislators",
        "states": 59,
        "current": 536,
        "current_house": 436,
        "current_senate": 100,
        "current_by_party": {
            "Democrat": 260,
            "Republican": 273,
            "Independent": 3
        }
    },
    "meta": {
        "timestamp": "2026-05-31T07:41:40.267Z",
        "request_id": "04d30351-ea52-42c0-b9c3-76eb05083bb3"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/congress-api
OpenAPI spec: https://www.oanor.com/api/congress-api/openapi.json
