---
title: "Election Races"
method: GET
path: "/elections/races"
tags: ["US Elections"]
---

# Election Races

`GET /elections/races`

## Request

- Base URL: `https://api.dataporium.io`
- URL: `https://api.dataporium.io/elections/races`
- Auth: API key in query parameter `apikey`

US elections as races: president, U.S. Senate, U.S. House, governor, other statewide offices, state legislature, ballot measures and judicial races, each with the winner or leader, the runner-up, votes and shares, total votes, margin, party margin, swing against the previous comparable race, whether the winning party changed, live reporting progress and the status of the numbers.

All filters are optional and can be combined. The answer is {total, limit, offset, sort, order, rows, about}; sort is year, state, office, district, total_votes, margin, rd_margin, swing or name.

## Query parameters

- `year` integer
- `year_from` integer
- `year_to` integer
- `office` string
- `state` string
- `district` string
- `special` boolean
- `status` string
- `winner_party` string
- `flipped` boolean
- `margin_max` number
- `margin_min` number
- `q` string
- `race` string
- `sort` string
- `order` string
- `limit` integer
- `offset` integer

## Response `200`

Successful response (JSON).

- object

## Other responses

- `401`: No API key in the request.
- `403`: The API key is not valid or has expired.

---

[API](https://skmtc.dev/dataporium/apis/dataporium-data-api.md) · [All operations](https://skmtc.dev/dataporium/apis/dataporium-data-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dataporium/apis/dataporium-data-api/revisions/8bc593179dc8?raw)
