Data dictionaries

Seat change counts

Seat outcomes counted over a set of decided contests: re-elected and defeated incumbents, open seats, flips, and each party’s gains and losses.

Returned by
GET /v1/seat-changes
Shapes
The full record is in GET /v1/seat-changes. The shorter forms in totals and groups[] and parties[] leave some fields out; a field that isn’t in every form says where it is.

How it connects

  • The counts are over the same contests GET /v1/results returns with the same filters; add flipped=true there to list the flipped seats.

Good to know

  • Only decided contests linked to a seat count. A contest not linked yet, or a primary, is left out.
  • Counts are contests, not seats: a vote-for-N contest counts once for each party in it.
  • gained and lost count only flipped contests; net is gained minus lost.

Fields

FieldTypeMeaningExample
group_bystringor nullHow groups are split; null when group_by wasn’t given.state, office_type, election, stage meaningsOnly in GET /v1/seat-changes.office_type
totalsSeat change countsSeat outcomes counted over a set of contests. A vote-for-N contest counts once for each party in it, not once per seat.Only in GET /v1/seat-changes.—
groupsarray of objector nullThe same counts for each group, most contests first; null without group_by.Only in GET /v1/seat-changes.—
groups[].groupstringor nullThe group: a state code, office type, election slug or stage; null for contests without one.Only in GET /v1/seat-changes.us_representative
groups[].contestsintegerDecided contests linked to a seat.Only in GET /v1/seat-changes.52
groups[].partisanintegerOf those, contests for partisan seats.Only in GET /v1/seat-changes.52
groups[].flippedintegerPartisan seats that changed party.Only in GET /v1/seat-changes.3
groups[].flip_unknownintegerPartisan seats where the holder’s or the winner’s party isn’t known, so flipped is null.Only in GET /v1/seat-changes.0
groups[].outcomesobjectContests by seat outcome (incumbent_reelected, incumbent_defeated, open_seat, new_seat, unknown, incumbents_reelected, mixed); outcomes with none are left out.Only in GET /v1/seat-changes.—
groups[].partiesarray of Seat change countsEach party with a seat up or won, most wins first.Only in GET /v1/seat-changes.—
contestsintegerDecided contests linked to a seat.Only in totals and groups[].—
partisanintegerOf those, contests for partisan seats.Only in totals and groups[].—
flippedintegerPartisan seats that changed party.Only in totals and groups[].—
flip_unknownintegerPartisan seats where the holder’s or the winner’s party isn’t known, so flipped is null.Only in totals and groups[].—
outcomesobjectContests by seat outcome (incumbent_reelected, incumbent_defeated, open_seat, new_seat, unknown, incumbents_reelected, mixed); outcomes with none are left out.Only in totals and groups[].—
partiesarray of Seat change countsEach party with a seat up or won, most wins first.Only in totals and groups[].—
partystringParty name.Only in parties[].—
slugstringParty slug, for flipped_to= and flipped_from=.16 values so far: meaningsOnly in parties[].democratic
held_going_inintegerContests whose holders going in included this party.Only in parties[].—
wonintegerContests this party won (for vote for N, at least one seat).Only in parties[].—
gainedintegerFlipped contests this party won without holding a seat up going in.Only in parties[].—
lostintegerFlipped contests this party held going in and won no seat in.Only in parties[].—
netintegergained minus lost.Only in parties[].—

Download every dictionary as CSV or JSON.

Sample (JSON)

One seat change counts as the API returns it, in GET /v1/seat-changes. More in the sample data.

{
  "group_by": "office_type",
  "totals": {
    "contests": 52,
    "partisan": 52,
    "flipped": 3,
    "flip_unknown": 0,
    "outcomes": {
      "incumbent_reelected": 45,
      "incumbent_defeated": 3,
      "open_seat": 4
    },
    "parties": [
      {
        "party": "Democratic",
        "slug": "democratic",
        "held_going_in": 40,
        "won": 43,
        "gained": 3,
        "lost": 0,
        "net": 3
      },
      {
        "party": "Republican",
        "slug": "republican",
        "held_going_in": 12,
        "won": 9,
        "gained": 0,
        "lost": 3,
        "net": -3
      }
    ]
  },
  "groups": [
    {
      "group": "us_representative",
      "contests": 52,
      "partisan": 52,
      "flipped": 3,
      "flip_unknown": 0,
      "outcomes": {
        "incumbent_reelected": 45,
        "incumbent_defeated": 3,
        "open_seat": 4
      },
      "parties": [
        {
          "party": "Democratic",
          "slug": "democratic",
          "held_going_in": 40,
          "won": 43,
          "gained": 3,
          "lost": 0,
          "net": 3
        },
        {
          "party": "Republican",
          "slug": "republican",
          "held_going_in": 12,
          "won": 9,
          "gained": 0,
          "lost": 3,
          "net": -3
        }
      ]
    }
  ]
}
Seat change counts data dictionary · BallotData API