Election Races
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.
Request
- Base URL: https://api.dataporium.io
- URL: https://api.dataporium.io/elections/races
- Auth: API key in query parameter apikey
Query parameters
Election year
First election year
Last election year
president, us_senate, us_house, governor, lt_governor, attorney_general, secretary_of_state, treasurer, other_statewide, state_senate, state_house, ballot_measure or judicial (comma-separated)
Two-letter state code(s), comma-separated (US for the national race)
District number such as 07 (00 = at large)
true = special elections only, false = without them
live, state_certified or certified_final
Party of the winner or leader: D, R or other
true = the winning party changed since the previous comparable race
Largest margin in points (close races)
Smallest margin in points (landslides)
Text in the race title or a candidate name
One race by race_id
Sort field (see the endpoint description)
asc or desc
Rows per page (default 50 to 100, at most 1000)
Rows to skip, for paging
Response
Successful response (JSON).
Changes
No recorded changes to this operation across all 1 revision of this API.