> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrouter.net/llms.txt
> Use this file to discover all available pages before exploring further.

# civicAPI

> Live and historic election results and race calls for elections around the world, from local races to national ones.

![](https://mintcdn.com/webrouter/Wx0iBZkUGX_VAFTN/logo/data-apis/_default.svg?fit=max\&auto=format\&n=Wx0iBZkUGX_VAFTN\&q=85\&s=951f11a0968af0d8747e234a1ec1f32c)

[Web Catalog · Government](https://docs.webrouter.net/data-apis.md?category=government)

No key needed

Endpoints

6

Auth

None

[Vendor docs](https://civicapi.org/api-documentation)

## Notes

* Keyless and free, including commercial use; non-personal projects must credit civicAPI (link to civicapi.org or name it).
* All times are UTC; election\_date in search results is set to 05:00 UTC whatever the local zone.

## Endpoints

GET

Search races

Elections (races) by country, province, district, type, date range or name, with top-three candidates, votes, percent reporting and winners.

[Open](#civicapi-races-search)

GET

Get a race

Full results of one race: candidates, votes, percent, winners, registered voters, poll times and per-region results.

[Open](#civicapi-races-get)

GET

List snapshots of a race

Timestamps of the stored snapshots of a race's results, for timelines.

[Open](#civicapi-races-history-list)

GET

Get a race as at a snapshot

A race's full results as they stood at one snapshot timestamp.

[Open](#civicapi-races-history-get)

GET

List election dates

Dates with elections in a year, by month, with race counts, optionally for one country or province.

[Open](#civicapi-dates-list)

GET

List election years

Every year with elections in the database.

[Open](#civicapi-years-list)

### Search races

GET

`/api/v2/race/search`

`civicapi.races.search`

Elections (races) by country, province, district, type, date range or name, with top-three candidates, votes, percent reporting and winners.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`startDate`</td><td>string</td><td>query</td><td>Races on or after this date, YYYY-MM-DD. Example `2026-11-03`</td></tr>
    <tr><td>`endDate`</td><td>string</td><td>query</td><td>Races on or before this date, YYYY-MM-DD. Example `2026-11-03`</td></tr>

    <tr>
      <td>
        `query`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Race name; slow, so prefer the other filters.
      </td>
    </tr>

    <tr><td>`country`</td><td>string</td><td>query</td><td>ISO 3166-1 alpha-2 code (US); alpha-3 for countries of limited recognition or abolished before the UN. Example `US`</td></tr>

    <tr>
      <td>
        `province`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        ISO 3166-2 province code, e.g. AL or JP-07.
      </td>
    </tr>

    <tr>
      <td>
        `district`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        District (county, canton) by full English name.
      </td>
    </tr>

    <tr>
      <td>
        `election_type`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Election type.
      </td>
    </tr>

    <tr>
      <td>
        `limit`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Races to return; 20 by default, at most 50000.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://civicapi.org/api-documentation)

```python Python theme={null}
router.call_data_api("civicapi.races.search", {'startDate': '2026-11-03', 'endDate': '2026-11-03', 'country': 'US'})
```

```text MCP theme={null}
call_data_api(endpoint="civicapi.races.search", params={"startDate": "2026-11-03", "endDate": "2026-11-03", "country": "US"})
```

### Get a race

GET

`/api/v2/race/{raceid}`

`civicapi.races.get`

Full results of one race: candidates, votes, percent, winners, registered voters, poll times and per-region results.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `raceid`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        Race id from races.search.
      </td>
    </tr>

    <tr><td>`data`</td><td>string</td><td>query</td><td>json (default), or csv for an OpenElections-compatible CSV. One of `json`, `csv`</td></tr>
  </tbody>
</table>

[Vendor docs](https://civicapi.org/api-documentation)

> [!NOTE]
>
> * Precinct results are left out unless they are the only data; the docs' precinct flag adds them.

### List snapshots of a race

GET

`/api/v2/race/{raceid}/history`

`civicapi.races.history.list`

Timestamps of the stored snapshots of a race's results, for timelines.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `raceid`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        Race id from races.search.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://civicapi.org/api-documentation)

> [!NOTE]
>
> * Only races tracked after 2025-10-09 have history.

### Get a race as at a snapshot

GET

`/api/v2/race/{raceid}/history/{timestamp}`

`civicapi.races.history.get`

A race's full results as they stood at one snapshot timestamp.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `raceid`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        Race id from races.search.
      </td>
    </tr>

    <tr>
      <td>
        `timestamp`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        Snapshot timestamp from races.history.list, YYYY-MM-DDTHH:MM:SS.sssZ (UTC).
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://civicapi.org/api-documentation)

### List election dates

GET

`/api/v2/getElectionDates`

`civicapi.dates.list`

Dates with elections in a year, by month, with race counts, optionally for one country or province.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `year`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Year, YYYY; the current year by default.
      </td>
    </tr>

    <tr>
      <td>
        `country`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        ISO 3166-1 alpha-2 code.
      </td>
    </tr>

    <tr>
      <td>
        `province`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Province code, e.g. AL or JP-06.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://civicapi.org/api-documentation)

```python Python theme={null}
router.call_data_api("civicapi.dates.list")
```

```text MCP theme={null}
call_data_api(endpoint="civicapi.dates.list")
```

### List election years

GET

`/api/v2/getElectionYears`

`civicapi.years.list`

Every year with elections in the database.

Input

No inputs.

[Vendor docs](https://civicapi.org/api-documentation)

```python Python theme={null}
router.call_data_api("civicapi.years.list")
```

```text MCP theme={null}
call_data_api(endpoint="civicapi.years.list")
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.