Skip to main content
GET
Get every race of an election cycle with its candidates' prices
This endpoint is available on staging (https://api.tradearies.dev). Production availability will be announced in the changelog.

Overview

One request returns the whole cycle: every state, every race in it, and every candidate’s price. Use it to drive a map, a rated race list and a chamber-control card from a single response.
2026 is the only cycle served. Any other answers 404.

Response shape

data.national holds the chamber-control markets. data.states holds all 50 states, sorted by name, each with its senate, governor and house races. A state with no race for an office has an empty array, never null. DC is not included. Prices in this example are illustrative, and the response is trimmed to one Senate and one House race.

Races

Each race is one event on the venue. Its office and state come from the event’s categories, and its type and district from the venue’s ticker.
  • House races carry district. A state with a single seat has district: 1 and atLarge: true.
  • partyMarket is the venue’s market on which party wins the race, when it lists one. It is attached to general elections only.
  • outcomes has one entry per candidate, highest yesPrice first, untraded candidates last. Contracts the venue withdrew are left out. A candidate who lost a primary can still be listed while the venue keeps their contract open.

Prices

  • yesPrice is the candidate’s last YES trade, as a decimal string. Once the race has settled it is the settlement value instead: 1 for the winner, 0 for everyone else.
  • yesPriceChange24h is yesPrice less the YES price 24 hours earlier. A candidate who has not traded in the last day shows 0.
  • Both are null for a candidate who has never traded. yesPriceChange24h is also null when every trade is in the last 24 hours.
  • Prices come from the venue’s pair-trade files, so they can trail the live market by several minutes. For live prices on one race, use Stream Live Prices.

Status and results

The venue settles a race after the result is certified, which can be days or weeks after election day. Until then a race stays open or closed, however clear its result. Pass includeResolved=false to leave settled races out.

Party, incumbent and photo

  • party is D, R, I or O. It is set only where the venue’s own listing names it: party markets, primaries, and a party’s placeholder contract. Elsewhere it is null for now.
  • heldBy and incumbent are null for now.
  • photo is a freely licensed portrait (public domain, CC0, CC BY or CC BY-SA) when one is available, else null. Show credit and license with the image, or on a credits page the image links to: the license requires it.

Polling

The map is the same for every caller and is rebuilt at most every few seconds, so poll it rather than stream it.
  • Send the previous response’s ETag as If-None-Match. While nothing in the map has changed, the answer is 304 with no body.
  • Send Accept-Encoding: gzip. The whole map is about 360 KB as JSON and about 35 KB gzipped.
  • asOf is when the map was built. It is not part of the ETag, so after a 304 keep the asOf you already have.
  • Each filter combination has its own ETag.
  • A 10 to 15 second interval keeps a map current.

Examples

Errors

  • 400 — cycle is not a number, or state, office, raceType or includeResolved is not one of its allowed values
  • 404 — no map for that cycle
  • 500 — unexpected server error

Headers

If-None-Match
string

The ETag of a previous response. Answers 304 while the map is unchanged.

Path Parameters

cycle
integer
required

Election year. 2026 is the only cycle served.

Example:

2026

Query Parameters

state
string

Two-letter code of one of the 50 states. Returns that state only.

Example:

"TX"

office
string

Comma-separated: senate, governor, house. Default: all.

Example:

"senate,house"

raceType
string

Comma-separated: general, special, primary_d, primary_r, primary_open, runoff. Default: all.

Example:

"general,special"

includeResolved
boolean
default:true

false leaves out races the venue has settled.

Response

The election map. Gzipped when the request sends Accept-Encoding: gzip.

Standard success envelope used by all success responses. data is endpoint-specific.

success
boolean
required
Example:

true

data
object

Every race of one election cycle in all 50 states, with each candidate's price, plus the chamber-control markets.