Us Elections
v0.2.1us-elections -- U.S. election results by state, district, county and precinct (fleet #2952…
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
election_results
Candidate-level U.S. election results for one state, year and office, at state, county, or precinct granularity. State-level President and Senate cover every state 1976-2024, including 2020 and 2022 (MIT Election Data + Science Lab / MEDSL, Harvard Dataverse, CC0). Official FEC district-by-district U.S. House results (FEC, "Federal Elections" statistical publication, public domain) cover the 2020 and 2022 general elections nationwide -- FEC has not yet published its compiled 2024 edition, and House is not otherwise available nationwide (MEDSL's own House file is guestbook-gated). County-level…
| Parameter | Type | Description |
|---|---|---|
office * | string | "president", "senate", or "house". |
state * | string | US state, postal code ("PA") or full name ("Pennsylvania"). |
year * | number | Election year, e.g. 2024. |
county | string | County name to scope a county- or precinct-level query (case-insensitive). Optional. |
district | string | House district to scope to one race, e.g. "09" or "9" (normalized to 2 digits). Optional; only meaningful for office="house". |
level | string | Granularity: "state", "county", or "precinct". Default "county". FEC official House results are stored at level="state" (FEC publishes one final count per district, with no further sub-division). |
limit | number | Max rows, 1-500. Default 50. A truncated response carries truncated:true, total_matching, and a hint for narrowing (county, level="county"). |
offset | number | Pagination offset. Default 0. |
election_race_summary
Aggregated summary of a U.S. election race -- total votes, each candidate's vote share, the winner and the winning margin -- for one state/year/office. Uses the most aggregated level actually available for that race: a statewide/district number when MEDSL or FEC data covers it (President/Senate nationwide 1976-2024; House nationwide for 2020+2022 by FEC), otherwise summed from whatever county/precinct detail exists (OpenElections). For a district office (House) returns one summary per district. Use for "who won the 2024 PA Senate race and by how much" rather than reading every county row yours…
| Parameter | Type | Description |
|---|---|---|
office * | string | "president", "senate", or "house". |
state * | string | US state, postal code ("PA") or full name ("Pennsylvania"). |
year * | number | Election year, e.g. 2024. |
list_elections
List the state/year/office combinations this pack actually holds data for, and at which levels (state/county/precinct). Pass state to scope the listing to one state; omit it to see full coverage. Use this before election_results or election_race_summary to check whether a given state/year/office exists before querying it, or to discover what is covered.
| Parameter | Type | Description |
|---|---|---|
state | string | US state, postal code ("PA") or full name ("Pennsylvania"), to scope the listing. Optional. |