# Canada Parliament API
> The Parliament of Canada as an API, powered by openparliament.ca. Browse the Members of Parliament of the House of Commons with their party, riding (electoral district) and province; read an MP's profile including contact details, current party and riding, and full membership history; browse bills by parliamentary session (number, title, date introduced); read a bill's details (sponsor, LEGISinfo id, whether it is a private member's bill, and whether it became law); browse recorded votes (divisions) with their result and yea/nay totals; and list the Hansard debate days. The open database that tracks Canadian federal politics. Ideal for civic-tech and transparency apps, political journalism and dashboards, voting-record and legislation trackers, and research on Canadian democracy. Sessions look like 45-1. Data from openparliament.ca.

## 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/canparl-api/..."
```

## Pricing
- **Free** (Free) — 850 calls/Mo, 2 req/s
- **Starter** ($6/Mo) — 27,000 calls/Mo, 8 req/s
- **Pro** ($18/Mo) — 115,000 calls/Mo, 20 req/s
- **Mega** ($50/Mo) — 430,000 calls/Mo, 50 req/s

## Endpoints

### Politicians

#### `GET /v1/politician` — An MP's profile

**Parameters:**
- `id` (query, required, string) — MP slug, e.g. justin-trudeau Example: `justin-trudeau`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/canparl-api/v1/politician?id=justin-trudeau"
```

**Response:**
```json
{
    "data": {
        "politician": {
            "name": "Justin Trudeau",
            "slug": "justin-trudeau",
            "email": "justin.trudeau@parl.gc.ca",
            "links": [
                {
                    "url": "https://www.ourcommons.ca/members/en/justin-trudeau(58733)",
                    "note": "Page on ourcommons.ca"
                }
            ],
            "party": "Liberal",
            "riding": "Papineau",
            "twitter": null,
            "province": "QC",
            "given_name": "Justin",
            "family_name": "Trudeau",
            "memberships": [
                {
                    "end": "2025-04-28",
                    "label": "Liberal MP for Papineau",
                    "party": "Liberal",
                    "start": "2008-11-18",
                    "riding": "Papineau"
                }
            ]
        }
    },
    "meta": {
        "timestamp": "2026-06-01T08:13:40.747Z",
        "request_id": "991eef79-1b5c-49ca-99f7-67fbee5df2ff"
    },
    "status": "ok",
    "message": "Politician retrieved",
    "success": true
}
```

#### `GET /v1/politicians` — List Members of Parliament

**Parameters:**
- `limit` (query, optional, string) — Max results (1-100)
- `offset` (query, optional, string) — Pagination offset
- `former` (query, optional, string) — true = include former MPs

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

**Response:**
```json
{
    "data": {
        "count": 30,
        "total": null,
        "offset": 0,
        "has_more": true,
        "politicians": [
            {
                "name": "Ziad Aboultaif",
                "slug": "ziad-aboultaif",
                "party": "Conservative",
                "riding": "Edmonton Manning",
                "province": "AB"
            },
            {
                "name": "Burton Bailey",
                "slug": "burton-bailey",
                "party": "Conservative",
                "riding": "Red Deer",
                "province": "AB"
            },
            {
                "name": "John Barlow",
                "slug": "john-barlow",
                "party": "Conservative",
                "riding": "Foothills",
                "province": "AB"
            },
            {
                "name": "David Bexte",
                "slug": "david-bexte",
                "party": "Conservative",
                "riding": "Bow River",
                "province": "AB"
            },
            {
                "name": "Blaine Calkins",
                "slug": "blaine-calkins",
                "party": "Conservative",
                "riding": "Ponoka—Didsbury",
                "province": "AB"
            },
            {
                "name": "Michael Cooper",
                "slug": "michael-cooper",
                "party": "Conservative",
                "riding": "St. Albert—Sturgeon River",
                "province": "AB"
         
…(truncated, see openapi.json for full schema)
```

### Bills

#### `GET /v1/bill` — A bill's details

**Parameters:**
- `session` (query, required, string) — Session, e.g. 40-2 Example: `40-2`
- `number` (query, required, string) — Bill number, e.g. C-1 Example: `C-1`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/canparl-api/v1/bill?session=40-2&number=C-1"
```

**Response:**
```json
{
    "data": {
        "bill": {
            "law": null,
            "url": "/bills/40-2/C-1/",
            "name": "An Act respecting the Administration of Oaths of Office",
            "number": "C-1",
            "session": "40-2",
            "sponsor": "stephen-harper",
            "text_url": "https://www.parl.ca/DocumentViewer/en/3630273",
            "introduced": "2009-01-26",
            "vote_count": 0,
            "short_title": null,
            "home_chamber": "House",
            "legisinfo_id": 3628604,
            "private_member_bill": false
        }
    },
    "meta": {
        "timestamp": "2026-06-01T08:13:41.410Z",
        "request_id": "5f141c46-8ab2-4319-9411-e98c68a119c8"
    },
    "status": "ok",
    "message": "Bill retrieved",
    "success": true
}
```

#### `GET /v1/bills` — Browse bills

**Parameters:**
- `session` (query, optional, string) — Session, e.g. 45-1
- `limit` (query, optional, string) — Max (1-100)

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

**Response:**
```json
{
    "data": {
        "bills": [
            {
                "url": "/bills/40-2/C-1/",
                "name": "An Act respecting the Administration of Oaths of Office",
                "number": "C-1",
                "session": "40-2",
                "introduced": "2009-01-26"
            },
            {
                "url": "/bills/41-1/C-1/",
                "name": "An Act respecting the administration of oaths of office",
                "number": "C-1",
                "session": "41-1",
                "introduced": "2011-06-03"
            },
            {
                "url": "/bills/39-1/C-1/",
                "name": "An Act respecting the Administration of Oaths of Office",
                "number": "C-1",
                "session": "39-1",
                "introduced": "2006-04-04"
            },
            {
                "url": "/bills/43-1/C-1/",
                "name": "An Act respecting the administration of oaths of office",
                "number": "C-1",
                "session": "43-1",
                "introduced": "2019-12-05"
            },
            {
                "url": "/bills/40-3/C-1/",
                "name": "An Act respecting the Administration of Oaths of Office",
                "number": "C-1",
                "session": "40-3",
                "introduced": "2010-03-03"
            },
            {
                "url": "/bills/41-2/C-1/",
                "name": "An Act respecting the Administration of Oaths of Offi
…(truncated, see openapi.json for full schema)
```

### Votes

#### `GET /v1/votes` — Recorded votes

**Parameters:**
- `session` (query, optional, string) — Session filter
- `limit` (query, optional, string) — Max (1-100)

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

**Response:**
```json
{
    "data": {
        "count": 20,
        "total": null,
        "votes": [
            {
                "nay": 0,
                "yea": 332,
                "bill": "S-233",
                "date": "2026-05-27",
                "number": 127,
                "paired": 8,
                "result": "Passed",
                "session": "45-1",
                "description": "2nd reading of Bill S-233, An Act to amend the Criminal Code (assault against persons who provide health services and first responders)"
            },
            {
                "nay": 195,
                "yea": 138,
                "bill": null,
                "date": "2026-05-27",
                "number": 126,
                "paired": 8,
                "result": "Failed",
                "session": "45-1",
                "description": "Opposition Motion (Cancellation of federal taxes on gas and diesel and the Clean Fuel Standard)"
            },
            {
                "nay": 164,
                "yea": 170,
                "bill": "C-30",
                "date": "2026-05-26",
                "number": 125,
                "paired": 6,
                "result": "Passed",
                "session": "45-1",
                "description": "2nd reading of Bill C-30, An Act to implement certain provisions of the spring economic update tabled in Parliament on April 28, 2026"
            },
            {
                "nay": 197,
                "yea": 137,
                "bill": "C-30",
…(truncated, see openapi.json for full schema)
```

### Debates

#### `GET /v1/debates` — Hansard debate days

**Parameters:**
- `limit` (query, optional, string) — Max (1-100)

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

**Response:**
```json
{
    "data": {
        "count": 20,
        "total": null,
        "offset": 0,
        "debates": [
            {
                "url": "/debates/2026/5/27/",
                "date": "2026-05-27",
                "number": "123",
                "most_frequent_word": "workers"
            },
            {
                "url": "/debates/2026/5/26/",
                "date": "2026-05-26",
                "number": "122",
                "most_frequent_word": "prices"
            },
            {
                "url": "/debates/2026/5/25/",
                "date": "2026-05-25",
                "number": "121",
                "most_frequent_word": "affordability"
            },
            {
                "url": "/debates/2026/5/8/",
                "date": "2026-05-08",
                "number": "120",
                "most_frequent_word": "victims"
            },
            {
                "url": "/debates/2026/5/7/",
                "date": "2026-05-07",
                "number": "119",
                "most_frequent_word": "decision"
            },
            {
                "url": "/debates/2026/5/6/",
                "date": "2026-05-06",
                "number": "118",
                "most_frequent_word": "alert"
            },
            {
                "url": "/debates/2026/5/5/",
                "date": "2026-05-05",
                "number": "117",
                "most_frequent_word": "tariffs"
            },
            {
                "url": "/d
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Usage notes

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

**Response:**
```json
{
    "data": {
        "note": "The Parliament of Canada. /v1/politicians (paginate limit & offset; former=true for past MPs) = list Members of Parliament with party, riding and province; /v1/politician?id=justin-trudeau = an MP's profile (contact, party, riding, membership history, links); /v1/bills?session=45-1 = browse bills (number like C-5, name, date introduced); /v1/bill?session=40-2&number=C-1 = a bill's details (sponsor, LEGISinfo id, private-member flag, whether it became law); /v1/votes?session=45-1 = recorded votes with result and yea/nay totals; /v1/debates = the Hansard debate days. Sessions look like 45-1. Data from openparliament.ca (the House of Commons of Canada). For the US Congress see the Congress API, the UK the UK Parliament API, Germany the Bundestag API.",
        "source": "openparliament.ca API (Parliament of Canada, House of Commons)",
        "endpoints": [
            "/v1/politicians",
            "/v1/politician",
            "/v1/bills",
            "/v1/bill",
            "/v1/votes",
            "/v1/debates",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T08:13:42.811Z",
        "request_id": "3e239911-c07e-45e2-92f4-dea79225dff0"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


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