District partisanship
The presidential vote within a contest’s district in 2016, 2020 and 2024: the usual control for a district’s partisan lean.
- Returned by
GET /v1/contests,GET /v1/contests/{id},GET /v1/elections/{slug}/export- Found in
- District (
partisanship) - Shapes
- The full record is in a district’s partisanship. The shorter forms in each year leave some fields out; a field that isn’t in every form says where it is.
How it connects
- Every district carries
partisanship, so every contest has its district’s presidential vote alongside its own result. - With
format=csv,GET /v1/contestsgives each year’sdem_two_party_pctandtotal_votesas columns.
Good to know
- Only official counts for exactly the district’s area: a state (from the FEC’s official results), a county (from the MIT Election Data and Science Lab’s county returns, CC0) or a district an election office reported (California’s congressional and legislative districts). Nothing is estimated from other areas, so most local districts have none.
- A district that covers exactly one county (a county court or prosecutor’s district, for example) carries that county’s figure.
dem_two_party_pctis 100 × Democratic / (Democratic + Republican). Subtract 50 for the usual lean; third-party votes are only intotal_votes.- 2016 is not loaded yet, so
president_2016isnulleverywhere for now.
Fields
| Field | Type | Meaning | Example |
|---|---|---|---|
president_2016 | District partisanshipor null | The 2016 presidential vote in the district; null where we have no official count for it.Only in a district’s partisanship. | — |
president_2020 | District partisanshipor null | The 2020 presidential vote in the district; null where we have no official count for it.Only in a district’s partisanship. | — |
president_2024 | District partisanshipor null | The 2024 presidential vote in the district; null where we have no official count for it.Only in a district’s partisanship. | — |
dem_votes | integer | Votes for the Democratic nominee for president in the district.Only in each year. | 323719 |
rep_votes | integer | Votes for the Republican nominee for president in the district.Only in each year. | 62594 |
total_votes | integer | All votes for president in the district, every candidate and write-ins.Only in each year. | 402964 |
dem_two_party_pct | number | The Democratic share of the two-party vote, 0 to 100: 100 × dem_votes / (dem_votes + rep_votes). Subtract 50 for the usual lean measure; the Republican share is 100 minus it.Only in each year. | 83.797 |
method | string | How the district’s count was made: official_district, official_county, statewide (or aggregated_precincts, reserved).official_district, official_county, statewide, aggregated_precincts meaningsOnly in each year. | official_county |
source | object | The source of the count.Only in each year. | — |
source.name | string | Who published the count.Only in each year. | MIT Election Data and Science Lab, County Presidential Election Returns 2000-2024 (v20) |
source.url | stringURL | Where the count was published.Only in each year. | https://doi.org/10.7910/DVN/VOQCHQ |
retrieved_on | stringYYYY-MM-DD | When we read it from the source.Only in each year. | 2026-11-14 |
Download every dictionary as CSV or JSON.
Sample (JSON)
One district partisanship as the API returns it, in a district’s partisanship. More in the sample data.
{
"president_2016": null,
"president_2020": {
"dem_votes": 378156,
"rep_votes": 56417,
"total_votes": 443553,
"dem_two_party_pct": 87.018,
"method": "official_county",
"source": {
"name": "MIT Election Data and Science Lab, County Presidential Election Returns 2000-2024 (v20)",
"url": "https://doi.org/10.7910/DVN/VOQCHQ"
},
"retrieved_on": "2026-11-14"
},
"president_2024": {
"dem_votes": 323719,
"rep_votes": 62594,
"total_votes": 402964,
"dem_two_party_pct": 83.797,
"method": "official_county",
"source": {
"name": "MIT Election Data and Science Lab, County Presidential Election Returns 2000-2024 (v20)",
"url": "https://doi.org/10.7910/DVN/VOQCHQ"
},
"retrieved_on": "2026-11-14"
}
}