{"openapi":"3.1.0","info":{"title":"BallotData API","version":"1.28.0","summary":"U.S. ballots, endorsers and endorsements, and a live stream of endorsement changes.","description":"Ballot races (elections, contests and their choices), endorsers and endorsements across the U.S., who holds office now, and a stream of endorsement changes.\n\nEverything is JSON over HTTPS. Send your API key on every request as `Authorization: Bearer ebk_…`. Lists are paged: `{ \"data\": [...], \"next_cursor\": \"…\" }`; pass `cursor` for the next page. Every read takes `fields` to return only the fields you name, nested ones included: `fields=id,title,choices(label,party)` (guide: /docs/fields). Errors are `{ \"error\": { \"code\", \"message\", \"request_id\" } }`.\n\nTo find the ballot at an address, send it to `POST /v1/ballot`; the address is used for that request only and never stored.","contact":{"name":"BallotData","email":"sales@ballotdata.ai","url":"https://ballotdata.ai"},"termsOfService":"https://ballotdata.ai/legal/terms","license":{"name":"Proprietary: BallotData terms of service","url":"https://ballotdata.ai/legal/terms"}},"externalDocs":{"description":"Guides","url":"https://api.ballotdata.ai/docs"},"servers":[{"url":"https://api.ballotdata.ai","description":"Production"}],"security":[{"bearer":[]}],"tags":[{"name":"Elections","description":"States, elections and coverage: what there is to ask about."},{"name":"Search","description":"One search by name across elections, contests, candidates, endorsers and offices, for when you know a name and need its slug or id."},{"name":"Ballot","description":"The ballot at a street address: the districts it is in and every contest on it, with how many endorsers back each choice."},{"name":"Contests","description":"The races on a ballot and their choices: candidates, or Yes/No for a measure. Contests carry their voting rules: vote for one, vote for N (votes_allowed), ranked choice (ranks_allowed), or yes/no, and their election results once a source has them: official counts from election offices, certified returns compiled by researchers for past elections, or a party’s announcement of the winner, always with the source’s URL."},{"name":"Endorsers","description":"Who endorses: unions, newspapers, parties, clubs, advocacy groups and officials, by category and home state."},{"name":"Endorsements","description":"Who each endorser backs in each race, and every change to those endorsements."},{"name":"Candidates","description":"The people on the ballot, every endorsement each one received, and where they stand on common issues."},{"name":"Officeholders","description":"Who holds each seat now, from Open States."},{"name":"Offices","description":"Seats that last across elections and redistricting, who held each since 2020, and whether each result changed hands."},{"name":"Stream","description":"Every endorsement added, changed or removed, as Server-Sent Events or by polling. Needs the stream:read scope and a plan that includes the stream.","externalDocs":{"description":"Stream API reference","url":"https://api.ballotdata.ai/docs/stream/reference"}},{"name":"Subscriptions","description":"Saved filters for the stream and events. Reading needs stream:read; changing needs subscriptions:write.","externalDocs":{"description":"Stream API reference","url":"https://api.ballotdata.ai/docs/stream/reference"}}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"ebk_<prefix>_<secret>","description":"An API key from your account, as Authorization: Bearer ebk_… on every request."}},"headers":{"RateLimit-Limit":{"description":"Requests allowed per minute on your plan.","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left this minute.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the minute resets.","schema":{"type":"integer"}},"X-Daily-Limit":{"description":"Requests allowed per UTC day, on plans with a daily cap.","schema":{"type":"integer"}},"X-Daily-Remaining":{"description":"Requests left today.","schema":{"type":"integer"}},"X-Request-Id":{"description":"This request’s id. Quote it when you write to us.","schema":{"type":"string","format":"uuid"}}},"schemas":{"Error":{"type":"object","description":"The body of every error response.","required":["error"],"properties":{"error":{"type":"object","description":"What went wrong.","required":["code","message","request_id"],"properties":{"code":{"type":"string","description":"Machine-readable error code.","enum":["missing_api_key","invalid_api_key","revoked_api_key","expired_api_key","ip_not_allowed","account_pending","account_suspended","account_closed","insufficient_scope","no_access","outside_purchase","invalid_parameter","invalid_cursor","invalid_filter","invalid_json","invalid_subscription","body_too_large","not_found","address_not_found","subscription_not_found","conflict","too_many_requests","too_many_failures","rate_limit_exceeded","daily_limit_exceeded","too_many_streams","too_many_lookups","cursor_expired","warming_up","server_busy","not_available","geocoder_unavailable","internal_error"],"x-enumDescriptions":{"missing_api_key":"No API key was sent. Send it as Authorization: Bearer <key>.","invalid_api_key":"The key isn’t one we issued: mistyped, cut off, or from another site.","revoked_api_key":"The key was revoked in the console. Use another key.","expired_api_key":"The key passed the expiry date set on it.","ip_not_allowed":"The key is limited to certain addresses and this request came from another.","account_pending":"The account is waiting for approval.","account_suspended":"The account is suspended. Write to us.","account_closed":"The account is closed.","insufficient_scope":"The key lacks the scope this endpoint needs (data:read, stream:read or subscriptions:write).","no_access":"The account’s purchases don’t include this part of the API (the stream, for example), or they have ended.","outside_purchase":"The record is in a state or election the account hasn’t bought. The message says what it does cover.","invalid_parameter":"A parameter has a value we can’t use: the message names it.","invalid_cursor":"The cursor isn’t one we gave out. Pass next_cursor back exactly as you got it.","invalid_filter":"A stream filter parameter is invalid: the message says which.","invalid_json":"The request body isn’t valid JSON.","invalid_subscription":"The subscription’s name or filter is invalid: the message says which.","body_too_large":"The request body is over 100 KB.","not_found":"Nothing has that id or slug.","address_not_found":"POST /v1/ballot: the Census Bureau’s geocoder found no such address (or the point is outside the U.S.). Check the spelling and include the city and state or ZIP code.","subscription_not_found":"No subscription in your account has that id or name.","conflict":"A subscription with that name already exists in your account.","too_many_requests":"Too many requests from one address. Wait for Retry-After seconds.","too_many_failures":"Too many requests with a missing or wrong key from one address. Wait for Retry-After seconds.","rate_limit_exceeded":"Over your plan’s requests a minute. Wait for Retry-After seconds.","daily_limit_exceeded":"Over your plan’s requests a day (the day is UTC).","too_many_streams":"Your account already has as many streams open as its plan allows.","too_many_lookups":"Over 60 ballot lookups (POST /v1/ballot) a minute for the account. Wait for Retry-After seconds.","cursor_expired":"The cursor or since time is older than the 7 days of changes the stream keeps. Start again with from=earliest, and catch up with GET /v1/changes.","warming_up":"The stream is still loading on this server. Try again in a few seconds.","server_busy":"This server has too many open streams. Try again.","not_available":"This data isn’t loaded yet (officeholders or offices, for example). Try again later.","geocoder_unavailable":"POST /v1/ballot: the Census Bureau’s geocoder isn’t answering. Try again in a minute.","internal_error":"Something went wrong on our side. Quote request_id when you write to us."},"x-values":"error-code"},"message":{"type":"string","description":"What went wrong, in plain English."},"request_id":{"type":"string","description":"Quote this when you write to us. Also sent as the X-Request-Id header.","format":"uuid"}}}}},"State":{"type":"object","required":["code","fips","name"],"properties":{"code":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]},"fips":{"type":"string","description":"Two-digit FIPS code.","examples":["06"]},"name":{"type":"string","description":"The state’s full name."}}},"PresidentialVote":{"type":"object","description":"The presidential vote within one district in one election year.","required":["dem_votes","rep_votes","total_votes","dem_two_party_pct","method","source","retrieved_on"],"properties":{"dem_votes":{"type":"integer","description":"Votes for the Democratic nominee for president in the district."},"rep_votes":{"type":"integer","description":"Votes for the Republican nominee for president in the district."},"total_votes":{"type":"integer","description":"All votes for president in the district, every candidate and write-ins."},"dem_two_party_pct":{"type":"number","description":"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."},"method":{"type":"string","description":"How the district’s count was made: official_district, official_county, statewide (or aggregated_precincts, reserved).","enum":["official_district","official_county","statewide","aggregated_precincts"],"x-enumDescriptions":{"official_district":"An election office published the presidential vote for this district itself (California’s Statement of Vote supplement, for example).","official_county":"The district is a county: the county’s official presidential returns.","statewide":"The district is the whole state: the state’s official presidential returns.","aggregated_precincts":"Official precinct returns summed to the district. Reserved: no rows use it yet."},"x-values":"presidential-vote-method"},"source":{"type":"object","description":"The source of the count.","required":["name","url"],"properties":{"name":{"type":"string","description":"Who published the count."},"url":{"type":"string","description":"Where the count was published.","format":"uri"}}},"retrieved_on":{"type":"string","description":"When we read it from the source.","format":"date"}}},"DistrictPartisanship":{"type":"object","description":"The district’s partisan lean, as the presidential vote in it: the control most election studies use. Only official counts for exactly the district’s area (a state, a county, or a district an election office reported); never estimated from other areas.","required":["president_2016","president_2020","president_2024"],"properties":{"president_2016":{"description":"The 2016 presidential vote in the district; null where we have no official count for it.","oneOf":[{"$ref":"#/components/schemas/PresidentialVote"},{"type":"null"}]},"president_2020":{"description":"The 2020 presidential vote in the district; null where we have no official count for it.","oneOf":[{"$ref":"#/components/schemas/PresidentialVote"},{"type":"null"}]},"president_2024":{"description":"The 2024 presidential vote in the district; null where we have no official count for it.","oneOf":[{"$ref":"#/components/schemas/PresidentialVote"},{"type":"null"}]}}},"DistrictDemographics":{"type":"object","description":"The U.S. Census Bureau’s American Community Survey 5-year estimates for the Census areas that make up the district (public domain). This product uses Census Bureau data but is not endorsed or certified by the Census Bureau.","required":["acs_year","population","citizen_voting_age_population","median_household_income","median_age","pct_bachelors_or_higher","pct_white_alone_not_hispanic","pct_black_alone","pct_asian_alone","pct_hispanic","pct_foreign_born","pct_owner_occupied","pct_below_poverty","source","retrieved_on"],"properties":{"acs_year":{"type":"integer","description":"The last year of the American Community Survey 5-year estimates: 2024 means 2020-2024."},"population":{"type":["integer","null"],"description":"Total population (ACS B01003)."},"citizen_voting_age_population":{"type":["integer","null"],"description":"U.S. citizens 18 and over (ACS B05003): the usual denominator for turnout by population."},"median_household_income":{"type":["integer","null"],"description":"Median household income in dollars (ACS B19013). null for a district made of several Census areas, since medians can’t be combined."},"median_age":{"type":["number","null"],"description":"Median age in years (ACS B01002). null for a district made of several Census areas."},"pct_bachelors_or_higher":{"type":["number","null"],"description":"Share of people 25 and over with a bachelor’s degree or higher, 0 to 100 (ACS B15003)."},"pct_white_alone_not_hispanic":{"type":["number","null"],"description":"Share of people who are white alone and not Hispanic or Latino, 0 to 100 (ACS B03002)."},"pct_black_alone":{"type":["number","null"],"description":"Share of people who are Black or African American alone, Hispanic or not, 0 to 100 (ACS B03002)."},"pct_asian_alone":{"type":["number","null"],"description":"Share of people who are Asian alone, Hispanic or not, 0 to 100 (ACS B03002)."},"pct_hispanic":{"type":["number","null"],"description":"Share of people who are Hispanic or Latino, of any race, 0 to 100 (ACS B03002)."},"pct_foreign_born":{"type":["number","null"],"description":"Share of people born outside the United States, 0 to 100 (ACS B05002)."},"pct_owner_occupied":{"type":["number","null"],"description":"Share of occupied housing units lived in by their owners, 0 to 100 (ACS B25003)."},"pct_below_poverty":{"type":["number","null"],"description":"Share of people whose poverty status is determined who are below the poverty line, 0 to 100 (ACS B17001)."},"source":{"type":"object","description":"The source of the estimates.","required":["name","url"],"properties":{"name":{"type":"string","description":"Who published the estimates."},"url":{"type":"string","description":"Where the estimates was published.","format":"uri"}}},"retrieved_on":{"type":"string","description":"When we read it from the source.","format":"date"}}},"Turnout":{"type":"object","description":"Registered voters and ballots cast in the contest’s jurisdiction (a state, or a county, city or town with its own election board) for this election: the denominator for turnout and roll-off. From the U.S. Election Assistance Commission’s Election Administration and Voting Survey for 2020, 2022 and 2024, and from state election offices for 2026.","required":["registered_voters","ballots_cast","turnout_pct","status","source","retrieved_on"],"properties":{"registered_voters":{"type":["integer","null"],"description":"Registered voters in the jurisdiction, as the source counts them (the EAC’s survey counts active and inactive registrants); null where the source gives none, as in North Dakota, which has no registration."},"ballots_cast":{"type":["integer","null"],"description":"Voters who cast a ballot that was counted, as the source reports it."},"turnout_pct":{"type":["number","null"],"description":"The source’s own turnout percentage when it prints one, else ballots_cast / registered_voters × 100. Never against the voting-age population."},"status":{"type":"string","description":"unofficial while the counts can still change; certified once canvassed.","enum":["unofficial","certified"],"x-enumDescriptions":{"unofficial":"Election-night and canvass counts: still changing. We read them again every day until they’re certified.","certified":"The canvass is certified: the final official count."},"x-values":"result-status"},"source":{"type":"object","description":"The source of the counts.","required":["name","url"],"properties":{"name":{"type":"string","description":"Who published the counts."},"url":{"type":"string","description":"Where the counts was published.","format":"uri"}}},"retrieved_on":{"type":"string","description":"When we read it from the source.","format":"date"}}},"BackgroundSource":{"type":"object","description":"One background fact with its source.","required":["attribute","value","basis","quote","source","retrieved_on"],"properties":{"attribute":{"type":"string","description":"Which fact: held_elected_office, prior_office, gender or veteran.","enum":["held_elected_office","prior_office","gender","veteran"],"x-enumDescriptions":{"held_elected_office":"Whether the candidate held elected office before: value true. We never record false, so an absence means unknown.","prior_office":"An elected office the candidate held, by its title (value).","gender":"The candidate’s gender as an official roster or the candidate’s own words state it (value: woman, man or nonbinary).","veteran":"The candidate served in the U.S. armed forces, as an official roster or the candidate’s own words state it (value true)."},"x-values":"background-attribute"},"value":{"type":"string","description":"The value: true, an office title, or woman, man or nonbinary."},"basis":{"type":"string","description":"What it rests on: our_results, officeholder_record, official_roster or candidate_statement.","enum":["our_results","officeholder_record","official_roster","candidate_statement"],"x-enumDescriptions":{"our_results":"Our own election results: the candidate won an election to the office.","officeholder_record":"Our officeholder records (Open States, CC0): the candidate holds or held the seat.","official_roster":"An official roster: the Congressional Directory, or the congress-legislators list of members of Congress.","candidate_statement":"The candidate’s own words on their campaign website, quoted in quote."},"x-values":"background-basis"},"quote":{"type":["string","null"],"description":"The candidate’s own words, one sentence, for a candidate_statement (or the roster’s words for military service)."},"source":{"type":"object","description":"The source of the fact.","required":["name","url"],"properties":{"name":{"type":"string","description":"Who published the fact."},"url":{"type":"string","description":"Where the fact was published.","format":"uri"}}},"retrieved_on":{"type":"string","description":"When we read it from the source.","format":"date"}}},"CandidateBackground":{"type":"object","description":"Three facts research on endorsements controls for: prior elected office, gender and military service. Only as our results, an officeholder record, an official roster or the candidate’s own words state them. A null means unknown. We don’t collect race, ethnicity, religion or sexual orientation.","required":["held_elected_office","prior_offices","gender","veteran","sources"],"properties":{"held_elected_office":{"type":["boolean","null"],"description":"true when the candidate held elected office before (our results, officeholder records or an official roster show it); null where we don’t know. Never false: no source shows a negative."},"prior_offices":{"type":"array","description":"Elected offices the candidate held, by title. Empty where we know of none.","items":{"type":"string"}},"gender":{"type":["string","null"],"description":"woman, man or nonbinary, only where an official roster or the candidate’s own words state it; null otherwise. Never inferred from a name or a photo.","enum":["woman","man","nonbinary",null],"x-enumDescriptions":{"woman":"A woman, as an official roster or the candidate’s own words state it.","man":"A man, as an official roster or the candidate’s own words state it.","nonbinary":"Nonbinary, as the candidate’s own words state it."},"x-values":"gender"},"veteran":{"type":["boolean","null"],"description":"true when an official roster or the candidate’s own words say they served in the U.S. armed forces; null otherwise (not false)."},"sources":{"type":"array","description":"Every fact above, each with its source.","items":{"$ref":"#/components/schemas/BackgroundSource"}}}},"IdeologyScore":{"type":"object","description":"One published ideology estimate for the candidate. Its authors’ estimate from their own method, not a fact about the person, and neither an endorsement nor a rating.","required":["measure","score","second_dimension","period","person_key","license","source","retrieved_on"],"properties":{"measure":{"type":"string","description":"Which published measure: dime_cfscore (loaded) or dw_nominate and shor_mccarty (not loaded; their terms don’t allow commercial use).","enum":["dime_cfscore","dw_nominate","shor_mccarty"],"x-enumDescriptions":{"dime_cfscore":"Bonica’s DIME campaign-finance score (CFscore): candidates and donors on one left-right scale estimated from who gives money to whom. Negative is left, positive is right.","dw_nominate":"Voteview DW-NOMINATE, from roll-call votes in Congress. Not loaded: its terms don’t allow commercial use.","shor_mccarty":"Shor and McCarty state legislator scores. Not loaded: its license is non-commercial."},"x-values":"ideology-measure"},"score":{"type":"number","description":"The score: for dime_cfscore, roughly -2 to 2, negative left and positive right."},"second_dimension":{"type":["number","null"],"description":"A second dimension, for measures that have one; null for dime_cfscore."},"period":{"type":"string","description":"The years the estimate covers, as the source gives them (dime_cfscore: 1979-2024)."},"person_key":{"type":"string","description":"The source’s own key for the person: the FEC candidate id for dime_cfscore."},"license":{"type":"string","description":"The license the source is published under: ODC-BY 1.0 for DIME, which asks that you cite it (see /docs/research)."},"source":{"type":"object","description":"The source of the score.","required":["name","url"],"properties":{"name":{"type":"string","description":"Who published the score."},"url":{"type":"string","description":"Where the score was published.","format":"uri"}}},"retrieved_on":{"type":"string","description":"When we read it from the source.","format":"date"}}},"CandidateIdeology":{"type":"object","description":"Published ideology estimates for the candidate, matched on their FEC candidate id. Cite DIME when you use dime_cfscore: Bonica, Adam. 2024. Database on Ideology, Money in Politics, and Elections: Public version 4.0. Stanford University Libraries. https://data.stanford.edu/dime.","required":["dime_cfscore","scores"],"properties":{"dime_cfscore":{"type":["number","null"],"description":"The candidate’s DIME CFscore (Bonica, DIME v4.0, ODC-BY 1.0): one left-right scale from who gives money to whom, negative left and positive right; null where DIME has none (it covers candidates with an FEC id who raised money)."},"scores":{"type":"array","description":"Every score we hold for the candidate, with its source and license.","items":{"$ref":"#/components/schemas/IdeologyScore"}}}},"EndorserFactSource":{"type":"object","description":"One endorser fact with its source.","required":["fact","value","as_of","source","retrieved_on"],"properties":{"fact":{"type":"string","description":"Which fact.","enum":["fec_committee_id","ein","irs_subsection","union_members","olms_file_number","founded_year","parent_organization"],"x-enumDescriptions":{"fec_committee_id":"A Federal Election Commission committee id (C followed by eight digits), from the FEC committee master files.","ein":"The IRS employer identification number (nine digits), from the IRS Exempt Organizations Business Master File.","irs_subsection":"The tax-exemption section the IRS lists, such as 501(c)(4) or 501(c)(5).","union_members":"Members the union reported on its latest Department of Labor (OLMS) annual report.","olms_file_number":"The union’s Department of Labor (OLMS) file number.","founded_year":"The year the organization says it was founded, from its own About page.","parent_organization":"The organization it says it is an affiliate or chapter of, from its own About page."},"x-values":"endorser-fact"},"value":{"type":"string","description":"The value as the source gives it."},"as_of":{"type":"string","description":"The date the fact was true per its source: the end of the report period for union members, the IRS file’s posting date, or the day we read the file or page.","format":"date"},"source":{"type":"object","description":"The source of the fact.","required":["name","url"],"properties":{"name":{"type":"string","description":"Who published the fact."},"url":{"type":"string","description":"Where the fact was published.","format":"uri"}}},"retrieved_on":{"type":"string","description":"When we read it from the source.","format":"date"}}},"EndorserFacts":{"type":"object","description":"Identifiers and size, to join other data and weigh an endorsement by who made it: from the FEC, the IRS and the Department of Labor (U.S. government works), and the endorser’s own About page. A null means we have none.","required":["fec_committee_ids","ein","irs_subsection","union_members","union_members_as_of","olms_file_number","founded_year","parent_organization","sources"],"properties":{"fec_committee_ids":{"type":"array","description":"Federal Election Commission committee ids (C########) of the endorser’s political committees, from the FEC committee master files 2020-2026. Empty where we found none.","items":{"type":"string"}},"ein":{"type":["string","null"],"description":"IRS employer identification number, nine digits."},"irs_subsection":{"type":["string","null"],"description":"The tax-exemption section the IRS lists, such as 501(c)(4) or 501(c)(5)."},"union_members":{"type":["integer","null"],"description":"Members the union reported on its latest Department of Labor annual report (LM-2, LM-3 or LM-4)."},"union_members_as_of":{"type":["string","null"],"description":"The end of the report period union_members is for.","format":"date"},"olms_file_number":{"type":["string","null"],"description":"The union’s Department of Labor (OLMS) file number."},"founded_year":{"type":["integer","null"],"description":"The year the organization says it was founded."},"parent_organization":{"type":["string","null"],"description":"The organization it says it is an affiliate or chapter of."},"sources":{"type":"array","description":"Every fact above, each with its source and date; older union member counts too.","items":{"$ref":"#/components/schemas/EndorserFactSource"}}}},"Party":{"type":"object","required":["slug","name","abbreviation"],"properties":{"slug":{"type":"string","description":"Party slug.","examples":["democratic"],"x-enumDescriptions":{"conservative":"Conservative (CON).","constitution":"Constitution (CON).","dc-statehood-green":"DC Statehood Green (STG).","democratic":"Democratic (DEM).","green":"Green (GRN).","independent-american":"Independent American (IAP).","independent-party":"Independent Party (IP).","independent-party-of-delaware":"Independent Party of Delaware (IPD).","independent-party-of-oregon":"Independent Party of Oregon (IPO).","legal-marijuana-now":"Legal Marijuana NOW (LMN).","libertarian":"Libertarian (LIB).","pacific-green":"Pacific Green (PGP).","progressive":"Progressive (PRO).","progressive-party-of-oregon":"Progressive Party (PRO).","republican":"Republican (REP).","working-families":"Working Families (WFP)."},"x-values":"party"},"name":{"type":"string","description":"Party name."},"abbreviation":{"type":["string","null"],"description":"Short form as printed, e.g. DEM."}}},"Category":{"type":"object","description":"The kind of endorser.","required":["slug","name"],"properties":{"slug":{"type":"string","description":"Category slug, used in categories= filters.","examples":["labor"],"x-enumDescriptions":{"editorial":"Voter guides & editorial boards: each one a voter guide.","labor":"Labor: each one a labor union.","environment":"Environment & transportation: each one a environmental group.","business":"Housing & business: each one a housing or business group.","party":"Political parties: each one a political party.","club":"Political clubs: each one a political club.","community":"Community & advocacy: each one a community group.","officials":"Elected officials: each one a elected official."},"x-values":"endorser-category"},"name":{"type":"string","description":"Display name."}}},"EndorserCategory":{"type":"object","required":["slug","name","singular_name","endorser_count"],"properties":{"slug":{"type":"string","description":"Category slug, used in categories= filters.","examples":["labor"],"x-enumDescriptions":{"editorial":"Voter guides & editorial boards: each one a voter guide.","labor":"Labor: each one a labor union.","environment":"Environment & transportation: each one a environmental group.","business":"Housing & business: each one a housing or business group.","party":"Political parties: each one a political party.","club":"Political clubs: each one a political club.","community":"Community & advocacy: each one a community group.","officials":"Elected officials: each one a elected official."},"x-values":"endorser-category"},"name":{"type":"string","description":"Display name (plural)."},"singular_name":{"type":"string","description":"One of them: “Labor union”."},"endorser_count":{"type":"integer","description":"Endorsers in this category."}}},"EndorserRef":{"type":"object","description":"Who made an endorsement.","required":["id","slug","name","category","state"],"properties":{"id":{"type":"integer","description":"Endorser id."},"slug":{"type":"string","description":"Endorser slug, used in endorsers= filters."},"name":{"type":"string","description":"Endorser name."},"category":{"$ref":"#/components/schemas/Category"},"state":{"type":["string","null"],"pattern":"^[A-Z]{2}$","description":"Home state; null for national endorsers.","examples":["CA"]}}},"Endorser":{"type":"object","required":["id","slug","name","category","description","website_url","logo_url","state","party","endorsement_count","facts"],"properties":{"id":{"type":"integer","description":"Endorser id."},"slug":{"type":"string","description":"Endorser slug, used in endorsers= filters and GET /v1/endorsers/{slug}."},"name":{"type":"string","description":"Endorser name."},"category":{"$ref":"#/components/schemas/Category"},"description":{"type":["string","null"],"description":"About the endorser."},"website_url":{"type":["string","null"],"description":"Endorser’s website.","format":"uri"},"logo_url":{"type":["string","null"],"description":"The endorser’s logo image.","format":"uri"},"state":{"type":["string","null"],"pattern":"^[A-Z]{2}$","description":"Home state; null for national endorsers.","examples":["CA"]},"party":{"description":"The party, for a party or party club.","oneOf":[{"$ref":"#/components/schemas/Party"},{"type":"null"}]},"endorsement_count":{"type":"integer","description":"Contests this endorser takes a position in, across every election you can read. A ranked-choice order or a vote-for-N slate counts once."},"facts":{"$ref":"#/components/schemas/EndorserFacts"}}},"EndorserDetail":{"type":"object","required":["id","slug","name","category","description","website_url","logo_url","state","party","endorsement_count","facts","outside_spending","fec_committees","contributions_to_candidates","elections"],"properties":{"id":{"type":"integer","description":"Endorser id."},"slug":{"type":"string","description":"Endorser slug."},"name":{"type":"string","description":"Endorser name."},"category":{"$ref":"#/components/schemas/Category"},"description":{"type":["string","null"],"description":"About the endorser."},"website_url":{"type":["string","null"],"description":"Endorser’s website.","format":"uri"},"logo_url":{"type":["string","null"],"description":"The endorser’s logo image.","format":"uri"},"state":{"type":["string","null"],"pattern":"^[A-Z]{2}$","description":"Home state; null for national endorsers.","examples":["CA"]},"party":{"description":"The party, for a party or party club.","oneOf":[{"$ref":"#/components/schemas/Party"},{"type":"null"}]},"endorsement_count":{"type":"integer","description":"Contests this endorser takes a position in, across every election you can read. A ranked-choice order or a vote-for-N slate counts once."},"facts":{"$ref":"#/components/schemas/EndorserFacts"},"outside_spending":{"type":"array","description":"What the endorser’s FEC committees (fec_committees) spent for and against federal candidates, newest cycle first (2024 and 2026 cycles; outside_spending_cycles narrows them); empty when we hold no FEC committee for it or it reported none. Not endorsements.","items":{"$ref":"#/components/schemas/EndorserOutsideSpending"}},"fec_committees":{"type":"array","description":"The endorser’s FEC committees, with their receipts and spending: the endorser itself when it is a registered committee (basis fec_id), and PACs that name it as their sponsor (basis sponsor). Empty where we found none.","items":{"$ref":"#/components/schemas/EndorserCommittee"}},"contributions_to_candidates":{"type":"array","description":"What the endorser’s political committees (its own, and PACs it sponsors) gave federal candidates, per FEC cycle, newest first; empty if none.","items":{"$ref":"#/components/schemas/CommitteeContributionsGiven"}},"elections":{"type":"array","description":"Elections the endorser has endorsed in, newest first.","items":{"type":"object","required":["election","name","date","contests"],"properties":{"election":{"type":"string","description":"Election slug."},"name":{"type":"string","description":"Election name."},"date":{"type":"string","description":"Election day.","format":"date"},"contests":{"type":"integer","description":"Contests this endorser took a position in."}}}}}},"Election":{"type":"object","description":"The election the contest is in.","required":["id","slug","name","short_name","date","state","type","primary_system","info_url","details"],"properties":{"id":{"type":"integer","description":"Election id."},"slug":{"type":"string","description":"Election slug, used in elections= filters: <state>-<date>-<type>. Filters also take <date>-<type> or <date> for every matching election that day.","examples":["ca-2026-11-03-general"]},"name":{"type":"string","description":"Election name."},"short_name":{"type":["string","null"],"description":"Shorter name."},"date":{"type":"string","description":"Election day.","format":"date"},"state":{"type":["string","null"],"pattern":"^[A-Z]{2}$","description":"State; null for a multi-state election.","examples":["CA"]},"type":{"type":"string","description":"Kind of election.","enum":["general","primary","special","special_primary","runoff","consolidated"],"x-enumDescriptions":{"general":"A general election: the November election (or a state’s regular election day) that fills offices and decides measures.","primary":"A primary: voters choose each party’s nominee, or (in top-two and Louisiana-style states) the candidates who go on to the general.","special":"A special election held outside the regular schedule, usually to fill a vacancy or decide a measure.","special_primary":"The primary for a special election.","runoff":"A runoff between the leading candidates when no one won the earlier round outright (the share needed is in the contest’s details.majority_required or vote_required).","consolidated":"Several jurisdictions’ elections held together on one ballot (a city and school election on the same day, for example); details.consolidated_with names them."},"x-values":"election-type"},"primary_system":{"type":["string","null"],"description":"How the state runs primaries.","enum":["none","closed","semi_closed","open","top_two","top_four","nonpartisan",null],"x-enumDescriptions":{"none":"No primary system is recorded for this election.","closed":"Only voters registered with a party may vote in its primary.","semi_closed":"A party’s registered voters, plus unaffiliated voters who choose that party’s ballot.","open":"Any registered voter may choose any one party’s ballot.","top_two":"Every candidate is on one primary ballot whatever their party, and the top two go on to the general (Washington, California).","top_four":"Every candidate is on one primary ballot, and the top four go on to a ranked-choice general (Alaska).","nonpartisan":"Candidates run without party labels; the leading candidates go on, or a majority wins outright."},"x-values":"primary-system"},"info_url":{"type":["string","null"],"description":"Official election page.","format":"uri"},"details":{"type":"object","description":"Voting rules for the election. Only keys that apply are present.","required":[],"properties":{"all_mail":{"type":"boolean","description":"Every voter is mailed a ballot."},"ranked_choice":{"type":"boolean","description":"Some contests in this election use ranked choice voting."},"fusion_voting":{"type":"boolean","description":"Candidates can appear on more than one party’s line (New York, Connecticut)."},"partisan_primary":{"type":"boolean","description":"A party primary."},"primary":{"type":"string","description":"Which primary, where a state holds several."},"consolidated_with":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Elections held on the same ballot: a name, or a list of names."},"runoff_date":{"type":"string","description":"Date of a runoff, if one is needed.","format":"date"},"runoff_election_date":{"type":"string","description":"Date of the runoff election.","format":"date"},"top_two_primary_date":{"type":"string","description":"Date of the top-two primary that chose these candidates.","format":"date"},"louisiana_open_primary":{"type":"boolean","description":"Louisiana’s open (jungle) primary."},"note":{"type":"string","description":"Anything else voters should know."},"historical":{"type":"boolean","description":"A past election kept for its results and history (the November 5, 2024 general, for example). Never shown to voters on endorsedby.org."}}}}},"SearchMatch":{"type":"object","required":["type","slug","id","label","detail","state","date","path","match"],"properties":{"type":{"type":"string","description":"What it is.","enum":["election","contest","person","candidate","endorser","office"],"x-enumDescriptions":{"election":"An election (slug and id), or a nationwide date and type (slug only, id null): pass the slug in any elections filter.","contest":"A contest (id; slug is null). GET /v1/contests/{id}.","person":"A person (slug, with candidate_ids for each of their candidate records). GET /v1/candidates?person={slug}.","candidate":"A candidate record not linked to a person (id; slug is null). GET /v1/candidates/{id}.","endorser":"An endorser (slug). GET /v1/endorsers/{slug}.","office":"A seat (slug). GET /v1/offices/{slug}."},"x-values":"search-result-type"},"slug":{"type":["string","null"],"description":"Its slug: an election’s (or a nationwide date and type, such as 2026-11-03-general), a contest’s, a person’s, an endorser’s or an office’s. null for a candidate record, which has an id."},"id":{"type":["integer","null"],"description":"Its id: a contest’s, a candidate record’s or an election’s. null for a person, endorser, office or nationwide date."},"label":{"type":"string","description":"Its name: the election’s, the contest’s title, the person’s, the endorser’s or the office’s."},"detail":{"type":["string","null"],"description":"A few words to tell matches apart: the state and date of an election, the district and election of a contest, a person’s latest contest, an endorser’s category and home state, an office’s seat and state."},"state":{"type":["string","null"],"pattern":"^[A-Z]{2}$","description":"Its state; null for a national endorser or a nationwide date.","examples":["CA"]},"date":{"type":["string","null"],"description":"The election date: the election’s, the contest’s, or a person’s or candidate’s latest.","format":"date"},"path":{"type":"string","description":"The API path that gets it (or, for an election, lists its contests)."},"candidate_ids":{"type":"array","description":"A person’s candidate records (GET /v1/candidates/{id}). Only on type person.","items":{"type":"integer"}},"match":{"type":"integer","description":"How well it matched, best first: 0 the slug or whole name, 1 the name starts with the words, 2 every word starts a word of the name, 3 the words matched elsewhere (state, category, district, election, other names or candidates).","minimum":0,"maximum":3}}},"ElectionSummary":{"allOf":[{"$ref":"#/components/schemas/Election"},{"type":"object","required":["contest_count","endorsement_count","result_count"],"properties":{"contest_count":{"type":"integer","description":"Contests on the ballot."},"endorsement_count":{"type":"integer","description":"Endorsements in those contests."},"result_count":{"type":"integer","description":"Contests on the ballot with a result."}}}]},"District":{"type":"object","description":"The district a contest is voted in.","required":["id","ocd_id","name","level","type","state","partisanship","demographics"],"properties":{"id":{"type":"integer","description":"District id. Matches an officeholder’s district_id."},"ocd_id":{"type":["string","null"],"description":"Open Civic Data division id, used in districts= filters."},"name":{"type":"string","description":"District name."},"level":{"type":"string","description":"Level of government.","enum":["federal","state","county","city","school","special"],"x-enumDescriptions":{"federal":"The whole country, or a U.S. House district.","state":"A whole state, or a state legislative, judicial or other state district.","county":"A county (a parish in Louisiana, a borough in Alaska) or a district within one.","city":"A city, town, township, village or borough, or a ward or council district within one.","school":"A school district, community college district, or a trustee area within one.","special":"A special district: water, fire, hospital, park, transit, port, conservation and the like."},"x-values":"district-level"},"type":{"type":"string","description":"Kind of district: statewide, congressional, state_upper, state_lower, county, council, school, …","x-enumDescriptions":{"airport_authority":"An airport authority’s district. Example: Hall County Airport Authority.","anc_smd":"A single-member district of a Washington, D.C. Advisory Neighborhood Commission. Example: ANC 1A01.","annexation_area":"The area a proposed annexation would add to a city. Example: Tucker annexation area (SB 622).","appellate_district":"A state appellate court district. Example: Illinois Appellate Court, First District.","appraisal_district":"A property appraisal district. Example: Collin Central Appraisal District.","assistance_district":"A county assistance district (Texas), proposed or in place. Example: Carson County Assistance District (proposed; Carson County outside Panhandle, White Deer, Groom, Skellytown and Fritch).","board_district":"A member district of a local board (a city, utility or similar board). Example: Hot Springs Board District 2.","board_of_education_district":"A member district of a county or city board of education. Example: Anderson County Board of Education District 1.","board_of_equalization":"A district of a state board of equalization (California’s tax board). Example: State Board of Equalization District 2.","board_of_regents":"A district of a state university’s board of regents. Example: University of Nebraska Board of Regents District 1.","board_of_review_district":"A district of a county property-tax board of review. Example: Cook County Board of Review District 1.","cemetery_district":"A cemetery district. Example: Chugwater Cemetery District.","chancery_court_district":"A chancery court district (Mississippi, Tennessee). Example: 1st Chancery Court District.","chancery_court_district_subdistrict":"A subdistrict that elects one chancery judge. Example: Chancery Court Subdistrict 5-1.","circuit_court":"A circuit court’s circuit. Example: 6th Judicial Circuit.","circuit_court_district":"A circuit court district. Example: 1st Circuit Court District.","circuit_court_district_subdistrict":"A subdistrict that elects one circuit judge. Example: Circuit Court Subdistrict 4-1.","city":"A whole city. Example: City of Oakland.","city_council":"A city council district. Example: Portland District 4.","college":"A community college district. Example: Grossmont-Cuyamaca Community College District.","college_district":"A community college district. Example: Collin County Community College District.","commission":"A county commission, or a district of one. Example: Clay County Commission, Eastern District.","commission_district":"A county or city commission district. Example: Jefferson County Commission District 1.","commissioner_district":"A county commissioner district. Example: El Paso County Commissioner District 1.","commissioner_precinct":"A county commissioners court precinct (Texas). Example: Travis County Commissioners Precinct 2.","community_college":"A community college district. Example: San Francisco Community College District.","community_college_district":"A community college district. Example: Lansing Community College.","congressional":"A U.S. House district (or a whole state with one at-large seat). Example: California Congressional District 11.","conservancy_district":"A conservancy (water) district. Example: Garrison Diversion Conservancy District, Wells County.","conservation_district":"A conservation district. Example: Minnehaha Conservation District.","constable_district":"A constable’s district. Example: Washington County Constable District 1.","constable_precinct":"A constable precinct (Texas). Example: Travis County Constable Precinct 4.","council":"A city or county council district. Example: City of Oakland Council District 2.","council_district":"A city or county council district. Example: Austin City Council District 1.","county":"A whole county (parish, borough), or a consolidated city and county. Example: City and County of San Francisco.","county_budget_committee":"A county budget committee district. Example: Knox County Budget Committee District 6.","county_commission":"A county commission or board of supervisors district. Example: Yavapai County Board of Supervisors District 2.","county_commission_district":"A county commission district. Example: Blount County Commission District 4.","county_council":"A county council district. Example: Cuyahoga County Council District 1.","county_council_district":"A county council district. Example: Franklin County Council/Commissioner District 3.","county_court_district":"A county court district. Example: Hinds County Court District 1.","county_division":"A division of a county with its own courthouse or offices (Bessemer, Alabama). Example: Bessemer Division of Jefferson County.","county_part":"The part of a county outside (or inside) certain cities, for a contest voted on only there. Example: Fayette County outside Somerville, Oakland, Piperton and Rossville.","court_district":"The district of a city, municipal or other local court. Example: Lafayette City Court.","court_of_appeal":"A state court of appeal circuit (Louisiana). Example: Louisiana 1st Circuit Court of Appeal.","court_of_appeal_district":"An election district within a court of appeal circuit. Example: 1st Circuit Court of Appeal, District 2.","court_of_appeals":"A state court of appeals district. Example: Fifteenth Court of Appeals District (statewide).","court_of_appeals_district":"A state court of appeals district. Example: Kentucky Court of Appeals District 3.","court_of_appeals_division":"A division of a state court of appeals. Example: Washington Court of Appeals Division 3.","district":"A seat or district of a local board or special district. Example: Beach Mosquito Control District, Seat 2.","district_attorney":"A district attorney’s district. Example: Berkshire District Attorney District.","district_attorney_district":"A district attorney’s district. Example: 17th Circuit Court District (District Attorney).","district_court":"A district court’s district. Example: Kittitas County District Court, Lower County.","district_court_district":"A district court’s district. Example: 14A District Court.","division":"A division (member district) of a special district. Example: Fallbrook Public Utility District Division 2.","educational_service_unit":"An educational service unit district (Nebraska). Example: Educational Service Unit 1 District 1.","election_district":"A county election district. Example: Montgomery County Election District 12 (Damascus).","emergency_services_district":"An emergency services district. Example: Wheeler County Emergency Services District No. 1.","ems_district":"An emergency medical services district. Example: Glendo Emergency Services District.","executive_council":"A district of New Hampshire’s Executive Council. Example: New Hampshire Executive Council District 1.","fire":"A fire protection district. Example: Sni Valley Fire Protection District.","fire_district":"A fire district. Example: Union Grove Volunteer Fire District 16.","fire_protection_district":"A fire protection district. Example: Newport Township Fire Protection District.","forest_preserve_district":"A forest preserve district (Illinois). Example: Forest Preserve District of DuPage County.","gid":"A general improvement district (Nevada). Example: Incline Village General Improvement District.","governors_council":"A district of the Massachusetts Governor’s Council. Example: Massachusetts Governor's Council District 1.","hospital_district":"A hospital district. Example: North Pine Area Hospital District.","judicial":"A judicial district or circuit. Example: Court of Appeal, First Appellate District.","judicial_circuit":"A judicial circuit. Example: 7th Judicial Circuit.","judicial_district":"A judicial district. Example: 207th Judicial District.","judicial_subcircuit":"A judicial subcircuit (Illinois). Example: DuPage County (18th Circuit) Judicial Subcircuit 4.","justice_court":"A justice court’s district. Example: Roy/Weber County Justice Court.","justice_court_district":"A justice court district. Example: Lauderdale County Justice Court District 2.","justice_precinct":"A justice of the peace precinct. Example: Travis County Justice of the Peace Precinct 1.","learning_community_subcouncil":"A subcouncil district of Nebraska’s Learning Community. Example: Learning Community of Douglas and Sarpy Counties Subcouncil 1.","legislative":"A legislative district (Nebraska’s one-house Legislature). Example: Nebraska Legislative District 2.","library_district":"A library district. Example: Vernon Area Public Library District.","magistrate":"A magistrate district. Example: Doña Ana County Magistrate District 1.","magistrate_district":"A magistrate or magisterial district. Example: Jefferson County Magisterial District 1.","mental_health_district":"A mental health services district. Example: Proposed Mid-Northside Expanded Mental Health Services Program territory.","municipality":"A whole municipality: a city, borough, town or village. Example: East Newark Borough.","natural_resources_district":"A natural resources district or subdistrict (Nebraska). Example: Papio-Missouri River NRD Subdistrict 2.","nursing_home":"A nursing home district. Example: Golden Age Nursing Home District.","park_district":"A park district. Example: Hennepin County Park District 1.","pec_district":"A Public Education Commission district (New Mexico). Example: Public Education Commission District 1.","place":"A whole city or town (a Census place). Example: City of Camp Verde.","port_district":"A port district. Example: Grant County Port Dist #4.","precinct":"A single voting precinct. Example: Chicago Ward 7, Precinct 13.","precinct_group":"A group of voting precincts. Example: Chicago Ward 7 Precinct 14 and Ward 10 Precincts 2 and 4.","probate_district":"A probate court district. Example: Tobacco Valley Probate District.","prosecutorial":"A prosecutorial district. Example: Prosecutorial District 1 (York County).","prosecutorial_district":"A prosecutorial district. Example: Prosecutorial District 17.","psc_district":"A public service commission district. Example: Montana Public Service Commission District 1.","public_power_district":"A public power district or subdivision (Nebraska). Example: Omaha Public Power District Subdivision 1.","public_service_commission":"A public service commission district. Example: Louisiana Public Service Commission District 1.","public_service_district":"A public service commission district. Example: Mississippi Central Public Service Commission District.","public_utility_district":"A public utility district. Example: Lincoln County Public Utility District.","quorum_court_district":"A quorum court district (Arkansas’s county legislature). Example: Pulaski County Quorum Court District 1.","reclamation_district":"A reclamation district or subdivision. Example: Twin Loups Reclamation District Subdivision 1.","regents_district":"A board of regents district. Example: Board of Regents District 2.","regional":"A region made of several counties or cities, for a regional measure. Example: Regional Transit Measure area (Alameda, Contra Costa, San Francisco, San Mateo, Santa Clara).","regional_office_of_education":"A regional office of education (Illinois). Example: Regional Office of Education 4 (Boone and Winnebago Counties).","registry_district":"A registry of deeds district. Example: Aroostook County Registry of Deeds, Northern District.","road":"A road district. Example: Stone County Northern Road District.","rtm_district":"A Representative Town Meeting district (Connecticut). Example: Darien RTM District 1.","sanitary_district":"A sanitary district. Example: East Joliet Sanitary District.","sboe":"A state board of education district. Example: Kansas State Board of Education District 10.","sboe_district":"A state board of education district. Example: Nevada State Board of Education District 1.","school":"A school district (or a whole district, for a district-wide seat). Example: San Francisco Unified School District.","school_board":"A school board member district. Example: Matanuska-Susitna Borough School District, School Board District 3.","school_board_district":"A school board member district. Example: Jefferson County Board of Education District 4.","school_district":"A whole school district. Example: Princeton Independent School District.","school_district_area":"A residence or trustee area of a school district. Example: LCSD 1 Residence Area 1.","school_subdistrict":"A school board subdistrict. Example: Omaha Public Schools Subdistrict 8.","school_tax_district":"A school tax or attendance district. Example: Odenville School Attendance and Tax District.","school_zone":"A school board zone. Example: Conway Public Schools Zone 3.","service_district":"A service district (senior citizens, recreation and the like). Example: Natrona County Senior Citizens Service District.","sewer_district":"A sewer district. Example: West Side Sewer District.","sldl":"A district of the lower house of the state legislature. Example: Arizona State House District 1.","sldu":"A district of the upper house (state senate). Example: Colorado State Senate District 10.","soil_conservation_district":"A soil conservation district. Example: Cass County Soil Conservation District.","soil_water_district":"A soil and water conservation district. Example: Aitkin County Soil and Water Conservation District.","special":"A special district: library, water, fire, park, transit and the like. Example: Altadena Library District.","special_district":"A special district. Example: Tarrant Appraisal District.","state":"A whole state. Example: Nevada.","state_board_of_education":"A state board of education district. Example: Texas State Board of Education District 2.","state_house":"A state house district (the lower house). Example: South Carolina House District 1.","state_lower":"A district of the lower house of the state legislature. Example: State Assembly District 17.","state_upper":"A district of the upper house (state senate). Example: State Senate District 2.","statewide":"A whole state. Example: California.","superior_court":"A superior court’s district. Example: Superior Court of Ferry, Pend Oreille and Stevens Counties.","superior_court_district":"A superior court district. Example: Superior Court District 17.","supervisorial":"A county (or city and county) supervisorial district. Example: Supervisorial District 2.","supreme_court_district":"A state supreme court district. Example: Kentucky Supreme Court District 3.","tax_district":"A tax district. Example: Fulton County outside the City of Atlanta.","town":"A whole town. Example: Town of Carmel.","township":"A township. Example: Pulaski County, Big Rock Township (Constable).","transit":"A transit district’s member district. Example: BART District 8.","transit_district":"A transit district or its director district. Example: RTD Director District B.","transportation_district":"A transportation district (a transportation benefit district, for example). Example: Chelan Transportation Benefit District.","trustee_area":"A trustee area of a school or college district. Example: Grossmont-Cuyamaca Community College District Trustee Area 5.","trustee_district":"A trustee district of a school district. Example: Austin ISD Trustee District 1.","tv_district":"A television district (Nevada’s TV translator districts). Example: Verdi Television District.","utility_district":"A utility district. Example: Horizon Regional MUD, Mountain Shadow Unit 1 Defined Area.","village":"A whole village. Example: Village of Brewster.","ward":"A city ward. Example: Little Rock Ward 1.","water":"A water supply district. Example: Stone County Public Water Supply District No. 1.","water_district":"A water district. Example: Lower Valley Water District.","water_reclamation_district":"A water reclamation district. Example: Metropolitan Water Reclamation District of Greater Chicago.","water_sewer_district":"A water and sewer district. Example: Jamestown/Rio Vista Water and Sewer District.","watershed_district":"A watershed district. Example: South Tyger River Watershed Conservation District."},"x-values":"district-type"},"state":{"type":["string","null"],"pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]},"partisanship":{"$ref":"#/components/schemas/DistrictPartisanship"},"demographics":{"description":"The latest American Community Survey 5-year estimates for the district; null where we have none (most local districts).","oneOf":[{"$ref":"#/components/schemas/DistrictDemographics"},{"type":"null"}]}}},"Office":{"type":"object","description":"What office a contest fills, worked out from its title and district.","required":["type","level","branch"],"properties":{"type":{"type":"string","description":"The office, normalized across states: us_representative, governor, state_senator, mayor, school_board, trial_court, sheriff, …","enum":["president","us_senator","us_representative","governor","lieutenant_governor","attorney_general","secretary_of_state","state_treasurer","state_auditor","state_superintendent","insurance_commissioner","agriculture_commissioner","land_commissioner","labor_commissioner","utility_commission","university_board","state_board_of_education","state_senator","state_representative","state_supreme_court","state_appellate_court","trial_court","municipal_court","magistrate","justice_of_the_peace","court_clerk","mayor","local_executive","city_council","county_legislature","neighborhood_council","school_board","school_superintendent","college_board","special_district_board","water_conservation_board","sheriff","prosecutor","coroner","constable","assessor","tax_collector","treasurer","auditor","recorder","clerk","surveyor","public_works","police_fire","other_county_office","other"],"x-enumDescriptions":{"president":"President of the United States (with the vice president on the same ticket).","us_senator":"U.S. Senator.","us_representative":"U.S. Representative, or a non-voting delegate to the House.","governor":"Governor.","lieutenant_governor":"Lieutenant governor.","attorney_general":"State attorney general.","secretary_of_state":"Secretary of state.","state_treasurer":"State treasurer.","state_auditor":"State auditor, comptroller or controller.","state_superintendent":"State superintendent of public instruction (the elected head of state schools).","insurance_commissioner":"State insurance commissioner.","agriculture_commissioner":"State agriculture commissioner.","land_commissioner":"State land commissioner (public lands).","labor_commissioner":"State labor commissioner.","utility_commission":"A state utility, public service or corporation commission seat.","university_board":"A state university board of regents or trustees seat.","state_board_of_education":"A state board of education seat.","state_senator":"State senator (the upper house of the legislature; Nebraska’s one-house Legislature too).","state_representative":"State representative, assemblymember or delegate (the lower house).","state_supreme_court":"A justice of the state’s highest court.","state_appellate_court":"A judge of a state intermediate appeals court.","trial_court":"A judge of a general trial court: superior, district, circuit, county or probate court.","municipal_court":"A city or municipal court judge.","magistrate":"A magistrate.","justice_of_the_peace":"A justice of the peace.","court_clerk":"Clerk of a court.","mayor":"Mayor.","local_executive":"Another elected local chief executive: county executive or judge-executive, borough or parish president, first selectman, town or township supervisor, village president.","city_council":"A city, town, village or borough council, select board or board of aldermen seat.","county_legislature":"A county commission, board of supervisors, county council, quorum or fiscal court, or police jury seat.","neighborhood_council":"A neighborhood body: Washington, D.C.’s Advisory Neighborhood Commissions, for example.","school_board":"A school board or board of education seat.","school_superintendent":"An elected county or district school superintendent.","college_board":"A community college district board seat.","special_district_board":"A board of a special district: hospital, fire, park, library, transit, port, utility and similar.","water_conservation_board":"A soil and water conservation, water, irrigation, drainage or flood control district board.","sheriff":"Sheriff.","prosecutor":"District attorney, state’s attorney, county attorney or solicitor.","coroner":"Coroner or medical examiner.","constable":"Constable (or town sergeant).","assessor":"Assessor, appraiser or property valuation administrator.","tax_collector":"Tax collector or tax commissioner.","treasurer":"A county, city or town treasurer.","auditor":"A county, city or town auditor, comptroller or controller.","recorder":"Recorder or register of deeds, wills or probate.","clerk":"A county, city or town clerk, prothonotary or registrar.","surveyor":"County surveyor or engineer.","public_works":"Highway, road or street commissioner, or a public works office.","police_fire":"An elected police chief, fire chief or marshal.","other_county_office":"Another county office: public defender, public administrator, jailer, election director and similar.","other":"An office that fits none of the types above."},"x-values":"office-type"},"level":{"type":"string","description":"Level of government the office belongs to (state courts are state, whatever district they sit in).","enum":["federal","state","local"],"x-enumDescriptions":{"federal":"A federal office: president, U.S. senator, U.S. representative.","state":"A statewide or state legislative office, or a state court judge (whatever district the court sits in).","local":"A county, city, town, school or special-district office."},"x-values":"office-level"},"branch":{"type":"string","description":"Branch of government.","enum":["executive","legislative","judicial"],"x-enumDescriptions":{"executive":"Runs government: president, governor, mayor, sheriff, clerk, treasurer and other officers.","legislative":"Makes laws or policy as a body: Congress, legislatures, councils, commissions and boards.","judicial":"A judge, justice, magistrate or justice of the peace."},"x-values":"office-branch"}}},"MeasureTopic":{"type":"object","required":["slug","name"],"properties":{"slug":{"type":"string","description":"Topic slug, for topics= filters.","examples":["housing"]},"name":{"type":"string","description":"The topic’s display name."}}},"NameParts":{"type":"object","description":"The candidate’s name in parts, split from the full name.","required":["given","middle","family","suffix","nickname"],"properties":{"given":{"type":["string","null"],"description":"Given (first) name."},"middle":{"type":["string","null"],"description":"Middle name(s) or initials."},"family":{"type":["string","null"],"description":"Family (last) name, with particles such as “de la” or “Van”."},"suffix":{"type":["string","null"],"description":"Jr., Sr., II, III, …"},"nickname":{"type":["string","null"],"description":"The name in quotes or parentheses on the ballot, e.g. “Bobby”."}}},"CandidateIds":{"type":"object","description":"Ids in other public systems.","required":["fec","bioguide"],"properties":{"fec":{"type":["string","null"],"description":"Federal Election Commission candidate id (U.S. House and Senate candidates).","examples":["H6CA12345"]},"bioguide":{"type":["string","null"],"description":"Congressional Biographical Directory id (sitting members of Congress).","examples":["D000123"]}}},"Contact":{"type":"object","description":"How to reach the candidate: website and social accounts from Wikidata (CC0), an incumbent’s official contacts (Open States, CC0), the campaign committee’s address from its FEC filing, what official candidate lists and state campaign-finance filings publish, and what the campaign publishes on its own site, each with its source. Empty where we have nothing yet.","required":["website","email","phone","mailing_address","social","sources"],"properties":{"website":{"type":["string","null"],"description":"Website, from Wikidata or (for an incumbent) the official site.","format":"uri"},"email":{"type":["string","null"],"description":"Email: an incumbent’s official address, or what the campaign publishes.","format":"email"},"phone":{"type":["string","null"],"description":"Phone: an incumbent’s office phone, or what the campaign publishes."},"mailing_address":{"type":["string","null"],"description":"Campaign committee mailing address, from its FEC filing."},"social":{"type":"object","description":"Social accounts, from Wikidata, an incumbent’s official accounts, or the campaign’s own website. Only keys we found are present.","required":[],"properties":{"facebook":{"type":"string","description":"Facebook page.","format":"uri"},"x":{"type":"string","description":"X (Twitter) account.","format":"uri"},"instagram":{"type":"string","description":"Instagram account.","format":"uri"},"youtube":{"type":"string","description":"YouTube channel.","format":"uri"},"linkedin":{"type":"string","description":"LinkedIn page.","format":"uri"},"tiktok":{"type":"string","description":"TikTok account.","format":"uri"},"threads":{"type":"string","description":"Threads account.","format":"uri"},"bluesky":{"type":"string","description":"Bluesky account.","format":"uri"}}},"sources":{"type":"array","description":"Where each contact detail came from.","items":{"type":"object","required":["url","kind","read_on"],"properties":{"url":{"type":"string","description":"Where we read it.","format":"uri"},"kind":{"type":"string","description":"wikidata, open_states (the official contacts of an incumbent), fec_filing, official_filing (a state, county or city candidate list or campaign-finance filing) or campaign_website.","enum":["wikidata","open_states","fec_filing","official_filing","campaign_website"],"x-enumDescriptions":{"wikidata":"Wikidata (CC0): website and social accounts.","open_states":"Open States (CC0): an incumbent’s official email, phone, website and social accounts.","fec_filing":"The campaign committee’s Federal Election Commission filing: its mailing address.","official_filing":"A state, county or city candidate list or campaign-finance filing.","campaign_website":"The campaign’s own website."},"x-values":"contact-source-kind"},"read_on":{"type":"string","description":"When we read it.","format":"date"}}}}}},"Finance":{"type":"object","description":"FEC campaign finance totals for one cycle (federal candidates).","required":["cycle","committee_id","receipts","disbursements","cash_on_hand","debts","individual_contributions","committee_contributions","party_contributions","candidate_contributions","candidate_loans","other_loans","cash_beginning","incumbent_challenger","coverage_end","source_url","individual_donors"],"properties":{"cycle":{"type":"integer","description":"Two-year FEC cycle, by its last year: 2026 = 2025–2026."},"committee_id":{"type":["string","null"],"description":"Principal campaign committee’s FEC id."},"receipts":{"type":"number","description":"Total receipts, dollars."},"disbursements":{"type":"number","description":"Total disbursements, dollars."},"cash_on_hand":{"type":"number","description":"Cash on hand at coverage_end, dollars."},"debts":{"type":"number","description":"Debts owed by the campaign, dollars."},"individual_contributions":{"type":["number","null"],"description":"Contributions from individuals, dollars."},"committee_contributions":{"type":["number","null"],"description":"Contributions from PACs and other political committees, dollars (House and Senate candidates)."},"party_contributions":{"type":["number","null"],"description":"Contributions from party committees, dollars (House and Senate candidates)."},"candidate_contributions":{"type":["number","null"],"description":"The candidate’s own contributions, dollars (House and Senate candidates)."},"candidate_loans":{"type":["number","null"],"description":"Loans from the candidate, dollars (House and Senate candidates)."},"other_loans":{"type":["number","null"],"description":"Other loans, dollars (House and Senate candidates)."},"cash_beginning":{"type":["number","null"],"description":"Cash on hand at the start of the cycle, dollars (House and Senate candidates)."},"incumbent_challenger":{"type":["string","null"],"description":"The FEC’s incumbent, challenger or open seat status for the cycle: I, C or O.","enum":["I","C","O",null],"x-enumDescriptions":{"I":"Incumbent.","C":"Challenger.","O":"Open seat."},"x-values":"fec-incumbent-challenger"},"coverage_end":{"type":["string","null"],"description":"The date the totals run through.","format":"date"},"source_url":{"type":"string","description":"The FEC page for these totals.","format":"uri"},"individual_donors":{"description":"What individuals gave, from the FEC’s file of individual contributions: totals only. Null where not loaded (2026 and 2024 cycles).","oneOf":[{"$ref":"#/components/schemas/IndividualDonors"},{"type":"null"}]}}},"OutsideSpendingBySpender":{"type":"object","description":"One spender’s spending for or against the candidate in one cycle, of one kind.","required":["kind","committee_id","committee_name","support_oppose","amount","items","first_date","last_date","source_url","endorsers"],"properties":{"kind":{"type":"string","description":"independent_expenditure or communication_cost.","enum":["independent_expenditure","communication_cost"],"x-enumDescriptions":{"independent_expenditure":"An independent expenditure: spending that expressly calls for a candidate’s election or defeat, made without the campaign, from the 24- and 48-hour notices the spender files with the FEC within a day or two of the communication going out.","communication_cost":"A communication cost: what a corporation or union spent on messages to its own members, executives or stockholders for or against the candidate, from its FEC Form 7."},"x-values":"outside-spending-kind"},"committee_id":{"type":"string","description":"The spender’s FEC committee id.","pattern":"^C[0-9]{8}$"},"committee_name":{"type":["string","null"],"description":"The spender’s name as it filed."},"support_oppose":{"type":"string","description":"support or oppose, as the spender reported it.","enum":["support","oppose"],"x-enumDescriptions":{"support":"The spending was for the candidate, as the filer reported it.","oppose":"The spending was against the candidate, as the filer reported it."},"x-values":"support-oppose"},"amount":{"type":"number","description":"Total, dollars, added up the way the FEC does: every item on the spender’s regular reports, plus 24- and 48-hour notices dated after its latest report. Notices can be estimates that later reports correct."},"items":{"type":"integer","description":"How many items make up amount."},"first_date":{"type":["string","null"],"description":"Earliest item: the day the communication went out (or, without that, the day it was paid); for a communication cost, its transaction date.","format":"date"},"last_date":{"type":["string","null"],"description":"Latest item, the same way.","format":"date"},"source_url":{"type":"string","description":"The FEC filing of the latest item.","format":"uri"},"endorsers":{"type":"array","description":"Our endorsers this committee belongs to (their fec_committees). Empty for most spenders.","items":{"type":"object","required":["slug","name"],"properties":{"slug":{"type":"string","description":"Endorser slug."},"name":{"type":"string","description":"Endorser name."}}}}}},"OutsideSpendingByCandidate":{"type":"object","description":"The endorser’s spending for or against one federal candidate in one cycle, of one kind.","required":["kind","committee_id","support_oppose","fec_candidate_id","candidate_name","office","state","district","candidate_ids","amount","items","first_date","last_date","source_url"],"properties":{"kind":{"type":"string","description":"independent_expenditure or communication_cost.","enum":["independent_expenditure","communication_cost"],"x-enumDescriptions":{"independent_expenditure":"An independent expenditure: spending that expressly calls for a candidate’s election or defeat, made without the campaign, from the 24- and 48-hour notices the spender files with the FEC within a day or two of the communication going out.","communication_cost":"A communication cost: what a corporation or union spent on messages to its own members, executives or stockholders for or against the candidate, from its FEC Form 7."},"x-values":"outside-spending-kind"},"committee_id":{"type":"string","description":"Which of the endorser’s FEC committees spent it.","pattern":"^C[0-9]{8}$"},"support_oppose":{"type":"string","description":"support or oppose, as the spender reported it.","enum":["support","oppose"],"x-enumDescriptions":{"support":"The spending was for the candidate, as the filer reported it.","oppose":"The spending was against the candidate, as the filer reported it."},"x-values":"support-oppose"},"fec_candidate_id":{"type":["string","null"],"description":"The candidate’s FEC id; null when the filer gave none.","pattern":"^[HSP][0-9A-Z]{8}$"},"candidate_name":{"type":["string","null"],"description":"The candidate’s name as the filer wrote it."},"office":{"type":["string","null"],"description":"H, S or P, as filed.","enum":["H","S","P",null],"x-enumDescriptions":{"H":"U.S. House.","S":"U.S. Senate.","P":"President."},"x-values":"fec-office"},"state":{"type":["string","null"],"description":"The race’s state, as filed."},"district":{"type":["string","null"],"description":"The House district, two digits (00 at large), as filed."},"candidate_ids":{"type":"array","description":"Our candidate records with this FEC id (GET /v1/candidates/{id}); empty when we have none.","items":{"type":"integer","description":"Candidate id."}},"amount":{"type":"number","description":"Total, dollars: regular-report items plus notices dated after the latest report, as the FEC adds them up."},"items":{"type":"integer","description":"How many items make up amount."},"first_date":{"type":["string","null"],"description":"Earliest item’s date (the day the communication went out, or paid; transaction date for a communication cost).","format":"date"},"last_date":{"type":["string","null"],"description":"Latest item’s date, the same way.","format":"date"},"source_url":{"type":"string","description":"The FEC filing of the latest item.","format":"uri"}}},"CandidateOutsideSpending":{"type":"object","description":"Outside spending for and against a federal candidate in one cycle: FEC independent expenditures (regular reports and 24- and 48-hour notices) and communication costs. Not endorsements.","required":["cycle","support_total","oppose_total","items"],"properties":{"cycle":{"type":"integer","description":"Two-year FEC cycle, by its last year: 2026 = 2025–2026."},"support_total":{"type":"number","description":"All spending for the candidate this cycle, both kinds, dollars."},"oppose_total":{"type":"number","description":"All spending against the candidate this cycle, both kinds, dollars."},"items":{"type":"array","description":"By spender, kind and side, largest first.","items":{"$ref":"#/components/schemas/OutsideSpendingBySpender"}}}},"EndorserOutsideSpending":{"type":"object","description":"What an endorser’s FEC committees spent for and against federal candidates in one cycle: independent expenditures and communication costs. Not endorsements.","required":["cycle","support_total","oppose_total","items"],"properties":{"cycle":{"type":"integer","description":"Two-year FEC cycle, by its last year: 2026 = 2025–2026."},"support_total":{"type":"number","description":"All the endorser’s spending for candidates this cycle, dollars."},"oppose_total":{"type":"number","description":"All the endorser’s spending against candidates this cycle, dollars."},"items":{"type":"array","description":"By candidate, kind and side, largest first.","items":{"$ref":"#/components/schemas/OutsideSpendingByCandidate"}}}},"Spending":{"type":"object","description":"What a federal campaign spent money on in one cycle: its operating expenditures from FEC reports, by category.","required":["cycle","committee_ids","total","payments","first_on","last_on","categories","top_payees","source_name","retrieved_on","source_url"],"properties":{"cycle":{"type":"integer","description":"Two-year FEC cycle, by its last year: 2026 = 2025–2026. 2024 and 2026 are loaded; pick a cycle by this field."},"committee_ids":{"type":"array","description":"The principal campaign committees (FEC ids) whose payments these are; usually one.","items":{"type":"string"}},"total":{"type":"number","description":"Operating expenditures itemized on the committee’s FEC reports, dollars. Payments of $200 or less to one payee in a year needn’t be itemized, so this can run slightly under the FEC’s total."},"payments":{"type":"integer","description":"Itemized payments counted (a split credit card bill or payroll run counts each of its entries)."},"first_on":{"type":["string","null"],"description":"The earliest payment date.","format":"date"},"last_on":{"type":["string","null"],"description":"The latest payment date. The FEC’s file reaches the latest report it has processed, so later spending may be missing.","format":"date"},"categories":{"type":"array","description":"Spending by category, largest first.","items":{"$ref":"#/components/schemas/SpendingCategory"}},"top_payees":{"type":"array","description":"The ten businesses and organizations paid the most, largest first. Individuals (staff and reimbursed people) are never listed.","items":{"$ref":"#/components/schemas/SpendingPayee"}},"source_name":{"type":"string","description":"The FEC file the payments come from."},"retrieved_on":{"type":"string","description":"The day we read the file.","format":"date"},"source_url":{"type":"string","description":"The FEC’s list of these payments.","format":"uri"}}},"SpendingCategory":{"type":"object","description":"One category of a campaign’s spending.","required":["category","amount","payments"],"properties":{"category":{"type":"string","description":"Spending category.","enum":["advertising","fundraising","consulting","staff","mail_printing","texts_calls","polling_research","processing_fees","compliance_legal","field_events","travel","office_admin","contributions","pass_through","other"],"x-enumDescriptions":{"advertising":"Advertising and media: TV, radio and digital ads, media buys and ad production.","fundraising":"Fundraising: fundraising consultants, list acquisition and digital fundraising.","consulting":"Strategy and campaign consulting, communications and campaign management.","staff":"Staff pay, payroll taxes and benefits.","mail_printing":"Mail, printing and campaign materials: postage, mailers, signs and merchandise.","texts_calls":"Texts, calls and other voter contact.","polling_research":"Polling and research: surveys, research and voter files.","processing_fees":"Payment processing and bank fees, including the fees of online donation platforms.","compliance_legal":"Legal, compliance, accounting, ballot access and filing fees.","field_events":"Field work, canvassing and events.","travel":"Travel, lodging and meals.","office_admin":"Office, software and administration: rent, phones, insurance, security and taxes other than payroll.","contributions":"Contributions and donations to candidates, committees and charities.","pass_through":"Credit card bills and reimbursements the campaign didn’t break down into what they paid for.","other":"Anything else, or a payment with no purpose given."},"x-values":"spending-category"},"amount":{"type":"number","description":"Dollars spent."},"payments":{"type":"integer","description":"Itemized payments."}}},"SpendingPayee":{"type":"object","description":"A business or organization a campaign paid.","required":["name","state","category","amount","payments"],"properties":{"name":{"type":"string","description":"The payee’s name as the campaign filed it."},"state":{"type":["string","null"],"description":"The payee’s state as filed."},"category":{"type":"string","description":"The category of the largest payment to this payee.","enum":["advertising","fundraising","consulting","staff","mail_printing","texts_calls","polling_research","processing_fees","compliance_legal","field_events","travel","office_admin","contributions","pass_through","other"],"x-enumDescriptions":{"advertising":"Advertising and media: TV, radio and digital ads, media buys and ad production.","fundraising":"Fundraising: fundraising consultants, list acquisition and digital fundraising.","consulting":"Strategy and campaign consulting, communications and campaign management.","staff":"Staff pay, payroll taxes and benefits.","mail_printing":"Mail, printing and campaign materials: postage, mailers, signs and merchandise.","texts_calls":"Texts, calls and other voter contact.","polling_research":"Polling and research: surveys, research and voter files.","processing_fees":"Payment processing and bank fees, including the fees of online donation platforms.","compliance_legal":"Legal, compliance, accounting, ballot access and filing fees.","field_events":"Field work, canvassing and events.","travel":"Travel, lodging and meals.","office_admin":"Office, software and administration: rent, phones, insurance, security and taxes other than payroll.","contributions":"Contributions and donations to candidates, committees and charities.","pass_through":"Credit card bills and reimbursements the campaign didn’t break down into what they paid for.","other":"Anything else, or a payment with no purpose given."},"x-values":"spending-category"},"amount":{"type":"number","description":"Dollars paid in the cycle."},"payments":{"type":"integer","description":"Itemized payments."}}},"CommitteeFinance":{"type":"object","description":"A committee’s FEC totals for one cycle, from the FEC’s PAC and party summary file. Only PACs and party committees have them; candidates’ campaign totals are in the candidate’s finance.","required":["cycle","receipts","individual_contributions","committee_contributions","transfers_from_affiliates","disbursements","contributions_to_committees","independent_expenditures","coordinated_expenditures","transfers_to_affiliates","cash_beginning","cash_on_hand","debts","coverage_end","source_url"],"properties":{"cycle":{"type":"integer","description":"Two-year FEC cycle, by its last year: 2026 = 2025–2026."},"receipts":{"type":["number","null"],"description":"Total receipts, dollars."},"individual_contributions":{"type":["number","null"],"description":"Contributions from individuals, dollars."},"committee_contributions":{"type":["number","null"],"description":"Contributions from other political committees, dollars."},"transfers_from_affiliates":{"type":["number","null"],"description":"Transfers from affiliated committees, dollars."},"disbursements":{"type":["number","null"],"description":"Total disbursements, dollars."},"contributions_to_committees":{"type":["number","null"],"description":"Contributions to candidates’ and other committees, dollars."},"independent_expenditures":{"type":["number","null"],"description":"Independent expenditures (spending for or against candidates, not coordinated with them), dollars."},"coordinated_expenditures":{"type":["number","null"],"description":"Party coordinated expenditures, dollars."},"transfers_to_affiliates":{"type":["number","null"],"description":"Transfers to affiliated committees, dollars."},"cash_beginning":{"type":["number","null"],"description":"Cash on hand at the start of the cycle, dollars."},"cash_on_hand":{"type":["number","null"],"description":"Cash on hand at coverage_end, dollars."},"debts":{"type":["number","null"],"description":"Debts owed by the committee, dollars."},"coverage_end":{"type":["string","null"],"description":"The date the totals run through.","format":"date"},"source_url":{"type":"string","description":"The FEC page for this committee.","format":"uri"}}},"FecCommittee":{"type":"object","description":"A political committee registered with the FEC, from its committee master file.","required":["id","name","committee_type","designation","organization_type","party","connected_organization","sponsor_candidate_id","state","cycles","url","finance"],"properties":{"id":{"type":"string","description":"FEC committee id (C########)."},"name":{"type":"string","description":"Committee name as filed."},"committee_type":{"type":["string","null"],"description":"FEC committee type code.","enum":["C","D","E","H","I","N","O","P","Q","S","U","V","W","X","Y","Z",null],"x-enumDescriptions":{"C":"Communication cost filer: a corporation or union reporting what it spent telling its members or shareholders to vote for or against a candidate.","D":"Delegate committee.","E":"Electioneering communication filer.","H":"House candidate’s campaign committee.","I":"Independent expenditure filer that is not a committee (a person or group).","N":"PAC, nonqualified (fewer than 50 contributors or less than six months registered).","O":"Super PAC (independent expenditure-only political committee).","P":"Presidential candidate’s campaign committee.","Q":"PAC, qualified.","S":"Senate candidate’s campaign committee.","U":"Single-candidate independent expenditure committee.","V":"Hybrid PAC with a non-contribution account, nonqualified.","W":"Hybrid PAC with a non-contribution account, qualified.","X":"Party committee, nonqualified.","Y":"Party committee, qualified.","Z":"National party nonfederal account."},"x-values":"fec-committee-type"},"designation":{"type":["string","null"],"description":"FEC committee designation code.","enum":["A","B","D","J","P","U",null],"x-enumDescriptions":{"A":"Authorized by a candidate.","B":"Lobbyist or registrant PAC.","D":"Leadership PAC: a PAC a member of Congress or other officeholder sponsors.","J":"Joint fundraising committee.","P":"A candidate’s principal campaign committee.","U":"Unauthorized: not a candidate’s committee."},"x-values":"fec-designation"},"organization_type":{"type":["string","null"],"description":"For a PAC with a sponsor, the sponsor’s kind.","enum":["C","L","M","T","V","W",null],"x-enumDescriptions":{"C":"Corporation.","L":"Labor organization.","M":"Membership organization.","T":"Trade association.","V":"Cooperative.","W":"Corporation without capital stock."},"x-values":"fec-organization-type"},"party":{"type":["string","null"],"description":"Party affiliation as filed, e.g. DEM, REP."},"connected_organization":{"type":["string","null"],"description":"The organization that sponsors the committee, as filed."},"sponsor_candidate_id":{"type":["string","null"],"description":"The candidate (FEC candidate id) the committee is authorized by or, for a leadership PAC, sponsored by."},"state":{"type":["string","null"],"description":"State of the committee’s address."},"cycles":{"type":"array","description":"Cycles whose FEC committee master lists it.","items":{"type":"integer"}},"url":{"type":"string","description":"The FEC page for this committee.","format":"uri"},"finance":{"type":"array","description":"FEC totals, newest cycle first; empty for campaign committees (see the candidate’s finance) and committees that haven’t filed.","items":{"$ref":"#/components/schemas/CommitteeFinance"}}}},"EndorserCommittee":{"allOf":[{"type":"object","required":["basis"],"properties":{"basis":{"type":"string","description":"How the committee belongs to the endorser.","enum":["fec_id","sponsor"],"x-enumDescriptions":{"fec_id":"The endorser is this committee: matched to the FEC committee master file by name (see facts.fec_committee_ids).","sponsor":"The committee names the endorser as its connected (sponsoring) organization, matched by exact name."},"x-values":"fec-committee-basis"}}},{"$ref":"#/components/schemas/FecCommittee"}],"description":"One of an endorser’s FEC committees."},"CandidateCommittee":{"allOf":[{"type":"object","required":["role"],"properties":{"role":{"type":"string","description":"The committee’s role for the candidate.","enum":["principal","authorized","joint_fundraising","leadership_pac","other"],"x-enumDescriptions":{"principal":"The candidate’s principal campaign committee.","authorized":"Another committee the candidate authorized.","joint_fundraising":"A joint fundraising committee the candidate takes part in.","leadership_pac":"A leadership PAC the candidate sponsors.","other":"Another committee the FEC links to the candidate."},"x-values":"fec-committee-role"}}},{"$ref":"#/components/schemas/FecCommittee"}],"description":"One of a candidate’s FEC committees."},"CommitteeRef":{"type":"object","description":"A political committee that gave to candidates.","required":["fec_committee_id","name","committee_type","connected_organization","endorser"],"properties":{"fec_committee_id":{"type":"string","description":"The committee’s FEC id.","pattern":"^C[0-9]{8}$"},"name":{"type":["string","null"],"description":"The committee’s registered name, from the FEC committee master file."},"committee_type":{"type":["string","null"],"description":"The FEC committee type: Q or N for a PAC, X or Y for a party, H, S or P for a candidate’s campaign, and so on.","enum":["C","D","E","H","I","N","O","P","Q","S","U","V","W","X","Y","Z",null],"x-enumDescriptions":{"C":"Communication cost filer: a corporation or union reporting what it spent telling its members or shareholders to vote for or against a candidate.","D":"Delegate committee.","E":"Electioneering communication filer.","H":"House candidate’s campaign committee.","I":"Independent expenditure filer that is not a committee (a person or group).","N":"PAC, nonqualified (fewer than 50 contributors or less than six months registered).","O":"Super PAC (independent expenditure-only political committee).","P":"Presidential candidate’s campaign committee.","Q":"PAC, qualified.","S":"Senate candidate’s campaign committee.","U":"Single-candidate independent expenditure committee.","V":"Hybrid PAC with a non-contribution account, nonqualified.","W":"Hybrid PAC with a non-contribution account, qualified.","X":"Party committee, nonqualified.","Y":"Party committee, qualified.","Z":"National party nonfederal account."},"x-values":"fec-committee-type"},"connected_organization":{"type":["string","null"],"description":"The organization that sponsors the committee, as filed (a company, union or association)."},"endorser":{"description":"The endorser this committee is, or that sponsors it (GET /v1/endorsers/{slug}); null if none of ours.","oneOf":[{"type":"object","required":["slug","name"],"properties":{"slug":{"type":"string","description":"Endorser slug."},"name":{"type":"string","description":"Endorser name."}}},{"type":"null"}]}}},"CommitteeContributionsReceived":{"type":"object","description":"What PACs, parties and other committees gave a federal candidate in one cycle (FEC).","required":["cycle","total","contribution_count","committee_count","by_type","top_committees","source_url"],"properties":{"cycle":{"type":"integer","description":"Two-year FEC cycle, by its last year: 2026 = 2025–2026."},"total":{"type":"number","description":"Net dollars from committees (refunds subtracted)."},"contribution_count":{"type":"integer","description":"Contributions counted."},"committee_count":{"type":"integer","description":"Committees that gave."},"by_type":{"type":"object","description":"The total by contribution type.","required":["contribution","in_kind","coordinated_expenditure"],"properties":{"contribution":{"type":"number","description":"Money given to the campaign, dollars."},"in_kind":{"type":"number","description":"Goods and services given, dollars."},"coordinated_expenditure":{"type":"number","description":"Party spending coordinated with the candidate, dollars."}}},"top_committees":{"type":"array","description":"The ten committees that gave the most, largest first. GET /v1/committee-contributions?candidates={id} has every one.","items":{"type":"object","required":["committee","total","contribution_count"],"properties":{"committee":{"$ref":"#/components/schemas/CommitteeRef"},"total":{"type":"number","description":"Net dollars from this committee."},"contribution_count":{"type":"integer","description":"Contributions from this committee."}}}},"source_url":{"type":"string","description":"The candidate’s FEC page for the cycle.","format":"uri"}}},"CommitteeContributionsGiven":{"type":"object","description":"What an endorser’s political committees gave federal candidates in one cycle (FEC).","required":["cycle","total","contribution_count","candidate_count","committees","top_candidates"],"properties":{"cycle":{"type":"integer","description":"Two-year FEC cycle, by its last year: 2026 = 2025–2026."},"total":{"type":"number","description":"Net dollars the endorser’s committees gave federal candidates (refunds subtracted), to every candidate, not only those you can read."},"contribution_count":{"type":"integer","description":"Contributions counted."},"candidate_count":{"type":"integer","description":"Federal candidates they gave to."},"committees":{"type":"array","description":"FEC ids of the endorser’s committees that gave: its own, and PACs it sponsors.","items":{"type":"string","pattern":"^C[0-9]{8}$"}},"top_candidates":{"type":"array","description":"The ten candidates who got the most, largest first.","items":{"type":"object","required":["fec_candidate_id","fec_name","candidate","total","contribution_count"],"properties":{"fec_candidate_id":{"type":"string","description":"The candidate’s FEC id."},"fec_name":{"type":["string","null"],"description":"The candidate’s name as the FEC lists it: LAST, FIRST."},"candidate":{"description":"The candidate (GET /v1/candidates/{id}), if they’re on a contest you can read; null otherwise.","oneOf":[{"type":"object","required":["id","full_name"],"properties":{"id":{"type":"integer","description":"Candidate id."},"full_name":{"type":"string","description":"Full name."}}},{"type":"null"}]},"total":{"type":"number","description":"Net dollars to this candidate."},"contribution_count":{"type":"integer","description":"Contributions to this candidate."}}}}}},"CommitteeContribution":{"type":"object","description":"One contribution from a political committee to a federal candidate, as filed with the FEC.","required":["id","cycle","type","transaction_type","amount","date","election","committee","candidate","recipient_committee_id","report_type","source_url"],"properties":{"id":{"type":"string","description":"The FEC’s id for this line of the filing (SUB_ID), as text: it is too long for some languages’ numbers."},"cycle":{"type":"integer","description":"Two-year FEC cycle, by its last year: 2026 = 2025–2026."},"type":{"type":"string","description":"contribution (money), in_kind (goods and services) or coordinated_expenditure (party spending coordinated with the candidate).","enum":["contribution","in_kind","coordinated_expenditure"],"x-enumDescriptions":{"contribution":"Money a committee gave the candidate’s campaign (FEC transaction type 24K).","in_kind":"Goods or services a committee gave the campaign, at their value (24Z).","coordinated_expenditure":"Money a party committee spent in coordination with the candidate, such as on ads (24C)."},"x-values":"contribution-type"},"transaction_type":{"type":"string","description":"The FEC transaction type: 24K, 24Z or 24C."},"amount":{"type":"number","description":"Dollars; negative for a refund."},"date":{"type":["string","null"],"description":"When it was given, as reported.","format":"date"},"election":{"description":"The election it counts toward, as reported; null where the filing left it out.","oneOf":[{"type":"object","required":["stage","year"],"properties":{"stage":{"type":"string","description":"Which election it counts toward.","enum":["primary","general","runoff","special","convention","recount","other"],"x-enumDescriptions":{"primary":"For the primary.","general":"For the general election.","runoff":"For a runoff.","special":"For a special election.","convention":"For a nominating convention.","recount":"For a recount.","other":"Another election the filer named."},"x-values":"contribution-election-stage"},"year":{"type":"integer","description":"That election’s year."}}},{"type":"null"}]},"committee":{"$ref":"#/components/schemas/CommitteeRef"},"candidate":{"type":"object","description":"The candidate (GET /v1/candidates/{id}).","required":["id","full_name","fec_candidate_id"],"properties":{"id":{"type":"integer","description":"Candidate id."},"full_name":{"type":"string","description":"Full name."},"fec_candidate_id":{"type":"string","description":"The candidate’s FEC id."}}},"recipient_committee_id":{"type":["string","null"],"description":"The FEC id of the committee that received it, usually the candidate’s campaign."},"report_type":{"type":["string","null"],"description":"The FEC report it was on: Q1, M10, 12G, YE and so on."},"source_url":{"type":["string","null"],"description":"The page of the filing it is on, at the FEC.","format":"uri"}}},"IndividualDonors":{"type":"object","description":"Totals of the individual contributions to a federal candidate’s campaign committees in one cycle, from the FEC’s bulk file of contributions by individuals (joint fundraising committees not counted, as in the FEC’s own totals). Federal law bars using contributors’ names for commercial purposes, so we keep only totals: no names, addresses, employers or occupations.","required":["itemized","itemized_contributions","itemized_donors","itemized_reported","itemized_through","unitemized","refunds","in_state","out_of_state","unknown_state","by_size","by_state","by_occupation","by_month","reported_through","file_date","source_url"],"properties":{"itemized":{"type":"number","description":"Itemized contributions from individuals, dollars: from donors who gave more than $200 in the cycle, plus gifts through ActBlue or WinRed, which are itemized at any size."},"itemized_contributions":{"type":"integer","description":"How many itemized contributions."},"itemized_donors":{"type":"integer","description":"Distinct itemized donors (same name and ZIP code; names are never stored)."},"itemized_reported":{"type":"number","description":"The itemized total on the campaign’s reports, dollars. The FEC adds a report’s itemized rows to its bulk file weeks after the report’s totals, so itemized (and every breakdown) can run short of this until it catches up."},"itemized_through":{"type":["string","null"],"description":"The latest contribution date among the itemized rows the breakdowns count.","format":"date"},"unitemized":{"type":"number","description":"Unitemized contributions, dollars: small gifts the campaign reports only as a sum, with no donor, state or count."},"refunds":{"type":"number","description":"Contributions refunded to individuals, dollars."},"in_state":{"type":"object","description":"Itemized contributions from donors in the candidate’s state. Zero for presidential candidates, who have no home state (see by_state).","required":["amount","donors"],"properties":{"amount":{"type":"number","description":"Itemized dollars from donors whose address is in the candidate’s state."},"donors":{"type":"integer","description":"Itemized donors whose address is in the candidate’s state."}}},"out_of_state":{"type":"object","description":"Itemized contributions from donors in other states. Zero for presidential candidates.","required":["amount","donors"],"properties":{"amount":{"type":"number","description":"Itemized dollars from donors whose address is in another state."},"donors":{"type":"integer","description":"Itemized donors whose address is in another state."}}},"unknown_state":{"type":"number","description":"Itemized contributions with no state given, dollars."},"by_size":{"type":"array","description":"Itemized donors by how much each gave in total, smallest band first.","items":{"type":"object","required":["band","amount","contributions","donors"],"properties":{"band":{"type":"string","description":"Donor size band, by the donor’s total to the candidate in the cycle.","enum":["200_or_less","200_to_1000","1000_to_3500","over_3500"],"x-enumDescriptions":{"200_or_less":"Itemized donors who gave the candidate $200 or less in the cycle (most such gifts are unitemized and counted only in unitemized).","200_to_1000":"Donors who gave more than $200 and up to $1,000.","1000_to_3500":"Donors who gave more than $1,000 and up to $3,500, the 2025-2026 limit per election.","over_3500":"Donors who gave more than $3,500: gifts for both the primary and the general election."},"x-values":"donor-size-band"},"amount":{"type":"number","description":"What the donors in this band gave in total, dollars."},"contributions":{"type":"integer","description":"How many contributions those donors made."},"donors":{"type":"integer","description":"How many donors fall in this band."}}}},"by_state":{"type":"array","description":"Itemized contributions by the donor’s state, largest first.","items":{"type":"object","required":["state","amount","contributions","donors"],"properties":{"state":{"type":"string","description":"USPS state code of the donor’s address, or unknown."},"amount":{"type":"number","description":"Itemized dollars from donors in this state."},"contributions":{"type":"integer","description":"Itemized contributions from this state."},"donors":{"type":"integer","description":"Itemized donors in this state (by the address on their first gift)."}}}},"by_occupation":{"type":"array","description":"Itemized contributions by the donor’s occupation group, largest first.","items":{"type":"object","required":["group","amount","contributions","donors"],"properties":{"group":{"type":"string","description":"Occupation group, from the occupation and employer donors state.","enum":["retired","not_employed","homemaker","student","legal","health","education","finance","real_estate","technology","government","clergy_nonprofit","agriculture","construction_trades","arts_media","business","other","not_reported"],"x-enumDescriptions":{"retired":"Retired.","not_employed":"Not employed.","homemaker":"Homemaker.","student":"Student.","legal":"Lawyers, judges and legal work.","health":"Doctors, nurses and other health work.","education":"Teachers, professors and schools.","finance":"Banking, investment, insurance and accounting.","real_estate":"Real estate and mortgages.","technology":"Software, engineering and technology.","government":"Government, the military and public safety.","clergy_nonprofit":"Clergy, nonprofits and social work.","agriculture":"Farming and ranching.","construction_trades":"Construction, building trades and transport.","arts_media":"Writers, artists, media and entertainment.","business":"Owners, executives, managers, sales and consultants not in a group above.","other":"Any other stated occupation.","not_reported":"No occupation or employer given, or “information requested”."},"x-values":"donor-occupation-group"},"amount":{"type":"number","description":"Itemized dollars from donors in this group."},"contributions":{"type":"integer","description":"Itemized contributions from this group."},"donors":{"type":"integer","description":"Itemized donors in this group (by the occupation on their first gift)."}}}},"by_month":{"type":"array","description":"Itemized contributions by month, oldest first.","items":{"type":"object","required":["month","amount","contributions","donors"],"properties":{"month":{"type":"string","description":"YYYY-MM of the contribution date, or unknown."},"amount":{"type":"number","description":"Itemized dollars given that month."},"contributions":{"type":"integer","description":"Itemized contributions made that month."},"donors":{"type":["integer","null"],"description":"Not counted by month: always null."}}}},"reported_through":{"type":["string","null"],"description":"The date the campaign’s reports (itemized_reported, unitemized) run through.","format":"date"},"file_date":{"type":"string","description":"The date of the FEC bulk file read.","format":"date"},"source_url":{"type":"string","description":"The FEC bulk file these totals come from.","format":"uri"}}},"Candidate":{"type":"object","required":["id","full_name","name","website_url","photo_url","ids","contact"],"properties":{"id":{"type":"integer","description":"Candidate id."},"full_name":{"type":"string","description":"Full name."},"name":{"$ref":"#/components/schemas/NameParts"},"website_url":{"type":["string","null"],"description":"Campaign website.","format":"uri"},"photo_url":{"type":["string","null"],"description":"A photo of the candidate.","format":"uri"},"ids":{"$ref":"#/components/schemas/CandidateIds"},"contact":{"$ref":"#/components/schemas/Contact"}}},"PartyLine":{"type":"object","description":"One party line a candidate is printed on. Candidates on one line have an empty party_lines.","required":["order","party","label","votes"],"properties":{"order":{"type":"integer","description":"1 for the line printed first (usually the candidate’s own party), then 2, 3…"},"party":{"description":"The party, where we have a party record for the line.","oneOf":[{"$ref":"#/components/schemas/Party"},{"type":"null"}]},"label":{"type":"string","description":"The line as printed: “Working Families”, “Conservative”."},"votes":{"type":["integer","null"],"description":"Votes cast on this line, where the source reports lines separately; null otherwise. The choice’s result.votes is all lines added up."}}},"Candidacy":{"type":"object","description":"Someone in a race who isn’t a line on the printed ballot: declared but not qualified, withdrew before printing, disqualified, or a write-in.","required":["id","name","candidate_id","party","party_label","status","write_in","status_date","votes","winner","note","source"],"properties":{"id":{"type":"integer","description":"Candidacy id."},"name":{"type":"string","description":"The name as the source gives it."},"candidate_id":{"type":["integer","null"],"description":"The candidate record (GET /v1/candidates/{id}), where they have one."},"party":{"description":"Their party, where the source gives one.","oneOf":[{"$ref":"#/components/schemas/Party"},{"type":"null"}]},"party_label":{"type":["string","null"],"description":"The party text as the source gives it, where it differs."},"status":{"type":"string","description":"Where the candidacy stands.","enum":["declared","withdrew","disqualified","qualified"],"x-enumDescriptions":{"declared":"Announced or filed, but hasn’t qualified for the ballot (yet).","withdrew":"Withdrew before the ballot was printed, so the name isn’t on it. (A candidate who withdrew too late to come off is a Choice with status withdrew_still_on_ballot.)","disqualified":"Removed by an election office or a court: didn’t qualify, failed a challenge, or isn’t eligible.","qualified":"A write-in candidate whose write-in votes will be counted by name (filed what the state requires). Always has write_in true."},"x-values":"candidacy-status"},"write_in":{"type":"boolean","description":"A write-in campaign."},"status_date":{"type":["string","null"],"description":"When they declared, withdrew, were disqualified or qualified, where the source says.","format":"date"},"votes":{"type":["integer","null"],"description":"Write-in votes counted for them, where the official result counts them by name."},"winner":{"type":["boolean","null"],"description":"For a write-in: true if they won. null when not decided or not stated."},"note":{"type":["string","null"],"description":"Anything else the source says, such as the reason for a disqualification."},"source":{"description":"The official list or notice it comes from.","oneOf":[{"type":"object","required":["name","url","read_on"],"properties":{"name":{"type":["string","null"],"description":"Who published it: the election office or court."},"url":{"type":"string","description":"The official list, notice or ruling.","format":"uri"},"read_on":{"type":["string","null"],"description":"When we read it.","format":"date"}}},{"type":"null"}]}}},"PartyChange":{"type":"object","description":"A party switch.","required":["on","after","from","to","basis","prior_contest_id","contest_id","source","note"],"properties":{"on":{"type":"string","description":"announced: the day of the switch. ballot: the first election they ran in under the new party, so the switch was on or before this day.","format":"date"},"after":{"type":["string","null"],"description":"ballot: the last election they ran in under the old party, so the switch was after this day. null when on is the day of the switch.","format":"date"},"from":{"description":"The party before.","oneOf":[{"$ref":"#/components/schemas/Party"},{"type":"null"}]},"to":{"description":"The party after.","oneOf":[{"$ref":"#/components/schemas/Party"},{"type":"null"}]},"basis":{"type":"string","description":"How we know.","enum":["announced","ballot"],"x-enumDescriptions":{"announced":"The person, their party, a legislature or an official record dated the switch: on is that day and after is null. contest_id and prior_contest_id are filled when their ballots show the same switch.","ballot":"No dated record yet, but they ran under one party and later under another (primaries count; a day they were on two parties’ ballots doesn’t; for the same seat or district, or as a person linked by ids; in fusion states only Democratic to Republican or back): the switch was after after (their last election under the old party) and on or before on (their first under the new one). contest_id is that later contest and prior_contest_id the earlier one."},"x-values":"party-change-basis"},"prior_contest_id":{"type":["integer","null"],"description":"ballot: the earlier contest, under the old party."},"contest_id":{"type":["integer","null"],"description":"ballot: the later contest, under the new party."},"source":{"description":"announced: where the switch is recorded.","oneOf":[{"type":"object","required":["name","url"],"properties":{"name":{"type":["string","null"],"description":"Who published it."},"url":{"type":"string","description":"The page that records the switch.","format":"uri"}}},{"type":"null"}]},"note":{"type":["string","null"],"description":"Anything else about it."}}},"Person":{"type":"object","description":"The person behind a candidate record, across elections and offices.","required":["id","slug","full_name","link_basis","candidate_ids","other_names","party_changes"],"properties":{"id":{"type":"integer","description":"Person id."},"slug":{"type":"string","description":"Permanent person slug: pass it as person= on GET /v1/candidates for every candidate record of this person."},"full_name":{"type":"string","description":"The name they use now (their latest ballot name)."},"link_basis":{"type":"string","description":"How their candidate records were found to be one person.","enum":["ids","seat","district","manual","single"],"x-enumDescriptions":{"ids":"The candidate records share a federal or state id: Bioguide, FEC or Open States.","seat":"Same name (family and given) on the same seat in different elections.","district":"Same full name in the same district in different elections.","manual":"Linked by hand from a source.","single":"One candidate record: nothing to link."},"x-values":"person-link-basis"},"candidate_ids":{"type":"array","description":"Every candidate record for this person (one per state load; usually one).","items":{"type":"integer","description":"Candidate id."}},"other_names":{"type":"array","description":"Other names they appeared under, such as a name before marriage.","items":{"type":"object","required":["name","kind","first_used","last_used"],"properties":{"name":{"type":"string","description":"The name."},"kind":{"type":"string","description":"What kind of name it is.","enum":["ballot","former","nickname","alias"],"x-enumDescriptions":{"ballot":"A name printed on one of their ballots.","former":"An earlier legal name, such as a name before marriage.","nickname":"A nickname they campaign under.","alias":"Another name a source uses for them."},"x-values":"person-name-kind"},"first_used":{"type":["string","null"],"description":"First ballot or record with it.","format":"date"},"last_used":{"type":["string","null"],"description":"Last ballot or record with it.","format":"date"}}}},"party_changes":{"type":"array","description":"Party switches, oldest first: dated announcements and switches seen between ballots.","items":{"$ref":"#/components/schemas/PartyChange"}}}},"RescindedEndorsement":{"type":"object","description":"An endorsement the endorser took back or switched to another pick, with the day it was made and the day it changed. Endorsement lists, counts and records leave it out.","required":["endorsement_id","endorser","choice_id","choice_slug","label","measure_answer","rank","statement","source_url","published_on","rescinded_on","rescinded_source_url","rescinded_statement","change","switched_to","restored_on","restored_source_url"],"properties":{"endorsement_id":{"type":"integer","description":"The id the endorsement had."},"endorser":{"$ref":"#/components/schemas/EndorserRef"},"choice_id":{"type":"integer","description":"The choice that had been endorsed."},"choice_slug":{"type":"string","description":"That choice’s slug."},"label":{"type":"string","description":"That choice’s label."},"measure_answer":{"type":["string","null"],"description":"yes or no for a measure.","enum":["yes","no",null],"x-enumDescriptions":{"yes":"The Yes line of a measure or retention question. On an endorsement: the endorser says vote Yes.","no":"The No line. On an endorsement: the endorser says vote No."},"x-values":"measure-answer"},"rank":{"type":["integer","null"],"description":"Ranked choice: the rank it had."},"statement":{"type":["string","null"],"description":"What the endorser had said."},"source_url":{"type":["string","null"],"description":"Where the endorsement was published.","format":"uri"},"published_on":{"type":["string","null"],"description":"When the endorsement was made (published), where known.","format":"date"},"rescinded_on":{"type":"string","description":"When the endorser took it back or moved it to another pick.","format":"date"},"rescinded_source_url":{"type":["string","null"],"description":"Where they said so.","format":"uri"},"rescinded_statement":{"type":["string","null"],"description":"What they said when taking it back."},"change":{"type":"string","description":"What happened to it: withdrawn (taken back, no new pick) or switched (moved to another pick in this contest).","enum":["withdrawn","switched"],"x-enumDescriptions":{"withdrawn":"The endorser took the endorsement back and made no new pick in the contest.","switched":"The endorser took the endorsement back and endorsed another choice in the same contest (switched_to)."},"x-values":"endorsement-change"},"switched_to":{"description":"For a switch, the endorser’s new pick; null for a withdrawal.","oneOf":[{"type":"object","required":["choice_id","choice_slug","label","on_ballot"],"properties":{"choice_id":{"type":["integer","null"],"description":"The new pick’s choice, when it is printed on the ballot. Its endorsement is in the contest’s endorsements, published_on the day of the switch."},"choice_slug":{"type":["string","null"],"description":"That choice’s slug; null when it isn’t printed."},"label":{"type":"string","description":"The new pick’s name."},"on_ballot":{"type":"boolean","description":"false when the new pick isn’t printed (they left the race before the ballot was set)."}}},{"type":"null"}]},"restored_on":{"type":["string","null"],"description":"When the endorser gave the endorsement back, if it did. The restored endorsement is in the contest’s endorsements again.","format":"date"},"restored_source_url":{"type":["string","null"],"description":"Where they gave it back.","format":"uri"}}},"Choice":{"type":"object","description":"A line a voter can mark: a candidate, or a Yes/No answer.","required":["id","slug","label","measure_answer","option","ballot_designation","withdrawn","status","incumbent","vote_meaning","endorsement_count","candidate","party","party_label","party_lines","result"],"properties":{"id":{"type":"integer","description":"Choice id: the choice_id endorsements refer to."},"slug":{"type":"string","description":"Permanent choice slug: the contest’s slug, a slash, then the ballot name’s, or yes / no (…/member-state-assembly-district-17/jane-q-doe, …/prop-50/yes)."},"label":{"type":"string","description":"As printed: the candidate’s ballot name, or Yes / No."},"measure_answer":{"type":["string","null"],"description":"yes or no for a measure or retention question; null for a candidate.","enum":["yes","no",null],"x-enumDescriptions":{"yes":"The Yes line of a measure or retention question. On an endorsement: the endorser says vote Yes.","no":"The No line. On an endorsement: the endorser says vote No."},"x-values":"measure-answer"},"option":{"type":["string","null"],"description":"A special line: none_of_these (Nevada).","enum":["none_of_these",null],"x-enumDescriptions":{"none_of_these":"Nevada’s “None of these candidates” line, printed in statewide races. It can get votes but can’t win."},"x-values":"choice-option"},"ballot_designation":{"type":["string","null"],"description":"Occupation line printed under the name, e.g. “Transit Planner”."},"withdrawn":{"type":"boolean","description":"The candidate withdrew but is still printed on the ballot."},"status":{"type":["string","null"],"description":"The candidate’s status: on_ballot, withdrew_still_on_ballot, advanced (won a primary stage), won or lost; null for a measure answer.","enum":["on_ballot","withdrew_still_on_ballot","advanced","won","lost",null],"x-enumDescriptions":{"on_ballot":"Printed on the ballot; no result yet, or the result names no winner.","withdrew_still_on_ballot":"Withdrew after the ballot was printed, so the name is still on it (withdrawn is true). Votes for them may still count.","advanced":"Won this primary stage and goes on to the next one (the general, or a runoff).","won":"Won the race: a general, special, runoff or consolidated election.","lost":"The certified result names winners and this candidate isn’t one."},"x-values":"choice-status"},"incumbent":{"type":["boolean","null"],"description":"The candidate holds this seat now: true or false where we know, null where we don’t yet (and for a measure answer)."},"vote_meaning":{"type":["string","null"],"description":"For a measure answer: what a Yes (or No) vote means, as the election office words it."},"endorsement_count":{"type":"integer","description":"Endorsers who endorsed this choice (for a measure: who back this answer)."},"candidate":{"description":"The candidate; null for a measure answer.","oneOf":[{"$ref":"#/components/schemas/Candidate"},{"type":"null"}]},"party":{"description":"The party (or party preference) printed beside the name.","oneOf":[{"$ref":"#/components/schemas/Party"},{"type":"null"}]},"party_label":{"type":["string","null"],"description":"The party text exactly as printed, where it differs (fusion lines, top-two preferences)."},"party_lines":{"type":"array","description":"Fusion: every party line the candidate is printed on, in ballot order, with votes per line where the source splits them. Empty for a candidate on one line (party says it) and for measure answers.","items":{"$ref":"#/components/schemas/PartyLine"}},"result":{"description":"This choice’s votes, once the contest has a result; null before then.","oneOf":[{"$ref":"#/components/schemas/ChoiceResult"},{"type":"null"}]}}},"ChoiceResult":{"type":"object","description":"One choice’s line in the result.","required":["votes","vote_pct","winner"],"properties":{"votes":{"type":["integer","null"],"description":"Votes for this choice. null only on a party-reported result, which names a winner without counts."},"vote_pct":{"type":["number","null"],"description":"Share of the contest’s votes, 0 to 100, as the source gives it (three decimals)."},"winner":{"type":["boolean","null"],"description":"true for a winner (for vote-for-N, each of the N), false for a choice that lost; null when not decided yet or not stated, such as a race headed to a runoff."}}},"OtherResultLine":{"type":"object","description":"A line the source reports that isn’t a choice on the printed ballot.","required":["label","votes","write_in"],"properties":{"label":{"type":["string","null"],"description":"As the source reports it: a write-in’s name, “Write-in”, or another line not on the printed ballot."},"votes":{"type":["integer","null"],"description":"Votes for it."},"write_in":{"type":"boolean","description":"A write-in candidate."}}},"ContestResult":{"type":"object","description":"A contest’s result. Each choice’s votes are on the choice (choices[].result).","required":["status","source_kind","party_reported","total_votes","precincts_reporting","precincts_total","source","official_url","more_sources","write_in_votes","blank_votes","over_votes","under_votes","other_choices","rcv_rounds","notes","turnout","seat_change","fetched_at"],"properties":{"status":{"type":"string","description":"unofficial (election-night and canvass counts, still changing) or certified (the canvass is certified).","enum":["unofficial","certified"],"x-enumDescriptions":{"unofficial":"Election-night and canvass counts: still changing. We read them again every day until they’re certified.","certified":"The canvass is certified: the final official count."},"x-values":"result-status"},"source_kind":{"type":"string","description":"Where the result comes from: official (a state, county, city or federal election office), compiled (certified official returns compiled by a research group, such as the MIT Election Data and Science Lab’s precinct returns, summed to the contest) party (a state or national party’s own announcement of the winner, with no vote counts; replaced as soon as an official result appears) or reported (read from a page that reports the result, such as a news story calling the race or a concession; always unofficial, used only where nothing else exists, replaced as soon as an official result appears).","enum":["official","compiled","party","reported"],"x-enumDescriptions":{"official":"A state, county, city or federal election office.","compiled":"Certified official returns compiled by a research group (the MIT Election Data and Science Lab’s precinct returns), summed to the contest. Used for past elections; official_url links to the state’s own results where we have them.","party":"A state or national party’s announcement of the winner, with no vote counts (party_reported is true). Replaced as soon as an official result appears.","reported":"Read from a page that reports the result: a news story calling the race, a candidate’s concession, a results post. Status is always unofficial; vote counts and shares only as the page printed them, often none. Two independent AI readers must agree on it, or a person must check it, before it is kept. Used only where no official, compiled or party result exists, and replaced as soon as an official result appears."},"x-values":"result-source-kind"},"party_reported":{"type":"boolean","description":"true when the result is a party’s announcement (source_kind party), not an official count."},"total_votes":{"type":["integer","null"],"description":"Votes cast in the contest: the printed choices plus write-ins. null on a party-reported result."},"precincts_reporting":{"type":["integer","null"],"description":"Precincts counted so far, where the source says."},"precincts_total":{"type":["integer","null"],"description":"Precincts in the contest, where the source says."},"source":{"type":"object","description":"The source of the result.","required":["name","url","contest_name","updated_at"],"properties":{"name":{"type":"string","description":"Who published the result.","examples":["California Secretary of State"]},"url":{"type":"string","description":"Where it was published: the contest’s own results page where the source has one. Every result has one.","format":"uri"},"contest_name":{"type":["string","null"],"description":"The contest’s name in the source, which may differ from the printed title."},"updated_at":{"type":["string","null"],"description":"When the source last updated it, if it says.","format":"date-time"}}},"official_url":{"type":["string","null"],"description":"For a compiled result, the state’s own certified results, where we have them.","format":"uri"},"more_sources":{"type":"array","description":"Further announcements of the same result (party-reported results that more than one party published).","items":{"type":"object","required":["name","url"],"properties":{"name":{"type":["string","null"],"description":"Who published it."},"url":{"type":"string","description":"Where it was published.","format":"uri"}}}},"write_in_votes":{"type":["integer","null"],"description":"Votes for write-in candidates, where the source counts them."},"blank_votes":{"type":["integer","null"],"description":"Blank votes, where the source counts them."},"over_votes":{"type":["integer","null"],"description":"Overvotes, where the source counts them."},"under_votes":{"type":["integer","null"],"description":"Undervotes, where the source counts them."},"other_choices":{"type":"array","description":"Lines the source reports that aren’t on the printed ballot, such as named write-ins.","items":{"$ref":"#/components/schemas/OtherResultLine"}},"rcv_rounds":{"type":["array","null"],"items":{"type":"object"},"description":"Ranked choice: the rounds of the official tabulation, as the source reports them; null for other contests or where we don’t have them."},"notes":{"type":["string","null"],"description":"Anything else about the result, such as how a ranked-choice winner was decided."},"turnout":{"description":"Registered voters and ballots cast in the contest’s jurisdiction for this election; null where the contest’s district isn’t a jurisdiction we have counts for (most districts other than states and counties).","oneOf":[{"$ref":"#/components/schemas/Turnout"},{"type":"null"}]},"seat_change":{"description":"Whether the incumbent kept the seat and whether a partisan seat flipped, judged against whoever held it going in; null until the contest has a winner and is linked to its seat.","oneOf":[{"$ref":"#/components/schemas/SeatChange"},{"type":"null"}]},"fetched_at":{"type":"string","description":"When we last read it from the source.","format":"date-time"}}},"ContestResultBrief":{"type":"object","description":"A contest’s result in brief: GET /v1/contests/{id} has all of it.","required":["status","source_kind","party_reported","total_votes","source_url","seat_change"],"properties":{"status":{"type":"string","description":"unofficial (election-night and canvass counts, still changing) or certified (the canvass is certified).","enum":["unofficial","certified"],"x-enumDescriptions":{"unofficial":"Election-night and canvass counts: still changing. We read them again every day until they’re certified.","certified":"The canvass is certified: the final official count."},"x-values":"result-status"},"source_kind":{"type":"string","description":"Where the result comes from: official (a state, county, city or federal election office), compiled (certified official returns compiled by a research group, such as the MIT Election Data and Science Lab’s precinct returns, summed to the contest) party (a state or national party’s own announcement of the winner, with no vote counts; replaced as soon as an official result appears) or reported (read from a page that reports the result, such as a news story calling the race or a concession; always unofficial, used only where nothing else exists, replaced as soon as an official result appears).","enum":["official","compiled","party","reported"],"x-enumDescriptions":{"official":"A state, county, city or federal election office.","compiled":"Certified official returns compiled by a research group (the MIT Election Data and Science Lab’s precinct returns), summed to the contest. Used for past elections; official_url links to the state’s own results where we have them.","party":"A state or national party’s announcement of the winner, with no vote counts (party_reported is true). Replaced as soon as an official result appears.","reported":"Read from a page that reports the result: a news story calling the race, a candidate’s concession, a results post. Status is always unofficial; vote counts and shares only as the page printed them, often none. Two independent AI readers must agree on it, or a person must check it, before it is kept. Used only where no official, compiled or party result exists, and replaced as soon as an official result appears."},"x-values":"result-source-kind"},"party_reported":{"type":"boolean","description":"true when the result is a party’s announcement (source_kind party), not an official count."},"total_votes":{"type":["integer","null"],"description":"Votes cast in the contest. null on a party-reported result."},"source_url":{"type":"string","description":"Where the result was published.","format":"uri"},"seat_change":{"description":"Whether the incumbent kept the seat and whether a partisan seat flipped; null until known.","oneOf":[{"$ref":"#/components/schemas/SeatChange"},{"type":"null"}]}}},"ContestBase":{"type":"object","required":["id","slug","title","short_title","kind","vote_method","votes_allowed","ranks_allowed","measure_code","description","ballot_text","full_text_url","unopposed","on_ballot","off_ballot_reason","ballot_order","party","details","source_url","office","seat","race_type","partisan","topics","district","result","election"],"properties":{"id":{"type":"integer","description":"Contest id."},"slug":{"type":"string","description":"Permanent contest slug: the election’s slug, a slash, then the title’s (ca-2026-11-03-general/member-state-assembly-district-17). Pass it as slugs= on GET /v1/contests."},"title":{"type":"string","description":"Title as printed on the ballot."},"short_title":{"type":["string","null"],"description":"Shorter title."},"kind":{"type":"string","description":"candidate (an office), measure (a proposition) or retention (keep a judge?).","enum":["candidate","measure","retention"],"x-enumDescriptions":{"candidate":"A race for an office: voters choose among candidates.","measure":"A ballot measure (proposition, amendment, bond, tax, referendum or initiative): voters answer Yes or No.","retention":"A judicial retention question: should this judge stay in office? Voters answer Yes or No."},"x-values":"contest-kind"},"vote_method":{"type":"string","description":"How votes are cast: plurality (vote for one), multi_seat (vote for up to votes_allowed), ranked_choice (rank up to ranks_allowed), approval, or yes_no.","enum":["plurality","multi_seat","ranked_choice","approval","yes_no"],"x-enumDescriptions":{"plurality":"Vote for one: the candidate with the most votes wins (or goes to a runoff where a majority is required).","multi_seat":"Vote for up to N (votes_allowed): several seats are filled at once and the top N win.","ranked_choice":"Ranked choice: voters rank up to ranks_allowed candidates; endorsements carry the endorser’s rank 1, 2, 3…. rcv_rounds holds the official tabulation once there is one.","approval":"Approval voting: voters mark every candidate they approve of; the most-approved win (Fargo, St. Louis).","yes_no":"A Yes or No question: every measure and retention question."},"x-values":"vote-method"},"votes_allowed":{"type":["integer","null"],"description":"How many choices a voter may mark (vote for N)."},"ranks_allowed":{"type":["integer","null"],"description":"Ranked choice: how many choices a voter may rank."},"measure_code":{"type":["string","null"],"description":"The measure’s letter or number: “K”, “Prop 1”."},"description":{"type":["string","null"],"description":"A short description or question. For a measure with ballot_text, often a summary."},"ballot_text":{"type":["string","null"],"description":"A measure’s wording exactly as printed on the ballot; null where we don’t have it yet."},"full_text_url":{"type":["string","null"],"description":"The official full text of a measure.","format":"uri"},"unopposed":{"type":"boolean","description":"A candidate contest with no more candidates still running than seats (the same rule endorsedby.org uses). Always false for measures."},"on_ballot":{"type":"boolean","description":"Printed on the ballot. false for a race the state or county left off, usually because it was unopposed and the candidates were declared elected; off_ballot_reason says why. endorsedby.org shows only contests on the ballot; filter with on_ballot=true for the same."},"off_ballot_reason":{"type":["string","null"],"description":"Why the contest is not on the ballot: unopposed or cancelled. null when on_ballot is true.","enum":["unopposed","cancelled",null],"x-enumDescriptions":{"unopposed":"No more candidates filed than seats, so the state or county left the race off the ballot and declared them elected.","cancelled":"Left off the ballot for another reason: nobody filed, the seat was filled by appointment, or the election was called off."},"x-values":"off-ballot-reason"},"ballot_order":{"type":["integer","null"],"description":"Position on the printed ballot."},"party":{"description":"For a party primary, the party.","oneOf":[{"$ref":"#/components/schemas/Party"},{"type":"null"}]},"details":{"type":"object","description":"Facts about the contest. Only keys that apply are present.","required":[],"properties":{"uncontested":{"type":"boolean","description":"Only one candidate is running."},"nonpartisan":{"type":"boolean","description":"Candidates appear without a party."},"measure_type":{"type":"string","description":"What kind of measure, as the election office classes it.","x-enumDescriptions":{"local":"A local measure.","other":"A measure the election office doesn’t class further.","bond":"Authorizes borrowing by issuing bonds.","tax_rate":"Sets or changes a tax rate or levy (a millage or levy rate).","charter_amendment":"Amends a city or county charter.","local_proposition":"A local proposition.","constitutional_amendment":"Amends the state constitution.","charter amendment":"Amends a city or county charter.","legislative_constitutional_amendment":"A state constitutional amendment the legislature put on the ballot.","referendum":"A referendum: voters approve or reject a law or action already passed.","Local Proposition":"A local proposition.","school_referendum":"A school district referendum, usually an operating levy or bond (Minnesota, Wisconsin).","Charter Amendment":"Amends a city or county charter.","general tax":"A general tax: the money goes to the general fund, so a simple majority passes it (California).","town_question":"A question for a town’s voters.","local_option":"A local option question, such as allowing alcohol sales (a wet/dry vote).","levy":"A property tax levy.","sales tax":"A sales tax.","special tax":"A special tax: the money is set aside for a purpose, so it usually needs two-thirds (California).","ordinance":"An ordinance: a local law.","municipal":"A municipal measure.","tax":"A tax measure.","municipality_question":"A question for a municipality’s voters.","parcel tax":"A parcel tax: a flat tax on each parcel of property (California).","school_question":"A question for a school district’s voters.","advisory":"An advisory question: the result is advice to the government, not law.","local_question":"A question for local voters.","ordinance (tax)":"A local tax ordinance.","Bond Issue":"Authorizes borrowing by issuing bonds.","County Ordinance":"A county ordinance.","non_binding":"A non-binding (advisory) question: the result is advice to the government, not law.","city_question":"A question for a city’s voters.","initiative":"A measure put on the ballot by citizens’ petition.","initiative_statute":"A state law proposed by citizens’ petition.","initiated_constitutional_amendment":"A state constitutional amendment put on the ballot by citizens’ petition.","initiated_statute":"A state law proposed by citizens’ petition.","initiative_constitutional_amendment":"A state constitutional amendment put on the ballot by citizens’ petition.","county_question":"A question for a county’s voters.","legislative_statute":"A state law the legislature referred to the voters.","school":"A school district measure.","Constitutional Amendment":"Amends the state constitution.","legislatively_referred_constitutional_amendment":"A state constitutional amendment the legislature put on the ballot.","statute":"Changes state law.","county charter amendment":"Amends a county charter.","City Charter Amendment":"Amends a city charter.","County Proposition":"A county proposition.","appropriations limit":"Sets or raises a government’s appropriations (Gann) limit (California).","initiative (tax)":"A tax measure put on the ballot by citizens’ petition.","debt_exclusion":"A debt exclusion: raises property taxes outside Proposition 2½’s limit to pay for a project (Massachusetts).","formation":"Forms a new district or government.","initiative constitutional amendment":"A state constitutional amendment put on the ballot by citizens’ petition.","initiative_to_the_legislature":"A citizens’ initiative sent to the legislature first, then to the voters (Washington).","recall":"A recall question: whether to remove an officeholder.","village_question":"A question for a village’s voters.","charter":"Adopts or revises a charter.","constitutional_initiative":"A state constitutional amendment put on the ballot by citizens’ petition.","initiative statute":"A state law proposed by citizens’ petition.","legislative constitutional amendment":"A state constitutional amendment the legislature put on the ballot.","statewide_referendum":"A statewide referendum: voters approve or reject a law already passed.","tax levy":"A property tax levy.","Charter Amendment by act of County Council":"A county charter amendment the county council put on the ballot (Maryland).","Initiative":"A measure put on the ballot by citizens’ petition.","Local Referendum by Petition":"A local referendum citizens forced by petition.","appointive offices":"Makes elected offices appointed, or the reverse.","cpa":"Adopts or changes the Community Preservation Act surcharge (Massachusetts).","fire district":"A fire district measure.","initiative ordinance":"A local ordinance put on the ballot by citizens’ petition.","land use":"A land use or zoning measure.","lease approval":"Approves a lease of public property.","legislative_bond":"A bond measure the legislature referred to the voters.","ordinance (land use)":"A local land use ordinance.","sales surtax":"A sales surtax (Florida).","Bond Act":"A state bond act (New York).","Charter Amendment by Petition":"A charter amendment put on the ballot by citizens’ petition.","Charter Amendment via Local Petition":"A charter amendment put on the ballot by citizens’ petition.","Charter Resolution":"A charter amendment proposed by resolution of the governing body.","County Charter Adoption Referendum":"Whether to adopt a county charter.","General Assembly Referendum":"A question the state legislature (General Assembly) referred to the voters.","appointive office":"Makes an elected office appointed, or the reverse.","bylaw amendment":"Amends a town’s bylaws (New England).","charter and general tax":"A charter amendment that also sets a general tax.","city_referendum":"A city referendum.","constitutional_convention":"Whether to call a state constitutional convention.","county":"A county measure.","county measure":"A county measure.","county parcel tax (initiative)":"A county parcel tax put on the ballot by citizens’ petition.","county tax":"A county tax.","county tax (initiative)":"A county tax put on the ballot by citizens’ petition.","fee":"Sets or changes a fee.","general plan amendment":"Amends a city’s or county’s general plan.","hospital lease":"Approves a lease of a public hospital.","hotel tax":"A hotel (transient occupancy) tax.","initiated_act":"A state law proposed by citizens’ petition (an initiated act).","initiative bond":"A bond measure put on the ballot by citizens’ petition.","initiative constitutional amendment and statute":"A citizens’ initiative that amends the state constitution and changes state law.","initiative_constitutional_amendment_and_statute":"A citizens’ initiative that amends the state constitution and changes state law.","legislative bond":"A bond measure the legislature referred to the voters.","legislative statute":"A state law the legislature referred to the voters.","legislative_constitutional_ratification":"Ratifies a state constitutional amendment the legislature passed.","legislative_referral":"A measure the legislature referred to the voters.","ordinance (initiative)":"A local ordinance put on the ballot by citizens’ petition.","parcel tax (initiative)":"A parcel tax put on the ballot by citizens’ petition.","property transfer":"Approves selling or transferring public property.","regional tax":"A tax across several counties or cities.","reorganization":"Reorganizes a government or district (merging, dividing or restructuring it)."},"x-values":"measure-type"},"vote_required":{"type":"string","description":"Share of the vote needed to pass, e.g. \"2/3\" or \"55%\"."},"majority_required":{"type":"boolean","description":"A candidate needs a majority to win outright (else a runoff)."},"amount":{"type":"number","description":"Dollar amount of a bond or tax measure."},"term":{"type":"string","description":"Length of the term, e.g. \"4 years\"."},"short_term":{"type":"boolean","description":"The seat is for the remainder of an unexpired term."},"justice":{"type":"string","description":"The judge or justice a retention question is about."},"runoff_date":{"type":"string","description":"Date of a runoff, if one is needed.","format":"date"},"stage":{"type":"string","description":"Which round of a multi-round contest this is.","x-enumDescriptions":{"open_primary":"Louisiana’s open (jungle) primary: every candidate on one ballot; a majority wins outright, else the top two go to a runoff.","runoff":"The runoff round.","general":"The general election round."},"x-values":"contest-stage"},"elected_at_large":{"type":"boolean","description":"Elected by the whole jurisdiction, not by district."},"none_of_these":{"type":"boolean","description":"The ballot offers “None of these candidates” (Nevada)."},"primary_nominating":{"type":"boolean","description":"The primary nominates a party’s candidate."},"winners":{"type":"integer","description":"Number of winners, where it differs from votes_allowed."},"ref_type":{"type":"string","description":"Kind of referendum.","x-enumDescriptions":{"nonrecurring":"A nonrecurring (one-time or limited-term) levy.","debt":"A levy to pay debt, such as a bond.","operating":"An operating levy for day-to-day costs.","other":"Another kind of referendum."},"x-values":"ref-type"},"party_lines_unverified":{"type":"boolean","description":"The candidates are known, but their party lines haven’t been checked against a printed ballot yet."},"question_wording":{"type":"string","description":"How description relates to the printed question.","x-enumDescriptions":{"notice":"description summarizes the official election notice (Ohio) instead of quoting the printed question."},"x-values":"question-wording"}}},"source_url":{"type":["string","null"],"description":"The official source the contest was loaded from.","format":"uri"},"office":{"description":"The office a candidate or retention contest fills; null for a measure.","oneOf":[{"$ref":"#/components/schemas/Office"},{"type":"null"}]},"seat":{"description":"The seat this contest fills (GET /v1/offices/{slug}), once it is linked; null for a measure or a contest not linked yet.","oneOf":[{"$ref":"#/components/schemas/ContestSeat"},{"type":"null"}]},"race_type":{"type":["string","null"],"description":"regular (a full term), special (the rest of an unexpired term, or a special election), recall, or retention (keep a judge?); null for a measure.","enum":["regular","special","recall","retention",null],"x-enumDescriptions":{"regular":"An election for a full term on the regular schedule.","special":"An election for the rest of an unexpired term, or a contest in a special election.","recall":"A recall: whether to remove an officeholder before the term ends (and, where the ballot has one, who replaces them).","retention":"A judicial retention question."},"x-values":"race-type"},"partisan":{"type":["boolean","null"],"description":"Candidates run with a party label on the ballot; null for a measure or retention question."},"topics":{"type":"array","description":"A measure’s topics (GET /v1/measure-topics), assigned by rule from its title, summary and wording; empty for candidate contests.","items":{"type":"string","enum":["taxes","bonds","budgets","education","housing","elections","government","term_limits","ethics","local_boundaries","public_safety","criminal_justice","health","mental_health","environment","energy","water","transportation","parks_recreation","libraries","land_use","economic_development","cannabis","alcohol","gambling","abortion","civil_rights","labor","pensions","firearms","utilities","immigration","veterans","animals","seniors","children"],"x-enumDescriptions":{"taxes":"Taxes: new or changed taxes, levies, millage, fees, assessments and exemptions.","bonds":"Bonds and borrowing: general obligation bonds, debt, lease-purchase.","budgets":"Budgets and spending limits: appropriations, revenue and spending caps.","education":"Education and schools: school funding, facilities, districts and colleges.","housing":"Housing: affordable housing, rent, homelessness.","elections":"Elections and voting: how elections are run, voting rules, redistricting.","government":"Government structure and charters: charter amendments, who appoints whom, how offices work.","term_limits":"Term limits for elected officials.","ethics":"Ethics and transparency: conflicts of interest, open records, campaign finance.","local_boundaries":"Annexation, incorporation and dissolution: changing a city’s or district’s boundaries, merging or dissolving one.","public_safety":"Police, fire and emergency services.","criminal_justice":"Criminal justice: sentencing, courts, jails, victims’ rights.","health":"Health care and hospitals.","mental_health":"Mental health and addiction services.","environment":"Environment and conservation: open space, pollution, climate.","energy":"Energy: power generation, fuels, renewables.","water":"Water and sewer: water supply, treatment and rights.","transportation":"Transportation and roads: transit, highways, streets.","parks_recreation":"Parks and recreation.","libraries":"Libraries.","land_use":"Land use and zoning: development, planning, growth limits.","economic_development":"Economic development: business incentives, tourism, development districts.","cannabis":"Marijuana: legalization, sales, local bans.","alcohol":"Alcohol: liquor sales, local option (wet/dry) questions.","gambling":"Gambling: casinos, sports betting, lotteries.","abortion":"Abortion and reproductive rights.","civil_rights":"Civil rights: equal rights, discrimination, privacy.","labor":"Labor and wages: minimum wage, paid leave, unions.","pensions":"Pensions and public employees: retirement benefits, pay and rules for government workers.","firearms":"Firearms.","utilities":"Utilities and broadband: public utilities, franchises, internet service.","immigration":"Immigration and citizenship.","veterans":"Veterans’ benefits and services.","animals":"Animals: animal welfare, hunting, fishing.","seniors":"Seniors: services and tax relief for older residents.","children":"Children and families: child care, youth services."},"x-values":"measure-topic"}},"district":{"$ref":"#/components/schemas/District"},"result":{"description":"The election result, once a source has one; null before then.","oneOf":[{"$ref":"#/components/schemas/ContestResult"},{"type":"null"}]},"election":{"$ref":"#/components/schemas/Election"}}},"ContestBaseNoElection":{"type":"object","description":"A contest, in an export: its election is given once at the top.","required":["id","slug","title","short_title","kind","vote_method","votes_allowed","ranks_allowed","measure_code","description","ballot_text","full_text_url","unopposed","on_ballot","off_ballot_reason","ballot_order","party","details","source_url","office","seat","race_type","partisan","topics","district","result"],"properties":{"id":{"type":"integer","description":"Contest id."},"slug":{"type":"string","description":"Permanent contest slug: the election’s slug, a slash, then the title’s (ca-2026-11-03-general/member-state-assembly-district-17). Pass it as slugs= on GET /v1/contests."},"title":{"type":"string","description":"Title as printed on the ballot."},"short_title":{"type":["string","null"],"description":"Shorter title."},"kind":{"type":"string","description":"candidate (an office), measure (a proposition) or retention (keep a judge?).","enum":["candidate","measure","retention"],"x-enumDescriptions":{"candidate":"A race for an office: voters choose among candidates.","measure":"A ballot measure (proposition, amendment, bond, tax, referendum or initiative): voters answer Yes or No.","retention":"A judicial retention question: should this judge stay in office? Voters answer Yes or No."},"x-values":"contest-kind"},"vote_method":{"type":"string","description":"How votes are cast: plurality (vote for one), multi_seat (vote for up to votes_allowed), ranked_choice (rank up to ranks_allowed), approval, or yes_no.","enum":["plurality","multi_seat","ranked_choice","approval","yes_no"],"x-enumDescriptions":{"plurality":"Vote for one: the candidate with the most votes wins (or goes to a runoff where a majority is required).","multi_seat":"Vote for up to N (votes_allowed): several seats are filled at once and the top N win.","ranked_choice":"Ranked choice: voters rank up to ranks_allowed candidates; endorsements carry the endorser’s rank 1, 2, 3…. rcv_rounds holds the official tabulation once there is one.","approval":"Approval voting: voters mark every candidate they approve of; the most-approved win (Fargo, St. Louis).","yes_no":"A Yes or No question: every measure and retention question."},"x-values":"vote-method"},"votes_allowed":{"type":["integer","null"],"description":"How many choices a voter may mark (vote for N)."},"ranks_allowed":{"type":["integer","null"],"description":"Ranked choice: how many choices a voter may rank."},"measure_code":{"type":["string","null"],"description":"The measure’s letter or number: “K”, “Prop 1”."},"description":{"type":["string","null"],"description":"A short description or question. For a measure with ballot_text, often a summary."},"ballot_text":{"type":["string","null"],"description":"A measure’s wording exactly as printed on the ballot; null where we don’t have it yet."},"full_text_url":{"type":["string","null"],"description":"The official full text of a measure.","format":"uri"},"unopposed":{"type":"boolean","description":"A candidate contest with no more candidates still running than seats (the same rule endorsedby.org uses). Always false for measures."},"on_ballot":{"type":"boolean","description":"Printed on the ballot. false for a race the state or county left off, usually because it was unopposed and the candidates were declared elected; off_ballot_reason says why. endorsedby.org shows only contests on the ballot; filter with on_ballot=true for the same."},"off_ballot_reason":{"type":["string","null"],"description":"Why the contest is not on the ballot: unopposed or cancelled. null when on_ballot is true.","enum":["unopposed","cancelled",null],"x-enumDescriptions":{"unopposed":"No more candidates filed than seats, so the state or county left the race off the ballot and declared them elected.","cancelled":"Left off the ballot for another reason: nobody filed, the seat was filled by appointment, or the election was called off."},"x-values":"off-ballot-reason"},"ballot_order":{"type":["integer","null"],"description":"Position on the printed ballot."},"party":{"description":"For a party primary, the party.","oneOf":[{"$ref":"#/components/schemas/Party"},{"type":"null"}]},"details":{"type":"object","description":"Facts about the contest. Only keys that apply are present.","required":[],"properties":{"uncontested":{"type":"boolean","description":"Only one candidate is running."},"nonpartisan":{"type":"boolean","description":"Candidates appear without a party."},"measure_type":{"type":"string","description":"What kind of measure, as the election office classes it.","x-enumDescriptions":{"local":"A local measure.","other":"A measure the election office doesn’t class further.","bond":"Authorizes borrowing by issuing bonds.","tax_rate":"Sets or changes a tax rate or levy (a millage or levy rate).","charter_amendment":"Amends a city or county charter.","local_proposition":"A local proposition.","constitutional_amendment":"Amends the state constitution.","charter amendment":"Amends a city or county charter.","legislative_constitutional_amendment":"A state constitutional amendment the legislature put on the ballot.","referendum":"A referendum: voters approve or reject a law or action already passed.","Local Proposition":"A local proposition.","school_referendum":"A school district referendum, usually an operating levy or bond (Minnesota, Wisconsin).","Charter Amendment":"Amends a city or county charter.","general tax":"A general tax: the money goes to the general fund, so a simple majority passes it (California).","town_question":"A question for a town’s voters.","local_option":"A local option question, such as allowing alcohol sales (a wet/dry vote).","levy":"A property tax levy.","sales tax":"A sales tax.","special tax":"A special tax: the money is set aside for a purpose, so it usually needs two-thirds (California).","ordinance":"An ordinance: a local law.","municipal":"A municipal measure.","tax":"A tax measure.","municipality_question":"A question for a municipality’s voters.","parcel tax":"A parcel tax: a flat tax on each parcel of property (California).","school_question":"A question for a school district’s voters.","advisory":"An advisory question: the result is advice to the government, not law.","local_question":"A question for local voters.","ordinance (tax)":"A local tax ordinance.","Bond Issue":"Authorizes borrowing by issuing bonds.","County Ordinance":"A county ordinance.","non_binding":"A non-binding (advisory) question: the result is advice to the government, not law.","city_question":"A question for a city’s voters.","initiative":"A measure put on the ballot by citizens’ petition.","initiative_statute":"A state law proposed by citizens’ petition.","initiated_constitutional_amendment":"A state constitutional amendment put on the ballot by citizens’ petition.","initiated_statute":"A state law proposed by citizens’ petition.","initiative_constitutional_amendment":"A state constitutional amendment put on the ballot by citizens’ petition.","county_question":"A question for a county’s voters.","legislative_statute":"A state law the legislature referred to the voters.","school":"A school district measure.","Constitutional Amendment":"Amends the state constitution.","legislatively_referred_constitutional_amendment":"A state constitutional amendment the legislature put on the ballot.","statute":"Changes state law.","county charter amendment":"Amends a county charter.","City Charter Amendment":"Amends a city charter.","County Proposition":"A county proposition.","appropriations limit":"Sets or raises a government’s appropriations (Gann) limit (California).","initiative (tax)":"A tax measure put on the ballot by citizens’ petition.","debt_exclusion":"A debt exclusion: raises property taxes outside Proposition 2½’s limit to pay for a project (Massachusetts).","formation":"Forms a new district or government.","initiative constitutional amendment":"A state constitutional amendment put on the ballot by citizens’ petition.","initiative_to_the_legislature":"A citizens’ initiative sent to the legislature first, then to the voters (Washington).","recall":"A recall question: whether to remove an officeholder.","village_question":"A question for a village’s voters.","charter":"Adopts or revises a charter.","constitutional_initiative":"A state constitutional amendment put on the ballot by citizens’ petition.","initiative statute":"A state law proposed by citizens’ petition.","legislative constitutional amendment":"A state constitutional amendment the legislature put on the ballot.","statewide_referendum":"A statewide referendum: voters approve or reject a law already passed.","tax levy":"A property tax levy.","Charter Amendment by act of County Council":"A county charter amendment the county council put on the ballot (Maryland).","Initiative":"A measure put on the ballot by citizens’ petition.","Local Referendum by Petition":"A local referendum citizens forced by petition.","appointive offices":"Makes elected offices appointed, or the reverse.","cpa":"Adopts or changes the Community Preservation Act surcharge (Massachusetts).","fire district":"A fire district measure.","initiative ordinance":"A local ordinance put on the ballot by citizens’ petition.","land use":"A land use or zoning measure.","lease approval":"Approves a lease of public property.","legislative_bond":"A bond measure the legislature referred to the voters.","ordinance (land use)":"A local land use ordinance.","sales surtax":"A sales surtax (Florida).","Bond Act":"A state bond act (New York).","Charter Amendment by Petition":"A charter amendment put on the ballot by citizens’ petition.","Charter Amendment via Local Petition":"A charter amendment put on the ballot by citizens’ petition.","Charter Resolution":"A charter amendment proposed by resolution of the governing body.","County Charter Adoption Referendum":"Whether to adopt a county charter.","General Assembly Referendum":"A question the state legislature (General Assembly) referred to the voters.","appointive office":"Makes an elected office appointed, or the reverse.","bylaw amendment":"Amends a town’s bylaws (New England).","charter and general tax":"A charter amendment that also sets a general tax.","city_referendum":"A city referendum.","constitutional_convention":"Whether to call a state constitutional convention.","county":"A county measure.","county measure":"A county measure.","county parcel tax (initiative)":"A county parcel tax put on the ballot by citizens’ petition.","county tax":"A county tax.","county tax (initiative)":"A county tax put on the ballot by citizens’ petition.","fee":"Sets or changes a fee.","general plan amendment":"Amends a city’s or county’s general plan.","hospital lease":"Approves a lease of a public hospital.","hotel tax":"A hotel (transient occupancy) tax.","initiated_act":"A state law proposed by citizens’ petition (an initiated act).","initiative bond":"A bond measure put on the ballot by citizens’ petition.","initiative constitutional amendment and statute":"A citizens’ initiative that amends the state constitution and changes state law.","initiative_constitutional_amendment_and_statute":"A citizens’ initiative that amends the state constitution and changes state law.","legislative bond":"A bond measure the legislature referred to the voters.","legislative statute":"A state law the legislature referred to the voters.","legislative_constitutional_ratification":"Ratifies a state constitutional amendment the legislature passed.","legislative_referral":"A measure the legislature referred to the voters.","ordinance (initiative)":"A local ordinance put on the ballot by citizens’ petition.","parcel tax (initiative)":"A parcel tax put on the ballot by citizens’ petition.","property transfer":"Approves selling or transferring public property.","regional tax":"A tax across several counties or cities.","reorganization":"Reorganizes a government or district (merging, dividing or restructuring it)."},"x-values":"measure-type"},"vote_required":{"type":"string","description":"Share of the vote needed to pass, e.g. \"2/3\" or \"55%\"."},"majority_required":{"type":"boolean","description":"A candidate needs a majority to win outright (else a runoff)."},"amount":{"type":"number","description":"Dollar amount of a bond or tax measure."},"term":{"type":"string","description":"Length of the term, e.g. \"4 years\"."},"short_term":{"type":"boolean","description":"The seat is for the remainder of an unexpired term."},"justice":{"type":"string","description":"The judge or justice a retention question is about."},"runoff_date":{"type":"string","description":"Date of a runoff, if one is needed.","format":"date"},"stage":{"type":"string","description":"Which round of a multi-round contest this is.","x-enumDescriptions":{"open_primary":"Louisiana’s open (jungle) primary: every candidate on one ballot; a majority wins outright, else the top two go to a runoff.","runoff":"The runoff round.","general":"The general election round."},"x-values":"contest-stage"},"elected_at_large":{"type":"boolean","description":"Elected by the whole jurisdiction, not by district."},"none_of_these":{"type":"boolean","description":"The ballot offers “None of these candidates” (Nevada)."},"primary_nominating":{"type":"boolean","description":"The primary nominates a party’s candidate."},"winners":{"type":"integer","description":"Number of winners, where it differs from votes_allowed."},"ref_type":{"type":"string","description":"Kind of referendum.","x-enumDescriptions":{"nonrecurring":"A nonrecurring (one-time or limited-term) levy.","debt":"A levy to pay debt, such as a bond.","operating":"An operating levy for day-to-day costs.","other":"Another kind of referendum."},"x-values":"ref-type"},"party_lines_unverified":{"type":"boolean","description":"The candidates are known, but their party lines haven’t been checked against a printed ballot yet."},"question_wording":{"type":"string","description":"How description relates to the printed question.","x-enumDescriptions":{"notice":"description summarizes the official election notice (Ohio) instead of quoting the printed question."},"x-values":"question-wording"}}},"source_url":{"type":["string","null"],"description":"The official source the contest was loaded from.","format":"uri"},"office":{"description":"The office a candidate or retention contest fills; null for a measure.","oneOf":[{"$ref":"#/components/schemas/Office"},{"type":"null"}]},"seat":{"description":"The seat this contest fills (GET /v1/offices/{slug}), once it is linked; null for a measure or a contest not linked yet.","oneOf":[{"$ref":"#/components/schemas/ContestSeat"},{"type":"null"}]},"race_type":{"type":["string","null"],"description":"regular (a full term), special (the rest of an unexpired term, or a special election), recall, or retention (keep a judge?); null for a measure.","enum":["regular","special","recall","retention",null],"x-enumDescriptions":{"regular":"An election for a full term on the regular schedule.","special":"An election for the rest of an unexpired term, or a contest in a special election.","recall":"A recall: whether to remove an officeholder before the term ends (and, where the ballot has one, who replaces them).","retention":"A judicial retention question."},"x-values":"race-type"},"partisan":{"type":["boolean","null"],"description":"Candidates run with a party label on the ballot; null for a measure or retention question."},"topics":{"type":"array","description":"A measure’s topics (GET /v1/measure-topics), assigned by rule from its title, summary and wording; empty for candidate contests.","items":{"type":"string","enum":["taxes","bonds","budgets","education","housing","elections","government","term_limits","ethics","local_boundaries","public_safety","criminal_justice","health","mental_health","environment","energy","water","transportation","parks_recreation","libraries","land_use","economic_development","cannabis","alcohol","gambling","abortion","civil_rights","labor","pensions","firearms","utilities","immigration","veterans","animals","seniors","children"],"x-enumDescriptions":{"taxes":"Taxes: new or changed taxes, levies, millage, fees, assessments and exemptions.","bonds":"Bonds and borrowing: general obligation bonds, debt, lease-purchase.","budgets":"Budgets and spending limits: appropriations, revenue and spending caps.","education":"Education and schools: school funding, facilities, districts and colleges.","housing":"Housing: affordable housing, rent, homelessness.","elections":"Elections and voting: how elections are run, voting rules, redistricting.","government":"Government structure and charters: charter amendments, who appoints whom, how offices work.","term_limits":"Term limits for elected officials.","ethics":"Ethics and transparency: conflicts of interest, open records, campaign finance.","local_boundaries":"Annexation, incorporation and dissolution: changing a city’s or district’s boundaries, merging or dissolving one.","public_safety":"Police, fire and emergency services.","criminal_justice":"Criminal justice: sentencing, courts, jails, victims’ rights.","health":"Health care and hospitals.","mental_health":"Mental health and addiction services.","environment":"Environment and conservation: open space, pollution, climate.","energy":"Energy: power generation, fuels, renewables.","water":"Water and sewer: water supply, treatment and rights.","transportation":"Transportation and roads: transit, highways, streets.","parks_recreation":"Parks and recreation.","libraries":"Libraries.","land_use":"Land use and zoning: development, planning, growth limits.","economic_development":"Economic development: business incentives, tourism, development districts.","cannabis":"Marijuana: legalization, sales, local bans.","alcohol":"Alcohol: liquor sales, local option (wet/dry) questions.","gambling":"Gambling: casinos, sports betting, lotteries.","abortion":"Abortion and reproductive rights.","civil_rights":"Civil rights: equal rights, discrimination, privacy.","labor":"Labor and wages: minimum wage, paid leave, unions.","pensions":"Pensions and public employees: retirement benefits, pay and rules for government workers.","firearms":"Firearms.","utilities":"Utilities and broadband: public utilities, franchises, internet service.","immigration":"Immigration and citizenship.","veterans":"Veterans’ benefits and services.","animals":"Animals: animal welfare, hunting, fishing.","seniors":"Seniors: services and tax relief for older residents.","children":"Children and families: child care, youth services."},"x-values":"measure-topic"}},"district":{"$ref":"#/components/schemas/District"},"result":{"description":"The election result, once a source has one; null before then.","oneOf":[{"$ref":"#/components/schemas/ContestResult"},{"type":"null"}]}}},"Contest":{"allOf":[{"$ref":"#/components/schemas/ContestBase"},{"type":"object","required":["choices","other_candidates"],"properties":{"choices":{"type":"array","description":"Every choice, in ballot order.","items":{"$ref":"#/components/schemas/Choice"}},"other_candidates":{"type":"array","description":"People in the race who aren’t printed lines: declared but not qualified, withdrew before printing, disqualified, and write-in candidates. Empty where we have none.","items":{"$ref":"#/components/schemas/Candidacy"}}}}]},"Pick":{"type":"object","required":["endorsement_id","choice_id","choice_slug","label","measure_answer","rank","statement","source_url","published_on","first_seen_on","date_source","added_by","stage"],"properties":{"endorsement_id":{"type":"integer","description":"The endorsement’s id (GET /v1/endorsements/{id})."},"choice_id":{"type":"integer","description":"The Choice endorsed."},"choice_slug":{"type":"string","description":"That choice’s slug."},"label":{"type":"string","description":"That choice’s label."},"measure_answer":{"type":["string","null"],"description":"yes or no for a measure.","enum":["yes","no",null],"x-enumDescriptions":{"yes":"The Yes line of a measure or retention question. On an endorsement: the endorser says vote Yes.","no":"The No line. On an endorsement: the endorser says vote No."},"x-values":"measure-answer"},"rank":{"type":["integer","null"],"description":"Ranked choice: 1 for first choice, 2 for second, …; null otherwise."},"statement":{"type":["string","null"],"description":"What the endorser said about it."},"source_url":{"type":["string","null"],"description":"Where the endorsement was published.","format":"uri"},"published_on":{"type":["string","null"],"description":"When it was published.","format":"date"},"first_seen_on":{"type":["string","null"],"description":"The earliest date the endorsement can be shown to have been public: the date its page or press release gives. null where we couldn’t date it; published_on is the date the endorser printed, when it printed one.","format":"date"},"date_source":{"type":["string","null"],"description":"Where first_seen_on came from: page (the endorsement page’s own publication date) or press_release; null when first_seen_on is.","enum":["page","press_release","archive","feed",null],"x-enumDescriptions":{"page":"The endorsement page’s own publication date (its published date in the page’s metadata, or the date printed on it).","press_release":"The date on the endorser’s press release.","archive":"The earliest Internet Archive capture that shows the endorsement. An upper bound: the endorsement may be older. Not used yet.","feed":"The date of the endorser’s RSS or Atom feed entry. Not used yet."},"x-values":"date-source"},"added_by":{"type":"string","description":"How the endorsement got here: automatic (added by our automatic watch of the endorser’s own page), staff (entered by hand by BallotData staff) or data_load (loaded in a researched data pass).","enum":["automatic","staff","data_load"],"x-enumDescriptions":{"automatic":"Added by our automatic watch of the endorser’s own website. It only adds a candidate the endorser’s own page names for that election; source_url is that page.","staff":"Entered by hand by BallotData staff.","data_load":"Loaded in one of our researched data passes."},"x-values":"added-by"},"stage":{"type":"string","description":"The election stage the endorsement is for: general, primary or runoff (from the election it is in).","enum":["general","primary","runoff"],"x-enumDescriptions":{"general":"The endorsement is for a general, special or consolidated election.","primary":"The endorsement is for a primary or special primary.","runoff":"The endorsement is for a runoff."},"x-values":"stage"}}},"Position":{"type":"object","description":"One endorser’s position in a contest.","required":["endorser","picks"],"properties":{"endorser":{"$ref":"#/components/schemas/EndorserRef"},"picks":{"type":"array","description":"One pick for vote-for-one, up to N for vote-for-N, the ranking for ranked choice, Yes or No for a measure.","items":{"$ref":"#/components/schemas/Pick"}}}},"ContestDetail":{"allOf":[{"$ref":"#/components/schemas/Contest"},{"type":"object","required":["endorsements","rescinded_endorsements"],"properties":{"endorsements":{"type":"array","description":"Every (matching) endorser’s position, by endorser name.","items":{"$ref":"#/components/schemas/Position"}},"rescinded_endorsements":{"type":"array","description":"Endorsements (from matching endorsers) that the endorser took back, by endorser name. Not counted in endorsements.","items":{"$ref":"#/components/schemas/RescindedEndorsement"}}}}]},"BallotLookupInput":{"type":"object","description":"What to look up: an address, or a point.","required":[],"properties":{"address":{"type":"string","description":"A street address with a house number, on one line: \"1 Dr Carlton B Goodlett Pl, San Francisco, CA 94102\". Include the city and state or the ZIP code. A ZIP code, city or state alone is refused. Send address, or latitude and longitude.","maxLength":200},"latitude":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude of the place, instead of an address (WGS 84 degrees)."},"longitude":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude of the place, with latitude."},"elections":{"type":"array","description":"Only these elections (slugs, from GET /v1/elections), up to 20. A date and type (2026-11-03-general) matches every election of that type that day nationwide, and a bare date (2026-11-03) every election that day. Leave it out for every election from 60 days ago on.","items":{"type":"string"}},"party":{"type":"string","description":"In a partisan primary, only this party’s contests (a party slug, like democratic) and the nonpartisan ones. Leave it out for every party’s contests.","examples":["democratic"]},"on_ballot":{"type":"boolean","description":"true for only the contests printed on the ballot (what the voter will see); false for only the races left off it (unopposed or cancelled). Leave it out for both.","examples":[true]},"lang":{"type":"string","description":"es for Spanish ballot text where the state publishes it; English otherwise.","enum":["en","es"],"x-enumDescriptions":{"en":"English (the default).","es":"Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English where it doesn’t. Names are never translated."},"x-values":"lang","default":"en"}}},"BallotDistrict":{"type":"object","description":"A district the address is in, on today’s lines.","required":["id","ocd_id","name","level","type","state"],"properties":{"id":{"type":"integer","description":"District id: matches a contest’s district_id and district.id elsewhere."},"ocd_id":{"type":["string","null"],"description":"Open Civic Data division id, used in districts= filters."},"name":{"type":"string","description":"District name."},"level":{"type":"string","description":"Level of government.","enum":["federal","state","county","city","school","special"],"x-enumDescriptions":{"federal":"The whole country, or a U.S. House district.","state":"A whole state, or a state legislative, judicial or other state district.","county":"A county (a parish in Louisiana, a borough in Alaska) or a district within one.","city":"A city, town, township, village or borough, or a ward or council district within one.","school":"A school district, community college district, or a trustee area within one.","special":"A special district: water, fire, hospital, park, transit, port, conservation and the like."},"x-values":"district-level"},"type":{"type":"string","description":"Kind of district: statewide, congressional, state_upper, state_lower, county, council, school, …","x-enumDescriptions":{"airport_authority":"An airport authority’s district. Example: Hall County Airport Authority.","anc_smd":"A single-member district of a Washington, D.C. Advisory Neighborhood Commission. Example: ANC 1A01.","annexation_area":"The area a proposed annexation would add to a city. Example: Tucker annexation area (SB 622).","appellate_district":"A state appellate court district. Example: Illinois Appellate Court, First District.","appraisal_district":"A property appraisal district. Example: Collin Central Appraisal District.","assistance_district":"A county assistance district (Texas), proposed or in place. Example: Carson County Assistance District (proposed; Carson County outside Panhandle, White Deer, Groom, Skellytown and Fritch).","board_district":"A member district of a local board (a city, utility or similar board). Example: Hot Springs Board District 2.","board_of_education_district":"A member district of a county or city board of education. Example: Anderson County Board of Education District 1.","board_of_equalization":"A district of a state board of equalization (California’s tax board). Example: State Board of Equalization District 2.","board_of_regents":"A district of a state university’s board of regents. Example: University of Nebraska Board of Regents District 1.","board_of_review_district":"A district of a county property-tax board of review. Example: Cook County Board of Review District 1.","cemetery_district":"A cemetery district. Example: Chugwater Cemetery District.","chancery_court_district":"A chancery court district (Mississippi, Tennessee). Example: 1st Chancery Court District.","chancery_court_district_subdistrict":"A subdistrict that elects one chancery judge. Example: Chancery Court Subdistrict 5-1.","circuit_court":"A circuit court’s circuit. Example: 6th Judicial Circuit.","circuit_court_district":"A circuit court district. Example: 1st Circuit Court District.","circuit_court_district_subdistrict":"A subdistrict that elects one circuit judge. Example: Circuit Court Subdistrict 4-1.","city":"A whole city. Example: City of Oakland.","city_council":"A city council district. Example: Portland District 4.","college":"A community college district. Example: Grossmont-Cuyamaca Community College District.","college_district":"A community college district. Example: Collin County Community College District.","commission":"A county commission, or a district of one. Example: Clay County Commission, Eastern District.","commission_district":"A county or city commission district. Example: Jefferson County Commission District 1.","commissioner_district":"A county commissioner district. Example: El Paso County Commissioner District 1.","commissioner_precinct":"A county commissioners court precinct (Texas). Example: Travis County Commissioners Precinct 2.","community_college":"A community college district. Example: San Francisco Community College District.","community_college_district":"A community college district. Example: Lansing Community College.","congressional":"A U.S. House district (or a whole state with one at-large seat). Example: California Congressional District 11.","conservancy_district":"A conservancy (water) district. Example: Garrison Diversion Conservancy District, Wells County.","conservation_district":"A conservation district. Example: Minnehaha Conservation District.","constable_district":"A constable’s district. Example: Washington County Constable District 1.","constable_precinct":"A constable precinct (Texas). Example: Travis County Constable Precinct 4.","council":"A city or county council district. Example: City of Oakland Council District 2.","council_district":"A city or county council district. Example: Austin City Council District 1.","county":"A whole county (parish, borough), or a consolidated city and county. Example: City and County of San Francisco.","county_budget_committee":"A county budget committee district. Example: Knox County Budget Committee District 6.","county_commission":"A county commission or board of supervisors district. Example: Yavapai County Board of Supervisors District 2.","county_commission_district":"A county commission district. Example: Blount County Commission District 4.","county_council":"A county council district. Example: Cuyahoga County Council District 1.","county_council_district":"A county council district. Example: Franklin County Council/Commissioner District 3.","county_court_district":"A county court district. Example: Hinds County Court District 1.","county_division":"A division of a county with its own courthouse or offices (Bessemer, Alabama). Example: Bessemer Division of Jefferson County.","county_part":"The part of a county outside (or inside) certain cities, for a contest voted on only there. Example: Fayette County outside Somerville, Oakland, Piperton and Rossville.","court_district":"The district of a city, municipal or other local court. Example: Lafayette City Court.","court_of_appeal":"A state court of appeal circuit (Louisiana). Example: Louisiana 1st Circuit Court of Appeal.","court_of_appeal_district":"An election district within a court of appeal circuit. Example: 1st Circuit Court of Appeal, District 2.","court_of_appeals":"A state court of appeals district. Example: Fifteenth Court of Appeals District (statewide).","court_of_appeals_district":"A state court of appeals district. Example: Kentucky Court of Appeals District 3.","court_of_appeals_division":"A division of a state court of appeals. Example: Washington Court of Appeals Division 3.","district":"A seat or district of a local board or special district. Example: Beach Mosquito Control District, Seat 2.","district_attorney":"A district attorney’s district. Example: Berkshire District Attorney District.","district_attorney_district":"A district attorney’s district. Example: 17th Circuit Court District (District Attorney).","district_court":"A district court’s district. Example: Kittitas County District Court, Lower County.","district_court_district":"A district court’s district. Example: 14A District Court.","division":"A division (member district) of a special district. Example: Fallbrook Public Utility District Division 2.","educational_service_unit":"An educational service unit district (Nebraska). Example: Educational Service Unit 1 District 1.","election_district":"A county election district. Example: Montgomery County Election District 12 (Damascus).","emergency_services_district":"An emergency services district. Example: Wheeler County Emergency Services District No. 1.","ems_district":"An emergency medical services district. Example: Glendo Emergency Services District.","executive_council":"A district of New Hampshire’s Executive Council. Example: New Hampshire Executive Council District 1.","fire":"A fire protection district. Example: Sni Valley Fire Protection District.","fire_district":"A fire district. Example: Union Grove Volunteer Fire District 16.","fire_protection_district":"A fire protection district. Example: Newport Township Fire Protection District.","forest_preserve_district":"A forest preserve district (Illinois). Example: Forest Preserve District of DuPage County.","gid":"A general improvement district (Nevada). Example: Incline Village General Improvement District.","governors_council":"A district of the Massachusetts Governor’s Council. Example: Massachusetts Governor's Council District 1.","hospital_district":"A hospital district. Example: North Pine Area Hospital District.","judicial":"A judicial district or circuit. Example: Court of Appeal, First Appellate District.","judicial_circuit":"A judicial circuit. Example: 7th Judicial Circuit.","judicial_district":"A judicial district. Example: 207th Judicial District.","judicial_subcircuit":"A judicial subcircuit (Illinois). Example: DuPage County (18th Circuit) Judicial Subcircuit 4.","justice_court":"A justice court’s district. Example: Roy/Weber County Justice Court.","justice_court_district":"A justice court district. Example: Lauderdale County Justice Court District 2.","justice_precinct":"A justice of the peace precinct. Example: Travis County Justice of the Peace Precinct 1.","learning_community_subcouncil":"A subcouncil district of Nebraska’s Learning Community. Example: Learning Community of Douglas and Sarpy Counties Subcouncil 1.","legislative":"A legislative district (Nebraska’s one-house Legislature). Example: Nebraska Legislative District 2.","library_district":"A library district. Example: Vernon Area Public Library District.","magistrate":"A magistrate district. Example: Doña Ana County Magistrate District 1.","magistrate_district":"A magistrate or magisterial district. Example: Jefferson County Magisterial District 1.","mental_health_district":"A mental health services district. Example: Proposed Mid-Northside Expanded Mental Health Services Program territory.","municipality":"A whole municipality: a city, borough, town or village. Example: East Newark Borough.","natural_resources_district":"A natural resources district or subdistrict (Nebraska). Example: Papio-Missouri River NRD Subdistrict 2.","nursing_home":"A nursing home district. Example: Golden Age Nursing Home District.","park_district":"A park district. Example: Hennepin County Park District 1.","pec_district":"A Public Education Commission district (New Mexico). Example: Public Education Commission District 1.","place":"A whole city or town (a Census place). Example: City of Camp Verde.","port_district":"A port district. Example: Grant County Port Dist #4.","precinct":"A single voting precinct. Example: Chicago Ward 7, Precinct 13.","precinct_group":"A group of voting precincts. Example: Chicago Ward 7 Precinct 14 and Ward 10 Precincts 2 and 4.","probate_district":"A probate court district. Example: Tobacco Valley Probate District.","prosecutorial":"A prosecutorial district. Example: Prosecutorial District 1 (York County).","prosecutorial_district":"A prosecutorial district. Example: Prosecutorial District 17.","psc_district":"A public service commission district. Example: Montana Public Service Commission District 1.","public_power_district":"A public power district or subdivision (Nebraska). Example: Omaha Public Power District Subdivision 1.","public_service_commission":"A public service commission district. Example: Louisiana Public Service Commission District 1.","public_service_district":"A public service commission district. Example: Mississippi Central Public Service Commission District.","public_utility_district":"A public utility district. Example: Lincoln County Public Utility District.","quorum_court_district":"A quorum court district (Arkansas’s county legislature). Example: Pulaski County Quorum Court District 1.","reclamation_district":"A reclamation district or subdivision. Example: Twin Loups Reclamation District Subdivision 1.","regents_district":"A board of regents district. Example: Board of Regents District 2.","regional":"A region made of several counties or cities, for a regional measure. Example: Regional Transit Measure area (Alameda, Contra Costa, San Francisco, San Mateo, Santa Clara).","regional_office_of_education":"A regional office of education (Illinois). Example: Regional Office of Education 4 (Boone and Winnebago Counties).","registry_district":"A registry of deeds district. Example: Aroostook County Registry of Deeds, Northern District.","road":"A road district. Example: Stone County Northern Road District.","rtm_district":"A Representative Town Meeting district (Connecticut). Example: Darien RTM District 1.","sanitary_district":"A sanitary district. Example: East Joliet Sanitary District.","sboe":"A state board of education district. Example: Kansas State Board of Education District 10.","sboe_district":"A state board of education district. Example: Nevada State Board of Education District 1.","school":"A school district (or a whole district, for a district-wide seat). Example: San Francisco Unified School District.","school_board":"A school board member district. Example: Matanuska-Susitna Borough School District, School Board District 3.","school_board_district":"A school board member district. Example: Jefferson County Board of Education District 4.","school_district":"A whole school district. Example: Princeton Independent School District.","school_district_area":"A residence or trustee area of a school district. Example: LCSD 1 Residence Area 1.","school_subdistrict":"A school board subdistrict. Example: Omaha Public Schools Subdistrict 8.","school_tax_district":"A school tax or attendance district. Example: Odenville School Attendance and Tax District.","school_zone":"A school board zone. Example: Conway Public Schools Zone 3.","service_district":"A service district (senior citizens, recreation and the like). Example: Natrona County Senior Citizens Service District.","sewer_district":"A sewer district. Example: West Side Sewer District.","sldl":"A district of the lower house of the state legislature. Example: Arizona State House District 1.","sldu":"A district of the upper house (state senate). Example: Colorado State Senate District 10.","soil_conservation_district":"A soil conservation district. Example: Cass County Soil Conservation District.","soil_water_district":"A soil and water conservation district. Example: Aitkin County Soil and Water Conservation District.","special":"A special district: library, water, fire, park, transit and the like. Example: Altadena Library District.","special_district":"A special district. Example: Tarrant Appraisal District.","state":"A whole state. Example: Nevada.","state_board_of_education":"A state board of education district. Example: Texas State Board of Education District 2.","state_house":"A state house district (the lower house). Example: South Carolina House District 1.","state_lower":"A district of the lower house of the state legislature. Example: State Assembly District 17.","state_upper":"A district of the upper house (state senate). Example: State Senate District 2.","statewide":"A whole state. Example: California.","superior_court":"A superior court’s district. Example: Superior Court of Ferry, Pend Oreille and Stevens Counties.","superior_court_district":"A superior court district. Example: Superior Court District 17.","supervisorial":"A county (or city and county) supervisorial district. Example: Supervisorial District 2.","supreme_court_district":"A state supreme court district. Example: Kentucky Supreme Court District 3.","tax_district":"A tax district. Example: Fulton County outside the City of Atlanta.","town":"A whole town. Example: Town of Carmel.","township":"A township. Example: Pulaski County, Big Rock Township (Constable).","transit":"A transit district’s member district. Example: BART District 8.","transit_district":"A transit district or its director district. Example: RTD Director District B.","transportation_district":"A transportation district (a transportation benefit district, for example). Example: Chelan Transportation Benefit District.","trustee_area":"A trustee area of a school or college district. Example: Grossmont-Cuyamaca Community College District Trustee Area 5.","trustee_district":"A trustee district of a school district. Example: Austin ISD Trustee District 1.","tv_district":"A television district (Nevada’s TV translator districts). Example: Verdi Television District.","utility_district":"A utility district. Example: Horizon Regional MUD, Mountain Shadow Unit 1 Defined Area.","village":"A whole village. Example: Village of Brewster.","ward":"A city ward. Example: Little Rock Ward 1.","water":"A water supply district. Example: Stone County Public Water Supply District No. 1.","water_district":"A water district. Example: Lower Valley Water District.","water_reclamation_district":"A water reclamation district. Example: Metropolitan Water Reclamation District of Greater Chicago.","water_sewer_district":"A water and sewer district. Example: Jamestown/Rio Vista Water and Sewer District.","watershed_district":"A watershed district. Example: South Tyger River Watershed Conservation District."},"x-values":"district-type"},"state":{"type":["string","null"],"pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}}},"BallotChoice":{"type":"object","description":"A line on the ballot, in brief.","required":["id","slug","label","measure_answer","party","ballot_designation","incumbent","withdrawn","candidate_id","endorsement_count","winner"],"properties":{"id":{"type":"integer","description":"Choice id: the choice_id endorsements refer to."},"slug":{"type":"string","description":"Permanent choice slug: the contest’s slug, a slash, then the ballot name’s, or yes / no (…/member-state-assembly-district-17/jane-q-doe, …/prop-50/yes)."},"label":{"type":"string","description":"As printed: the candidate’s ballot name, or Yes / No."},"measure_answer":{"type":["string","null"],"description":"yes or no for a measure or retention question; null for a candidate.","enum":["yes","no",null],"x-enumDescriptions":{"yes":"The Yes line of a measure or retention question. On an endorsement: the endorser says vote Yes.","no":"The No line. On an endorsement: the endorser says vote No."},"x-values":"measure-answer"},"party":{"type":["string","null"],"description":"The party (or party preference) as printed beside the name; null where none is printed."},"ballot_designation":{"type":["string","null"],"description":"Occupation line printed under the name, e.g. “Transit Planner”."},"incumbent":{"type":["boolean","null"],"description":"The candidate holds this seat now: true or false where we know, null where we don’t yet (and for a measure answer)."},"withdrawn":{"type":"boolean","description":"The candidate withdrew but is still printed on the ballot."},"candidate_id":{"type":["integer","null"],"description":"The candidate (GET /v1/candidates/{id}); null for a measure answer."},"endorsement_count":{"type":"integer","description":"Endorsers who endorsed this choice (for a measure: who back this answer)."},"winner":{"type":["boolean","null"],"description":"true for a winner, false for a choice that lost, null when there is no result yet or it doesn’t say (GET /v1/contests/{id} has the votes)."}}},"BallotContest":{"type":"object","description":"A contest on the ballot, in brief.","required":["id","slug","title","short_title","kind","vote_method","votes_allowed","ranks_allowed","measure_code","office","race_type","partisan","party","unopposed","on_ballot","off_ballot_reason","district_id","endorsement_count","result_status","choices"],"properties":{"id":{"type":"integer","description":"Contest id: GET /v1/contests/{id} has the contest in full, with every endorser’s position."},"slug":{"type":"string","description":"Contest slug."},"title":{"type":"string","description":"Title as printed on the ballot."},"short_title":{"type":["string","null"],"description":"Shorter title."},"kind":{"type":"string","description":"candidate (an office), measure (a proposition) or retention (keep a judge?).","enum":["candidate","measure","retention"],"x-enumDescriptions":{"candidate":"A race for an office: voters choose among candidates.","measure":"A ballot measure (proposition, amendment, bond, tax, referendum or initiative): voters answer Yes or No.","retention":"A judicial retention question: should this judge stay in office? Voters answer Yes or No."},"x-values":"contest-kind"},"vote_method":{"type":"string","description":"How votes are cast: plurality (vote for one), multi_seat (vote for up to votes_allowed), ranked_choice (rank up to ranks_allowed), approval, or yes_no.","enum":["plurality","multi_seat","ranked_choice","approval","yes_no"],"x-enumDescriptions":{"plurality":"Vote for one: the candidate with the most votes wins (or goes to a runoff where a majority is required).","multi_seat":"Vote for up to N (votes_allowed): several seats are filled at once and the top N win.","ranked_choice":"Ranked choice: voters rank up to ranks_allowed candidates; endorsements carry the endorser’s rank 1, 2, 3…. rcv_rounds holds the official tabulation once there is one.","approval":"Approval voting: voters mark every candidate they approve of; the most-approved win (Fargo, St. Louis).","yes_no":"A Yes or No question: every measure and retention question."},"x-values":"vote-method"},"votes_allowed":{"type":["integer","null"],"description":"How many choices a voter may mark (vote for N)."},"ranks_allowed":{"type":["integer","null"],"description":"Ranked choice: how many choices a voter may rank."},"measure_code":{"type":["string","null"],"description":"The measure’s letter or number: “K”, “Prop 1”."},"office":{"description":"The office a candidate or retention contest fills; null for a measure.","oneOf":[{"$ref":"#/components/schemas/Office"},{"type":"null"}]},"race_type":{"type":["string","null"],"description":"regular (a full term), special (the rest of an unexpired term, or a special election), recall, or retention (keep a judge?); null for a measure.","enum":["regular","special","recall","retention",null],"x-enumDescriptions":{"regular":"An election for a full term on the regular schedule.","special":"An election for the rest of an unexpired term, or a contest in a special election.","recall":"A recall: whether to remove an officeholder before the term ends (and, where the ballot has one, who replaces them).","retention":"A judicial retention question."},"x-values":"race-type"},"partisan":{"type":["boolean","null"],"description":"Candidates run with a party label on the ballot; null for a measure or retention question."},"party":{"description":"For a party primary, the party whose ballot it is on.","oneOf":[{"$ref":"#/components/schemas/Party"},{"type":"null"}]},"unopposed":{"type":"boolean","description":"A candidate contest with no more candidates still running than seats. Always false for measures."},"on_ballot":{"type":"boolean","description":"Printed on the ballot. false for a race the state or county left off, usually because it was unopposed and the candidates were declared elected; off_ballot_reason says why. endorsedby.org shows only contests on the ballot; filter with on_ballot=true for the same."},"off_ballot_reason":{"type":["string","null"],"description":"Why the contest is not on the ballot: unopposed or cancelled. null when on_ballot is true.","enum":["unopposed","cancelled",null],"x-enumDescriptions":{"unopposed":"No more candidates filed than seats, so the state or county left the race off the ballot and declared them elected.","cancelled":"Left off the ballot for another reason: nobody filed, the seat was filled by appointment, or the election was called off."},"x-values":"off-ballot-reason"},"district_id":{"type":"integer","description":"The district it is voted in: one of districts[].id."},"endorsement_count":{"type":"integer","description":"Endorsers who took a position in this contest."},"result_status":{"type":["string","null"],"description":"unofficial or certified once a source has a result; null before then.","enum":["unofficial","certified",null],"x-enumDescriptions":{"unofficial":"Election-night and canvass counts: still changing. We read them again every day until they’re certified.","certified":"The canvass is certified: the final official count."},"x-values":"result-status"},"choices":{"type":"array","description":"Every choice, in ballot order.","items":{"$ref":"#/components/schemas/BallotChoice"}}}},"BallotElection":{"type":"object","description":"One election on the ballot at the address.","required":["election","contests","contests_outside_purchase"],"properties":{"election":{"$ref":"#/components/schemas/Election"},"contests":{"type":"array","description":"The contests on this ballot, in ballot order: federal, state, then local offices, then measures.","items":{"$ref":"#/components/schemas/BallotContest"}},"contests_outside_purchase":{"type":"integer","description":"Contests on this ballot in a state or election your account hasn’t bought: counted, not shown."}}},"BallotLookup":{"type":"object","description":"The ballot at an address: its districts, and the contests on each election’s ballot there.","required":["state","matched_address","districts","elections"],"properties":{"state":{"type":["string","null"],"pattern":"^[A-Z]{2}$","description":"The state the address is in.","examples":["CA"]},"matched_address":{"type":["string","null"],"description":"The address as the Census Bureau’s geocoder matched it, to check it is the right place; null for a point."},"districts":{"type":"array","description":"Every district we have that the address is in, on today’s lines, from federal down to special districts.","items":{"$ref":"#/components/schemas/BallotDistrict"}},"elections":{"type":"array","description":"The elections with contests at the address, earliest first. Empty when we have none for it.","items":{"$ref":"#/components/schemas/BallotElection"}}}},"RecordTally":{"type":"object","description":"How a set of an endorser’s picks did.","required":["contests","picks","won","lost","undecided","win_rate","avg_vote_pct","incumbent_picks","incumbent_won","non_incumbent_picks","non_incumbent_won"],"properties":{"contests":{"type":"integer","description":"Contests counted."},"picks":{"type":"integer","description":"Top picks in those contests: a ranked-choice endorsement’s first choice, every candidate of a vote-for-N slate, the Yes or No on a measure."},"won":{"type":"integer","description":"Picks whose choice won (the choice’s result.winner is true): the candidate was elected or advanced, or the measure answer carried."},"lost":{"type":"integer","description":"Picks whose choice lost (result.winner is false)."},"undecided":{"type":"integer","description":"Picks with no winner yet: no result, a result that doesn’t name winners, or a runoff to come."},"win_rate":{"type":["number","null"],"description":"won / (won + lost), 0 to 1, to three places; null until a pick is decided."},"avg_vote_pct":{"type":["number","null"],"description":"The average vote share (0 to 100) of the picked choices that have one; null if none does."},"incumbent_picks":{"type":"integer","description":"Picks of a candidate who holds the seat now."},"incumbent_won":{"type":"integer","description":"Of those, how many won."},"non_incumbent_picks":{"type":"integer","description":"Picks of a candidate known not to hold the seat (challengers and open seats). Picks where incumbency isn’t known, and measure answers, are in neither count."},"non_incumbent_won":{"type":"integer","description":"Of those, how many won."}}},"EndorserRecord":{"type":"object","description":"An endorser’s track record: how the choices they backed did.","required":["endorser","totals","by_kind","by_stage","elections"],"properties":{"endorser":{"$ref":"#/components/schemas/EndorserRef"},"totals":{"$ref":"#/components/schemas/RecordTally"},"by_kind":{"type":"array","description":"The same counts for each kind of contest.","items":{"allOf":[{"type":"object","required":["kind"],"properties":{"kind":{"type":"string","description":"candidate (an office), measure (a proposition) or retention (keep a judge?).","enum":["candidate","measure","retention"],"x-enumDescriptions":{"candidate":"A race for an office: voters choose among candidates.","measure":"A ballot measure (proposition, amendment, bond, tax, referendum or initiative): voters answer Yes or No.","retention":"A judicial retention question: should this judge stay in office? Voters answer Yes or No."},"x-values":"contest-kind"}}},{"$ref":"#/components/schemas/RecordTally"}]}},"by_stage":{"type":"array","description":"The same counts for each election stage: primary, runoff, general.","items":{"allOf":[{"type":"object","required":["stage"],"properties":{"stage":{"type":"string","description":"The election stage the endorsement is for: general, primary or runoff (from the election it is in).","enum":["general","primary","runoff"],"x-enumDescriptions":{"general":"The endorsement is for a general, special or consolidated election.","primary":"The endorsement is for a primary or special primary.","runoff":"The endorsement is for a runoff."},"x-values":"stage"}}},{"$ref":"#/components/schemas/RecordTally"}]}},"elections":{"type":"array","description":"The same counts for each election, newest first.","items":{"allOf":[{"type":"object","required":["election"],"properties":{"election":{"type":"object","description":"The election.","required":["slug","name","date","type"],"properties":{"slug":{"type":"string","description":"Election slug."},"name":{"type":"string","description":"Election name."},"date":{"type":"string","description":"Election day.","format":"date"},"type":{"type":"string","description":"Kind of election.","enum":["general","primary","special","special_primary","runoff","consolidated"],"x-enumDescriptions":{"general":"A general election: the November election (or a state’s regular election day) that fills offices and decides measures.","primary":"A primary: voters choose each party’s nominee, or (in top-two and Louisiana-style states) the candidates who go on to the general.","special":"A special election held outside the regular schedule, usually to fill a vacancy or decide a measure.","special_primary":"The primary for a special election.","runoff":"A runoff between the leading candidates when no one won the earlier round outright (the share needed is in the contest’s details.majority_required or vote_required).","consolidated":"Several jurisdictions’ elections held together on one ballot (a city and school election on the same day, for example); details.consolidated_with names them."},"x-values":"election-type"}}}}},{"$ref":"#/components/schemas/RecordTally"}]}}}},"AgreementRow":{"type":"object","description":"How often one other endorser took the same side.","required":["endorser","shared_contests","agreed","partly_agreed","disagreed","agreement_rate"],"properties":{"endorser":{"$ref":"#/components/schemas/EndorserRef"},"shared_contests":{"type":"integer","description":"Contests both endorsers took a position in."},"agreed":{"type":"integer","description":"Of those, contests where both made the same top picks (the same candidate, the same slate, the same answer on a measure)."},"partly_agreed":{"type":"integer","description":"Contests where their picks overlap but differ: part of the same vote-for-N slate."},"disagreed":{"type":"integer","description":"Contests where they have no top pick in common."},"agreement_rate":{"type":"number","description":"agreed / shared_contests, 0 to 1, to three places."}}},"EndorserAgreement":{"type":"object","description":"How often other endorsers agree with one endorser.","required":["endorser","contests","compared"],"properties":{"endorser":{"$ref":"#/components/schemas/EndorserRef"},"contests":{"type":"integer","description":"Contests this endorser took a position in, with the filters applied."},"compared":{"type":"array","description":"Other endorsers who took positions in the same contests, most contests in common first (then highest agreement).","items":{"$ref":"#/components/schemas/AgreementRow"}}}},"Endorsement":{"type":"object","description":"The basics of an endorsement.","required":["id","rank","published_on","first_seen_on","date_source","added_by","stage","endorser","contest","election","choice"],"properties":{"id":{"type":"integer","description":"Endorsement id: GET /v1/endorsements/{id} has the full record."},"rank":{"type":["integer","null"],"description":"Ranked choice: the rank the endorser gave; null otherwise."},"published_on":{"type":["string","null"],"description":"When it was published.","format":"date"},"first_seen_on":{"type":["string","null"],"description":"The earliest date the endorsement can be shown to have been public: the date its page or press release gives. null where we couldn’t date it; published_on is the date the endorser printed, when it printed one.","format":"date"},"date_source":{"type":["string","null"],"description":"Where first_seen_on came from: page (the endorsement page’s own publication date) or press_release; null when first_seen_on is.","enum":["page","press_release","archive","feed",null],"x-enumDescriptions":{"page":"The endorsement page’s own publication date (its published date in the page’s metadata, or the date printed on it).","press_release":"The date on the endorser’s press release.","archive":"The earliest Internet Archive capture that shows the endorsement. An upper bound: the endorsement may be older. Not used yet.","feed":"The date of the endorser’s RSS or Atom feed entry. Not used yet."},"x-values":"date-source"},"added_by":{"type":"string","description":"How the endorsement got here: automatic (added by our automatic watch of the endorser’s own page), staff (entered by hand by BallotData staff) or data_load (loaded in a researched data pass).","enum":["automatic","staff","data_load"],"x-enumDescriptions":{"automatic":"Added by our automatic watch of the endorser’s own website. It only adds a candidate the endorser’s own page names for that election; source_url is that page.","staff":"Entered by hand by BallotData staff.","data_load":"Loaded in one of our researched data passes."},"x-values":"added-by"},"stage":{"type":"string","description":"The election stage the endorsement is for: general, primary or runoff (from the election it is in).","enum":["general","primary","runoff"],"x-enumDescriptions":{"general":"The endorsement is for a general, special or consolidated election.","primary":"The endorsement is for a primary or special primary.","runoff":"The endorsement is for a runoff."},"x-values":"stage"},"endorser":{"type":"object","description":"Who made the endorsement.","required":["id","slug","name"],"properties":{"id":{"type":"integer","description":"Endorser id."},"slug":{"type":"string","description":"Endorser slug."},"name":{"type":"string","description":"Endorser name."}}},"contest":{"type":"object","description":"The contest.","required":["id","slug","title"],"properties":{"id":{"type":"integer","description":"Contest id."},"slug":{"type":"string","description":"Contest slug."},"title":{"type":"string","description":"Title as printed on the ballot."}}},"election":{"type":"object","description":"The contest’s election.","required":["id","slug","date"],"properties":{"id":{"type":"integer","description":"Election id."},"slug":{"type":"string","description":"Election slug."},"date":{"type":"string","description":"Election day.","format":"date"}}},"choice":{"type":"object","description":"The choice endorsed.","required":["id","slug","label","measure_answer"],"properties":{"id":{"type":"integer","description":"Choice id."},"slug":{"type":"string","description":"Choice slug."},"label":{"type":"string","description":"As printed: the candidate’s ballot name, or Yes / No."},"measure_answer":{"type":["string","null"],"description":"yes or no for a measure; null for a candidate.","enum":["yes","no",null],"x-enumDescriptions":{"yes":"The Yes line of a measure or retention question. On an endorsement: the endorser says vote Yes.","no":"The No line. On an endorsement: the endorser says vote No."},"x-values":"measure-answer"}}}}},"EndorsementDetail":{"type":"object","description":"An endorsement in full.","required":["id","rank","statement","source_url","published_on","first_seen_on","date_source","retrieved_at","added_by","stage","endorser","contest","choice"],"properties":{"id":{"type":"integer","description":"Endorsement id."},"rank":{"type":["integer","null"],"description":"Ranked choice: the rank the endorser gave; null otherwise."},"statement":{"type":["string","null"],"description":"What the endorser said."},"source_url":{"type":["string","null"],"description":"Where it was published.","format":"uri"},"published_on":{"type":["string","null"],"description":"When it was published.","format":"date"},"first_seen_on":{"type":["string","null"],"description":"The earliest date the endorsement can be shown to have been public: the date its page or press release gives. null where we couldn’t date it; published_on is the date the endorser printed, when it printed one.","format":"date"},"date_source":{"type":["string","null"],"description":"Where first_seen_on came from: page (the endorsement page’s own publication date) or press_release; null when first_seen_on is.","enum":["page","press_release","archive","feed",null],"x-enumDescriptions":{"page":"The endorsement page’s own publication date (its published date in the page’s metadata, or the date printed on it).","press_release":"The date on the endorser’s press release.","archive":"The earliest Internet Archive capture that shows the endorsement. An upper bound: the endorsement may be older. Not used yet.","feed":"The date of the endorser’s RSS or Atom feed entry. Not used yet."},"x-values":"date-source"},"retrieved_at":{"type":"string","description":"When we collected it.","format":"date-time"},"added_by":{"type":"string","description":"How the endorsement got here: automatic (added by our automatic watch of the endorser’s own page), staff (entered by hand by BallotData staff) or data_load (loaded in a researched data pass).","enum":["automatic","staff","data_load"],"x-enumDescriptions":{"automatic":"Added by our automatic watch of the endorser’s own website. It only adds a candidate the endorser’s own page names for that election; source_url is that page.","staff":"Entered by hand by BallotData staff.","data_load":"Loaded in one of our researched data passes."},"x-values":"added-by"},"stage":{"type":"string","description":"The election stage the endorsement is for: general, primary or runoff (from the election it is in).","enum":["general","primary","runoff"],"x-enumDescriptions":{"general":"The endorsement is for a general, special or consolidated election.","primary":"The endorsement is for a primary or special primary.","runoff":"The endorsement is for a runoff."},"x-values":"stage"},"endorser":{"type":"object","description":"Who made the endorsement.","required":["id","slug","name","category","description","website_url","logo_url","state","party"],"properties":{"id":{"type":"integer","description":"Endorser id."},"slug":{"type":"string","description":"Endorser slug."},"name":{"type":"string","description":"Endorser name."},"category":{"$ref":"#/components/schemas/Category"},"description":{"type":["string","null"],"description":"About the endorser."},"website_url":{"type":["string","null"],"description":"Endorser’s website.","format":"uri"},"logo_url":{"type":["string","null"],"description":"The endorser’s logo image.","format":"uri"},"state":{"type":["string","null"],"pattern":"^[A-Z]{2}$","description":"Home state; null for national endorsers.","examples":["CA"]},"party":{"description":"The party, for a party or party club.","oneOf":[{"$ref":"#/components/schemas/Party"},{"type":"null"}]}}},"contest":{"$ref":"#/components/schemas/ContestBase","description":"The contest, with its district and election."},"choice":{"$ref":"#/components/schemas/Choice","description":"The choice endorsed, with its candidate."}}},"HistoryValues":{"type":"object","description":"An endorsement’s values at one point in time.","required":["choice_id","choice_label","rank","statement","source_url","published_on"],"properties":{"choice_id":{"type":"integer","description":"The choice endorsed."},"choice_label":{"type":["string","null"],"description":"That choice’s label as printed; null if the choice has since been removed from the ballot."},"rank":{"type":["integer","null"],"description":"Ranked choice: the rank; null otherwise."},"statement":{"type":["string","null"],"description":"What the endorser said."},"source_url":{"type":["string","null"],"description":"Where it was published.","format":"uri"},"published_on":{"type":["string","null"],"description":"When it was published.","format":"date"}}},"HistoryEntry":{"type":"object","description":"One change to an endorsement.","required":["at","change","changed","before","after"],"properties":{"at":{"type":"string","description":"When the change was made. For endorsements collected before we kept history (October 27, 2026), created is when we collected it.","format":"date-time"},"change":{"type":"string","description":"What happened to the endorsement: created, updated or deleted.","enum":["created","updated","deleted"],"x-enumDescriptions":{"created":"A new endorsement.","updated":"An existing endorsement changed; changed lists the fields.","deleted":"The endorsement was withdrawn by the endorser or removed by us."},"x-values":"change"},"changed":{"type":"array","description":"For updated: the fields that changed. Empty otherwise.","items":{"type":"string","enum":["choice_id","rank","statement","source_url","published_on"],"x-enumDescriptions":{"choice_id":"The endorser now backs a different choice in the same contest.","rank":"The ranked-choice rank changed.","statement":"What the endorser said changed.","source_url":"Where it was published changed.","published_on":"The publication date changed."},"x-values":"changed-field"}},"before":{"description":"The values before the change; null for created.","oneOf":[{"$ref":"#/components/schemas/HistoryValues"},{"type":"null"}]},"after":{"description":"The values after the change; null for deleted.","oneOf":[{"$ref":"#/components/schemas/HistoryValues"},{"type":"null"}]}}},"CandidateContest":{"type":"object","description":"A contest a candidate is on.","required":["contest","district","election","choice","result","endorsement_count"],"properties":{"contest":{"type":"object","description":"The contest.","required":["id","slug","title","kind","vote_method","votes_allowed","ranks_allowed","office","race_type"],"properties":{"id":{"type":"integer","description":"Contest id."},"slug":{"type":"string","description":"Contest slug."},"title":{"type":"string","description":"Title as printed on the ballot."},"kind":{"type":"string","description":"candidate or retention.","enum":["candidate","measure","retention"],"x-enumDescriptions":{"candidate":"A race for an office: voters choose among candidates.","measure":"A ballot measure (proposition, amendment, bond, tax, referendum or initiative): voters answer Yes or No.","retention":"A judicial retention question: should this judge stay in office? Voters answer Yes or No."},"x-values":"contest-kind"},"vote_method":{"type":"string","description":"How votes are cast.","enum":["plurality","multi_seat","ranked_choice","approval","yes_no"],"x-enumDescriptions":{"plurality":"Vote for one: the candidate with the most votes wins (or goes to a runoff where a majority is required).","multi_seat":"Vote for up to N (votes_allowed): several seats are filled at once and the top N win.","ranked_choice":"Ranked choice: voters rank up to ranks_allowed candidates; endorsements carry the endorser’s rank 1, 2, 3…. rcv_rounds holds the official tabulation once there is one.","approval":"Approval voting: voters mark every candidate they approve of; the most-approved win (Fargo, St. Louis).","yes_no":"A Yes or No question: every measure and retention question."},"x-values":"vote-method"},"votes_allowed":{"type":["integer","null"],"description":"Vote for N."},"ranks_allowed":{"type":["integer","null"],"description":"Ranked choice: how many choices a voter may rank."},"office":{"description":"The office the contest fills.","oneOf":[{"$ref":"#/components/schemas/Office"},{"type":"null"}]},"race_type":{"type":["string","null"],"description":"regular, special, recall or retention.","enum":["regular","special","recall","retention",null],"x-enumDescriptions":{"regular":"An election for a full term on the regular schedule.","special":"An election for the rest of an unexpired term, or a contest in a special election.","recall":"A recall: whether to remove an officeholder before the term ends (and, where the ballot has one, who replaces them).","retention":"A judicial retention question."},"x-values":"race-type"}}},"district":{"type":"object","description":"The district the contest is voted in.","required":["id","ocd_id","name","level","state"],"properties":{"id":{"type":"integer","description":"District id."},"ocd_id":{"type":["string","null"],"description":"Open Civic Data division id."},"name":{"type":"string","description":"District name."},"level":{"type":"string","description":"Level of government.","enum":["federal","state","county","city","school","special"],"x-enumDescriptions":{"federal":"The whole country, or a U.S. House district.","state":"A whole state, or a state legislative, judicial or other state district.","county":"A county (a parish in Louisiana, a borough in Alaska) or a district within one.","city":"A city, town, township, village or borough, or a ward or council district within one.","school":"A school district, community college district, or a trustee area within one.","special":"A special district: water, fire, hospital, park, transit, port, conservation and the like."},"x-values":"district-level"},"state":{"type":["string","null"],"pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}}},"election":{"type":"object","description":"The contest’s election.","required":["id","slug","name","date"],"properties":{"id":{"type":"integer","description":"Election id."},"slug":{"type":"string","description":"Election slug."},"name":{"type":"string","description":"Election name."},"date":{"type":"string","description":"Election day.","format":"date"}}},"choice":{"type":"object","description":"The line the candidate appears on in this contest.","required":["id","slug","label","ballot_designation","withdrawn","status","party","party_label","party_lines","result"],"properties":{"id":{"type":"integer","description":"Choice id."},"slug":{"type":"string","description":"Choice slug."},"label":{"type":"string","description":"The name as printed."},"ballot_designation":{"type":["string","null"],"description":"Occupation line printed under the name."},"withdrawn":{"type":"boolean","description":"Withdrew but still printed."},"status":{"type":"string","description":"on_ballot, withdrew_still_on_ballot, advanced (won a primary stage), won or lost.","enum":["on_ballot","withdrew_still_on_ballot","advanced","won","lost"],"x-enumDescriptions":{"on_ballot":"Printed on the ballot; no result yet, or the result names no winner.","withdrew_still_on_ballot":"Withdrew after the ballot was printed, so the name is still on it (withdrawn is true). Votes for them may still count.","advanced":"Won this primary stage and goes on to the next one (the general, or a runoff).","won":"Won the race: a general, special, runoff or consolidated election.","lost":"The certified result names winners and this candidate isn’t one."},"x-values":"choice-status"},"party":{"description":"The party printed beside the name.","oneOf":[{"$ref":"#/components/schemas/Party"},{"type":"null"}]},"party_label":{"type":["string","null"],"description":"The party text exactly as printed, where it differs."},"party_lines":{"type":"array","description":"Fusion: every party line they’re printed on, with votes per line where the source splits them; empty for one line.","items":{"$ref":"#/components/schemas/PartyLine"}},"result":{"description":"The candidate’s votes and whether they won, once the contest has a result.","oneOf":[{"$ref":"#/components/schemas/ChoiceResult"},{"type":"null"}]}}},"result":{"description":"The contest’s result, once a source has one.","oneOf":[{"$ref":"#/components/schemas/ContestResultBrief"},{"type":"null"}]},"endorsement_count":{"type":"integer","description":"Endorsers who endorsed this candidate in this contest."}}},"CandidateSummary":{"type":"object","required":["id","full_name","name","website_url","photo_url","incumbent","ids","contact","background","ideology","person","contests"],"properties":{"id":{"type":"integer","description":"Candidate id."},"full_name":{"type":"string","description":"Full name."},"name":{"$ref":"#/components/schemas/NameParts"},"website_url":{"type":["string","null"],"description":"Campaign website.","format":"uri"},"photo_url":{"type":["string","null"],"description":"A photo of the candidate.","format":"uri"},"incumbent":{"type":["boolean","null"],"description":"Holds the seat now: true or false where we know, null where we don’t yet."},"ids":{"$ref":"#/components/schemas/CandidateIds"},"contact":{"$ref":"#/components/schemas/Contact"},"background":{"$ref":"#/components/schemas/CandidateBackground"},"ideology":{"$ref":"#/components/schemas/CandidateIdeology"},"person":{"description":"The person across elections: other candidate records, other names, party switches.","oneOf":[{"$ref":"#/components/schemas/Person"},{"type":"null"}]},"contests":{"type":"array","description":"The contests they’re on that you can read, newest election first.","items":{"$ref":"#/components/schemas/CandidateContest"}}}},"CandidateEndorsement":{"type":"object","description":"One endorsement a candidate received.","required":["endorsement_id","endorser","rank","statement","source_url","published_on","first_seen_on","date_source","added_by","stage"],"properties":{"endorsement_id":{"type":"integer","description":"Endorsement id."},"endorser":{"$ref":"#/components/schemas/EndorserRef"},"rank":{"type":["integer","null"],"description":"Ranked choice: the rank the endorser gave; null otherwise."},"statement":{"type":["string","null"],"description":"What the endorser said."},"source_url":{"type":["string","null"],"description":"Where it was published.","format":"uri"},"published_on":{"type":["string","null"],"description":"When it was published.","format":"date"},"first_seen_on":{"type":["string","null"],"description":"The earliest date the endorsement can be shown to have been public: the date its page or press release gives. null where we couldn’t date it; published_on is the date the endorser printed, when it printed one.","format":"date"},"date_source":{"type":["string","null"],"description":"Where first_seen_on came from: page (the endorsement page’s own publication date) or press_release; null when first_seen_on is.","enum":["page","press_release","archive","feed",null],"x-enumDescriptions":{"page":"The endorsement page’s own publication date (its published date in the page’s metadata, or the date printed on it).","press_release":"The date on the endorser’s press release.","archive":"The earliest Internet Archive capture that shows the endorsement. An upper bound: the endorsement may be older. Not used yet.","feed":"The date of the endorser’s RSS or Atom feed entry. Not used yet."},"x-values":"date-source"},"added_by":{"type":"string","description":"How the endorsement got here: automatic (added by our automatic watch of the endorser’s own page), staff (entered by hand by BallotData staff) or data_load (loaded in a researched data pass).","enum":["automatic","staff","data_load"],"x-enumDescriptions":{"automatic":"Added by our automatic watch of the endorser’s own website. It only adds a candidate the endorser’s own page names for that election; source_url is that page.","staff":"Entered by hand by BallotData staff.","data_load":"Loaded in one of our researched data passes."},"x-values":"added-by"},"stage":{"type":"string","description":"The election stage the endorsement is for: general, primary or runoff (from the election it is in).","enum":["general","primary","runoff"],"x-enumDescriptions":{"general":"The endorsement is for a general, special or consolidated election.","primary":"The endorsement is for a primary or special primary.","runoff":"The endorsement is for a runoff."},"x-values":"stage"}}},"Issue":{"type":"object","description":"A policy issue candidates take positions on.","required":["slug","name","question","description"],"properties":{"slug":{"type":"string","description":"Issue slug, for issues= filters.","x-enumDescriptions":{"abortion":"Abortion. Should abortion be legal in most or all cases?","death-penalty":"Death penalty. Should the death penalty be allowed?","guns":"Gun laws. Should gun laws be made stricter?","immigration-enforcement":"Immigration enforcement. Should immigration enforcement be expanded, including large-scale deportations?","path-to-citizenship":"Path to citizenship. Should some undocumented immigrants, such as those brought here as children, be able to earn legal status or citizenship?","school-choice":"School choice. Should public money pay for private or religious school tuition (vouchers, education savings accounts, tax-credit scholarships)?","public-school-funding":"Public school funding. Should funding for public K-12 schools be increased?","social-security-medicare":"Social Security and Medicare. Should Social Security and Medicare benefits be protected from cuts?","medicaid-snap":"Medicaid and SNAP. Should Medicaid and SNAP (food assistance) be protected from cuts and new eligibility limits such as work requirements?","health-coverage":"Health coverage. Should government do more to provide health coverage (for example, keep enhanced ACA subsidies, expand Medicaid, or add a public option or Medicare for All)?","climate-clean-energy":"Climate and clean energy. Should government act to cut greenhouse gas emissions and speed the shift to clean energy?","taxes-high-earners":"Taxes on high earners and corporations. Should taxes be raised on high earners and corporations?","minimum-wage":"Minimum wage. Should the minimum wage be raised?","unions":"Labor unions. Should it be easier for workers to form unions and bargain collectively (for example, the PRO Act)?","lgbtq-protections":"LGBTQ protections. Should LGBTQ people have legal protection from discrimination (for example, the Equality Act)?","transgender-athletes":"Transgender athletes. Should school and college sports teams be limited by sex at birth?","criminal-justice":"Criminal justice. Should criminal-justice policy focus more on reducing incarceration (for example, sentencing reform, bail reform, alternatives to jail)?","marijuana":"Marijuana. Should recreational marijuana be legal?","voter-id":"Voter ID and proof of citizenship. Should voters have to show photo ID to vote, or prove citizenship to register?","tariffs":"Tariffs. Should the U.S. impose broad tariffs on imported goods?","ukraine-aid":"Aid to Ukraine. Should the U.S. keep providing military aid to Ukraine?","money-in-politics":"Money in politics. Should limits on money in politics be strengthened (for example, overturning Citizens United or banning corporate PAC money)?","congress-stock-trading":"Stock trading by members of Congress. Should members of Congress be banned from trading individual stocks?"},"x-values":"issue"},"name":{"type":"string","description":"Short name: “Abortion”."},"question":{"type":"string","description":"The yes/no question a position’s stance answers."},"description":{"type":"string","description":"What the issue covers."}}},"IssuePositionSource":{"type":"object","description":"A link a position was taken from.","required":["url","kind","publisher","title","published_on"],"properties":{"url":{"type":"string","description":"Where the position comes from.","format":"uri"},"kind":{"type":"string","description":"What kind of source: the candidate’s own site, an official roll-call vote record, an official statement, a published candidate questionnaire, a debate, or news reporting.","enum":["candidate_website","voting_record","official_statement","questionnaire","debate","news"],"x-enumDescriptions":{"candidate_website":"The candidate’s own campaign site.","voting_record":"An official roll-call vote record (Congress’s or a legislature’s).","official_statement":"An official statement: a press release or a statement from their office.","questionnaire":"A published candidate questionnaire.","debate":"A debate.","news":"News reporting quoting or describing the candidate."},"x-values":"issue-source-kind"},"publisher":{"type":"string","description":"Who published it: “U.S. Senate”, “The Atlanta Journal-Constitution”."},"title":{"type":["string","null"],"description":"The source’s title."},"published_on":{"type":["string","null"],"description":"When it was published, where known.","format":"date"}}},"IssuePosition":{"type":"object","description":"Where a candidate stands on one issue, as they stated it or as their votes in Congress show it. Never inferred from party or endorsements.","required":["id","issue","stance","summary","quote","checked_on","sources"],"properties":{"id":{"type":"integer","description":"Position id."},"issue":{"type":"object","description":"The issue (GET /v1/issues).","required":["slug","name"],"properties":{"slug":{"type":"string","description":"Issue slug.","x-enumDescriptions":{"abortion":"Abortion. Should abortion be legal in most or all cases?","death-penalty":"Death penalty. Should the death penalty be allowed?","guns":"Gun laws. Should gun laws be made stricter?","immigration-enforcement":"Immigration enforcement. Should immigration enforcement be expanded, including large-scale deportations?","path-to-citizenship":"Path to citizenship. Should some undocumented immigrants, such as those brought here as children, be able to earn legal status or citizenship?","school-choice":"School choice. Should public money pay for private or religious school tuition (vouchers, education savings accounts, tax-credit scholarships)?","public-school-funding":"Public school funding. Should funding for public K-12 schools be increased?","social-security-medicare":"Social Security and Medicare. Should Social Security and Medicare benefits be protected from cuts?","medicaid-snap":"Medicaid and SNAP. Should Medicaid and SNAP (food assistance) be protected from cuts and new eligibility limits such as work requirements?","health-coverage":"Health coverage. Should government do more to provide health coverage (for example, keep enhanced ACA subsidies, expand Medicaid, or add a public option or Medicare for All)?","climate-clean-energy":"Climate and clean energy. Should government act to cut greenhouse gas emissions and speed the shift to clean energy?","taxes-high-earners":"Taxes on high earners and corporations. Should taxes be raised on high earners and corporations?","minimum-wage":"Minimum wage. Should the minimum wage be raised?","unions":"Labor unions. Should it be easier for workers to form unions and bargain collectively (for example, the PRO Act)?","lgbtq-protections":"LGBTQ protections. Should LGBTQ people have legal protection from discrimination (for example, the Equality Act)?","transgender-athletes":"Transgender athletes. Should school and college sports teams be limited by sex at birth?","criminal-justice":"Criminal justice. Should criminal-justice policy focus more on reducing incarceration (for example, sentencing reform, bail reform, alternatives to jail)?","marijuana":"Marijuana. Should recreational marijuana be legal?","voter-id":"Voter ID and proof of citizenship. Should voters have to show photo ID to vote, or prove citizenship to register?","tariffs":"Tariffs. Should the U.S. impose broad tariffs on imported goods?","ukraine-aid":"Aid to Ukraine. Should the U.S. keep providing military aid to Ukraine?","money-in-politics":"Money in politics. Should limits on money in politics be strengthened (for example, overturning Citizens United or banning corporate PAC money)?","congress-stock-trading":"Stock trading by members of Congress. Should members of Congress be banned from trading individual stocks?"},"x-values":"issue"},"name":{"type":"string","description":"Issue name."}}},"stance":{"type":["string","null"],"description":"The answer to the issue’s question: supports (yes), opposes (no), mixed (yes to part, or yes with limits the summary spells out), or null for a stated position that doesn’t answer it either way.","enum":["supports","opposes","mixed",null],"x-enumDescriptions":{"supports":"Yes to the issue’s question.","opposes":"No to the issue’s question.","mixed":"Yes to part of it, or yes with limits the summary spells out."},"x-values":"stance"},"summary":{"type":"string","description":"Where they stand, in neutral words: what they said, or how they voted."},"quote":{"type":["string","null"],"description":"Their own words, verbatim, where a source has them."},"checked_on":{"type":"string","description":"When the sources were last read.","format":"date"},"sources":{"type":"array","description":"Every link the position was taken from; at least one.","items":{"$ref":"#/components/schemas/IssuePositionSource"}}}},"IssuePositionItem":{"allOf":[{"$ref":"#/components/schemas/IssuePosition"},{"type":"object","required":["candidate","contests"],"properties":{"candidate":{"type":"object","description":"The candidate (GET /v1/candidates/{id}).","required":["id","full_name"],"properties":{"id":{"type":"integer","description":"Candidate id."},"full_name":{"type":"string","description":"Full name."}}},"contests":{"type":"array","description":"The candidate’s contests that you can read (and that match the filters), newest election first.","items":{"type":"object","required":["id","title","election","state"],"properties":{"id":{"type":"integer","description":"Contest id."},"title":{"type":"string","description":"Title as printed on the ballot."},"election":{"type":"object","description":"The contest’s election.","required":["slug","date"],"properties":{"slug":{"type":"string","description":"Election slug."},"date":{"type":"string","description":"Election day.","format":"date"}}},"state":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}}}}}}]},"CandidateDetail":{"type":"object","required":["id","full_name","name","website_url","photo_url","incumbent","ids","contact","finance","outside_spending","fec_committees","contributions_from_committees","spending","background","ideology","contests","issue_positions","person","other_candidacies"],"properties":{"id":{"type":"integer","description":"Candidate id."},"full_name":{"type":"string","description":"Full name."},"name":{"$ref":"#/components/schemas/NameParts"},"website_url":{"type":["string","null"],"description":"Campaign website.","format":"uri"},"photo_url":{"type":["string","null"],"description":"A photo of the candidate.","format":"uri"},"incumbent":{"type":["boolean","null"],"description":"Holds the seat now: true or false where we know, null where we don’t yet."},"ids":{"$ref":"#/components/schemas/CandidateIds"},"contact":{"$ref":"#/components/schemas/Contact"},"finance":{"type":"array","description":"FEC campaign finance totals, newest cycle first; empty for candidates without an FEC id.","items":{"$ref":"#/components/schemas/Finance"}},"outside_spending":{"type":"array","description":"Outside spending for and against the candidate, newest cycle first (2024 and 2026 cycles; outside_spending_cycles narrows them): FEC independent expenditures and communication costs. Empty for candidates without an FEC id or with none reported. Not endorsements.","items":{"$ref":"#/components/schemas/CandidateOutsideSpending"}},"fec_committees":{"type":"array","description":"The candidate’s FEC committees: principal campaign committee first, then other authorized and joint fundraising committees and leadership PACs they sponsor. Empty for candidates without an FEC id.","items":{"$ref":"#/components/schemas/CandidateCommittee"}},"contributions_from_committees":{"type":"array","description":"What PACs, parties and other committees gave them, per FEC cycle, newest first; empty for candidates without an FEC id or committee money.","items":{"$ref":"#/components/schemas/CommitteeContributionsReceived"}},"spending":{"type":"array","description":"What the candidate’s principal campaign committee spent money on, by category, one entry per cycle (2026 and 2024), newest cycle first; empty for candidates without an FEC id or itemized spending.","items":{"$ref":"#/components/schemas/Spending"}},"background":{"$ref":"#/components/schemas/CandidateBackground"},"ideology":{"$ref":"#/components/schemas/CandidateIdeology"},"contests":{"type":"array","description":"The contests they’re on that you can read, newest election first, each with the endorsements received.","items":{"allOf":[{"$ref":"#/components/schemas/CandidateContest"},{"type":"object","required":["endorsements","rescinded_endorsements"],"properties":{"endorsements":{"type":"array","description":"Every endorsement they received in this contest, by endorser name.","items":{"$ref":"#/components/schemas/CandidateEndorsement"}},"rescinded_endorsements":{"type":"array","description":"Endorsements of them in this contest that the endorser took back.","items":{"$ref":"#/components/schemas/RescindedEndorsement"}}}}]}},"issue_positions":{"type":"array","description":"Where they stand on common issues (GET /v1/issues), in issue order, each with its sources. Empty where we have none yet.","items":{"$ref":"#/components/schemas/IssuePosition"}},"person":{"description":"The person across elections: other candidate records, other names, party switches.","oneOf":[{"$ref":"#/components/schemas/Person"},{"type":"null"}]},"other_candidacies":{"type":"array","description":"Races they were in without being printed (declared, withdrew before printing, disqualified, write-in), newest first.","items":{"type":"object","required":["contest","election","candidacy"],"properties":{"contest":{"type":"object","description":"The contest.","required":["id","title"],"properties":{"id":{"type":"integer","description":"Contest id."},"title":{"type":"string","description":"Title as printed."}}},"election":{"type":"object","description":"Its election.","required":["slug","date"],"properties":{"slug":{"type":"string","description":"Election slug."},"date":{"type":"string","description":"Election day.","format":"date"}}},"candidacy":{"$ref":"#/components/schemas/Candidacy"}}}}}},"Change":{"type":"object","description":"One change to an endorsement.","required":["id","at","change","changed","endorsement_id","endorser","contest","election","before","after"],"properties":{"id":{"type":"integer","description":"The change’s id: increasing and unique. Pages are in this order."},"at":{"type":"string","description":"When the change was made.","format":"date-time"},"change":{"type":"string","description":"What happened to the endorsement: created, updated or deleted.","enum":["created","updated","deleted"],"x-enumDescriptions":{"created":"A new endorsement.","updated":"An existing endorsement changed; changed lists the fields.","deleted":"The endorsement was withdrawn by the endorser or removed by us."},"x-values":"change"},"changed":{"type":"array","description":"For updated: the fields that changed. Empty otherwise.","items":{"type":"string","enum":["choice_id","rank","statement","source_url","published_on"],"x-enumDescriptions":{"choice_id":"The endorser now backs a different choice in the same contest.","rank":"The ranked-choice rank changed.","statement":"What the endorser said changed.","source_url":"Where it was published changed.","published_on":"The publication date changed."},"x-values":"changed-field"}},"endorsement_id":{"type":"integer","description":"The endorsement changed."},"endorser":{"type":"object","description":"Who made the endorsement.","required":["id","slug","name","category"],"properties":{"id":{"type":"integer","description":"Endorser id."},"slug":{"type":["string","null"],"description":"Endorser slug; null if the endorser has since been removed."},"name":{"type":["string","null"],"description":"Endorser name; null if the endorser has since been removed."},"category":{"description":"The endorser’s category.","oneOf":[{"$ref":"#/components/schemas/Category"},{"type":"null"}]}}},"contest":{"type":"object","description":"The contest.","required":["id","title"],"properties":{"id":{"type":"integer","description":"Contest id."},"title":{"type":"string","description":"Title as printed on the ballot."}}},"election":{"type":"object","description":"The contest’s election.","required":["id","slug","date"],"properties":{"id":{"type":"integer","description":"Election id."},"slug":{"type":"string","description":"Election slug."},"date":{"type":"string","description":"Election day.","format":"date"}}},"before":{"description":"The values before the change; null for created.","oneOf":[{"$ref":"#/components/schemas/HistoryValues"},{"type":"null"}]},"after":{"description":"The values after the change; null for deleted.","oneOf":[{"$ref":"#/components/schemas/HistoryValues"},{"type":"null"}]}}},"ElectionExport":{"type":"object","required":["election","contests","credits"],"properties":{"election":{"$ref":"#/components/schemas/Election"},"contests":{"type":"array","description":"Every contest you can read in the election, in ballot order: races from federal down, then measures.","items":{"allOf":[{"$ref":"#/components/schemas/ContestBaseNoElection"},{"type":"object","required":["choices","other_candidates","endorsements"],"properties":{"choices":{"type":"array","description":"Every choice, in ballot order.","items":{"$ref":"#/components/schemas/Choice"}},"other_candidates":{"type":"array","description":"People in the race who aren’t printed lines (declared, withdrew before printing, disqualified, write-ins).","items":{"$ref":"#/components/schemas/Candidacy"}},"endorsements":{"type":"array","description":"Every endorser’s position, by endorser name.","items":{"$ref":"#/components/schemas/Position"}}}}]}},"credits":{"type":"string","description":"The Data credits page: sources whose licenses ask for credit, their licenses and what we changed. Keep that credit with any of their figures you pass on."}}},"Filter":{"type":"object","description":"Which endorsements: fields combine with AND, values within a field with OR, and a missing field matches everything. Each field takes at most 500 values.","required":[],"properties":{"categories":{"type":"array","description":"Endorser category slugs (GET /v1/endorser-categories).","items":{"type":"string","x-enumDescriptions":{"editorial":"Voter guides & editorial boards: each one a voter guide.","labor":"Labor: each one a labor union.","environment":"Environment & transportation: each one a environmental group.","business":"Housing & business: each one a housing or business group.","party":"Political parties: each one a political party.","club":"Political clubs: each one a political club.","community":"Community & advocacy: each one a community group.","officials":"Elected officials: each one a elected official."},"x-values":"endorser-category"}},"endorsers":{"type":"array","description":"Endorser slugs (GET /v1/endorsers).","items":{"type":"string"}},"endorser_states":{"type":"array","description":"Endorsers’ home states (USPS codes), or \"national\".","items":{"type":"string"}},"states":{"type":"array","description":"States the contests are voted in.","items":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}},"elections":{"type":"array","description":"Election slugs (GET /v1/elections). A date and type (2026-11-03-general) matches every election of that type that day nationwide, and a bare date (2026-11-03) every election that day.","items":{"type":"string"}},"contest_kinds":{"type":"array","description":"Contest kinds: candidate, measure or retention.","items":{"type":"string","enum":["candidate","measure","retention"],"x-enumDescriptions":{"candidate":"A race for an office: voters choose among candidates.","measure":"A ballot measure (proposition, amendment, bond, tax, referendum or initiative): voters answer Yes or No.","retention":"A judicial retention question: should this judge stay in office? Voters answer Yes or No."},"x-values":"contest-kind"}},"levels":{"type":"array","description":"Levels of government of the contests’ districts.","items":{"type":"string","enum":["federal","state","county","city","school","special"],"x-enumDescriptions":{"federal":"The whole country, or a U.S. House district.","state":"A whole state, or a state legislative, judicial or other state district.","county":"A county (a parish in Louisiana, a borough in Alaska) or a district within one.","city":"A city, town, township, village or borough, or a ward or council district within one.","school":"A school district, community college district, or a trustee area within one.","special":"A special district: water, fire, hospital, park, transit, port, conservation and the like."},"x-values":"district-level"}},"types":{"type":"array","description":"Stream only: kinds of change.","items":{"type":"string","enum":["created","updated","deleted"],"x-enumDescriptions":{"created":"A new endorsement.","updated":"An existing endorsement changed; changed lists the fields.","deleted":"The endorsement was withdrawn by the endorser or removed by us."},"x-values":"change"}}}},"Officeholder":{"type":"object","required":["person_id","name","given_name","family_name","office","office_title","level","state","district","district_ocd_id","district_id","party","party_abbreviation","term_start","term_end","email","phone","website_url","image_url","offices","social","source_urls","updated_at"],"properties":{"person_id":{"type":"string","description":"Open States person id; stays the same across terms and offices.","format":"uuid"},"name":{"type":"string","description":"Full name."},"given_name":{"type":["string","null"],"description":"Given name."},"family_name":{"type":["string","null"],"description":"Family name."},"office":{"type":"string","description":"The office held, normalized across states.","enum":["us_senator","us_representative","governor","lieutenant_governor","attorney_general","secretary_of_state","chief_election_officer","treasurer","auditor","state_senator","state_representative","state_legislator","city_council"],"x-enumDescriptions":{"us_senator":"U.S. Senator.","us_representative":"U.S. Representative, or a non-voting delegate.","governor":"Governor (or D.C.’s mayor).","lieutenant_governor":"Lieutenant governor.","attorney_general":"State attorney general.","secretary_of_state":"Secretary of state.","chief_election_officer":"The state’s chief election officer, where that isn’t the secretary of state.","treasurer":"State treasurer.","auditor":"State auditor or comptroller.","state_senator":"State senator (upper house).","state_representative":"State representative, assemblymember or delegate (lower house).","state_legislator":"A member of a one-house legislature (Nebraska).","city_council":"A member of the Council of the District of Columbia."},"x-values":"officeholder-office"},"office_title":{"type":"string","description":"Title the state uses: “Assemblymember”, “Delegate”."},"level":{"type":"string","description":"Level of government.","enum":["federal","state","city"],"x-enumDescriptions":{"federal":"Congress.","state":"A statewide office or the state legislature.","city":"The Council of the District of Columbia."},"x-values":"officeholder-level"},"state":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]},"district":{"type":["string","null"],"description":"District as the legislature names it: \"12\", \"1A\", \"21st Middlesex\"."},"district_ocd_id":{"type":"string","description":"OCD division id of the seat."},"district_id":{"type":["integer","null"],"description":"The matching contest district id, where there is one."},"party":{"type":["string","null"],"description":"Party as published: “Democratic”, “Republican/Conservative”."},"party_abbreviation":{"type":["string","null"],"description":"Party abbreviation."},"term_start":{"type":["string","null"],"description":"Start of the current term.","format":"date"},"term_end":{"type":["string","null"],"description":"End of the current term.","format":"date"},"email":{"type":["string","null"],"description":"Official office email.","format":"email"},"phone":{"type":["string","null"],"description":"Office phone (capitol office first)."},"website_url":{"type":["string","null"],"description":"Their official web page.","format":"uri"},"image_url":{"type":["string","null"],"description":"Their official photo.","format":"uri"},"offices":{"type":"array","description":"Offices with their addresses and phones.","items":{"type":"object","required":[],"properties":{"classification":{"type":"string","description":"Which office: capitol, district, home or primary.","x-enumDescriptions":{"capitol":"The office at the capitol (or in Washington).","district":"An office in the member’s district.","home":"A home or personal address the member lists for constituents.","capitol-mail":"A mailing address for the capitol office, where it differs from the street address.","district-mail":"A mailing address for the district office, where it differs from the street address.","primary":"The member’s main office, where the legislature doesn’t say capitol or district."},"x-values":"office-classification"},"address":{"type":"string","description":"The office’s mailing address."},"voice":{"type":"string","description":"The office’s phone number."},"fax":{"type":"string","description":"The office’s fax number."}}}},"social":{"type":"object","description":"Social accounts, where known. Only keys we have are present.","required":[],"properties":{"twitter":{"type":"string","description":"X (Twitter) handle, without the @."},"facebook":{"type":"string","description":"Facebook handle."},"instagram":{"type":"string","description":"Instagram handle."},"youtube":{"type":"string","description":"YouTube handle or channel id."}}},"source_urls":{"type":"array","description":"Where the data came from.","items":{"type":"string","format":"uri"}},"updated_at":{"type":"string","description":"When we last refreshed this record.","format":"date-time"}}},"OfficeholderDetail":{"allOf":[{"$ref":"#/components/schemas/Officeholder"},{"type":"object","required":["seats"],"properties":{"seats":{"type":"array","description":"Every seat they hold (rarely more than one).","items":{"$ref":"#/components/schemas/Officeholder"}}}}]},"ContestSeat":{"type":"object","description":"The durable seat a contest fills.","required":["slug","name","race_type","stage","seats_up"],"properties":{"slug":{"type":"string","description":"The seat’s slug, for GET /v1/offices/{slug}.","examples":["us-house-ca-12"]},"name":{"type":"string","description":"The seat’s name."},"race_type":{"type":"string","description":"regular, special, recall or retention.","enum":["regular","special","recall","retention"],"x-enumDescriptions":{"regular":"An election for a full term on the regular schedule.","special":"An election for the rest of an unexpired term, or a contest in a special election.","recall":"A recall: whether to remove an officeholder before the term ends (and, where the ballot has one, who replaces them).","retention":"A judicial retention question."},"x-values":"race-type"},"stage":{"type":"string","description":"general, primary or runoff. A primary nominates and never gives a term.","enum":["general","primary","runoff"],"x-enumDescriptions":{"general":"The general (or the special general) election that fills the seat.","primary":"A primary that nominates for the seat; never gives a term by itself.","runoff":"A runoff that fills the seat."},"x-values":"office-contest-stage"},"seats_up":{"type":"integer","description":"How many of the seat’s members this contest elects (1 except for an at-large body)."}}},"SeatChange":{"type":"object","description":"Whether a result kept or changed who holds the seat.","required":["office","outcome","partisan","flipped","holders_going_in","parties_going_in","winner_parties","incumbents_up","incumbents_reelected","incumbents_defeated","open_seats","vacant_since"],"properties":{"office":{"type":"string","description":"The seat’s slug.","pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"},"outcome":{"type":"string","description":"incumbent_reelected, incumbent_defeated, open_seat, new_seat or unknown; for a body electing several members, incumbents_reelected or mixed.","enum":["incumbent_reelected","incumbent_defeated","open_seat","new_seat","unknown","incumbents_reelected","mixed"],"x-enumDescriptions":{"incumbent_reelected":"The person who held the seat going in won.","incumbent_defeated":"The person who held the seat going in ran and lost.","open_seat":"The person who held the seat going in didn’t run, or the seat was vacant.","new_seat":"The seat didn’t exist before this election.","unknown":"We don’t yet know who held the seat going in.","incumbents_reelected":"A body electing several members: every winner held a seat going in.","mixed":"A body electing several members: some winners are new; the counts say how many."},"x-values":"seat-outcome"},"partisan":{"type":"boolean","description":"Candidates run with party labels."},"flipped":{"type":["boolean","null"],"description":"Partisan seats: the winner’s party differs from the party of whoever held the seat going in (appointments and party switches count). null for a nonpartisan seat or when either party is unknown."},"holders_going_in":{"type":"array","description":"Who held the seat (or the seats up) on election day.","items":{"type":"object","required":["name","party","how","start_date"],"properties":{"name":{"type":"string","description":"As the source names them."},"party":{"type":["string","null"],"description":"Their party going in."},"how":{"type":"string","description":"How their term began.","enum":["elected","special_election","appointed","succeeded","retained","holdover","other"],"x-enumDescriptions":{"elected":"Won a regular election for a full term.","special_election":"Won a special election for the rest of an unexpired term.","appointed":"Appointed to fill a vacancy (by a governor, a board or a council).","succeeded":"Took over by law, such as a lieutenant governor becoming governor.","retained":"A judge who kept the seat in a retention vote.","holdover":"Stayed on past the end of the term until a successor took office.","other":"Any other way; the source explains."},"x-values":"term-how"},"start_date":{"type":["string","null"],"description":"When their term began.","format":"date"}}}},"parties_going_in":{"type":"array","description":"Parties of the holders going in.","items":{"type":"string"}},"winner_parties":{"type":"array","description":"Parties of the winners.","items":{"type":"string"}},"incumbents_up":{"type":"integer","description":"Holders whose seats were up."},"incumbents_reelected":{"type":"integer","description":"Of them, how many won."},"incumbents_defeated":{"type":"integer","description":"Of them, how many ran and lost."},"open_seats":{"type":"integer","description":"Seats up whose holder didn’t run."},"vacant_since":{"type":["string","null"],"description":"When the seat was vacant on election day: the day it fell vacant. holders_going_in is then the last holder before it, with their party when they left.","format":"date"}}},"OfficeDistrict":{"type":"object","required":["ocd_id","district_id","plan","valid_from","valid_to"],"properties":{"ocd_id":{"type":"string","description":"OCD division id of this version of the district (“…/plan:2020” for lines used before 2022 redistricting)."},"district_id":{"type":["integer","null"],"description":"The contest district id (GET /v1/contests districts), where we have it."},"plan":{"type":["string","null"],"description":"The redistricting plan these lines belong to, such as \"2020\"; null for current lines."},"valid_from":{"type":["string","null"],"description":"First day officials elected on these lines served.","format":"date"},"valid_to":{"type":["string","null"],"description":"Last day they served.","format":"date"}}},"CurrentHolder":{"type":"object","required":["name","person_key","party","how","start_date","scheduled_end_date"],"properties":{"name":{"type":"string","description":"As the source names them."},"person_key":{"type":"string","description":"Stable id for the person across terms: bioguide:<id>, ocd-person/<uuid>, or name:<state>:<family>-<given>."},"party":{"type":["string","null"],"description":"Party."},"how":{"type":"string","description":"How the term began.","enum":["elected","special_election","appointed","succeeded","retained","holdover","other"],"x-enumDescriptions":{"elected":"Won a regular election for a full term.","special_election":"Won a special election for the rest of an unexpired term.","appointed":"Appointed to fill a vacancy (by a governor, a board or a council).","succeeded":"Took over by law, such as a lieutenant governor becoming governor.","retained":"A judge who kept the seat in a retention vote.","holdover":"Stayed on past the end of the term until a successor took office.","other":"Any other way; the source explains."},"x-values":"term-how"},"start_date":{"type":["string","null"],"description":"When the term began.","format":"date"},"scheduled_end_date":{"type":["string","null"],"description":"When the term is due to end.","format":"date"}}},"OfficeRecord":{"type":"object","description":"A seat (or an at-large body) that lasts across elections.","required":["slug","name","office_type","level","branch","state","jurisdiction_ocd_id","seat_label","seats","term_years","partisan","established_on","abolished_on","successor","districts","current_holders","updated_at"],"properties":{"slug":{"type":"string","description":"Permanent id of the seat: it stays the same across elections and redistricting.","examples":["us-house-ca-12"]},"name":{"type":"string","description":"The seat’s name."},"office_type":{"type":"string","description":"The office, normalized across states.","enum":["president","us_senator","us_representative","governor","lieutenant_governor","attorney_general","secretary_of_state","state_treasurer","state_auditor","state_superintendent","insurance_commissioner","agriculture_commissioner","land_commissioner","labor_commissioner","utility_commission","university_board","state_board_of_education","state_senator","state_representative","state_supreme_court","state_appellate_court","trial_court","municipal_court","magistrate","justice_of_the_peace","court_clerk","mayor","local_executive","city_council","county_legislature","neighborhood_council","school_board","school_superintendent","college_board","special_district_board","water_conservation_board","sheriff","prosecutor","coroner","constable","assessor","tax_collector","treasurer","auditor","recorder","clerk","surveyor","public_works","police_fire","other_county_office","other"],"x-enumDescriptions":{"president":"President of the United States (with the vice president on the same ticket).","us_senator":"U.S. Senator.","us_representative":"U.S. Representative, or a non-voting delegate to the House.","governor":"Governor.","lieutenant_governor":"Lieutenant governor.","attorney_general":"State attorney general.","secretary_of_state":"Secretary of state.","state_treasurer":"State treasurer.","state_auditor":"State auditor, comptroller or controller.","state_superintendent":"State superintendent of public instruction (the elected head of state schools).","insurance_commissioner":"State insurance commissioner.","agriculture_commissioner":"State agriculture commissioner.","land_commissioner":"State land commissioner (public lands).","labor_commissioner":"State labor commissioner.","utility_commission":"A state utility, public service or corporation commission seat.","university_board":"A state university board of regents or trustees seat.","state_board_of_education":"A state board of education seat.","state_senator":"State senator (the upper house of the legislature; Nebraska’s one-house Legislature too).","state_representative":"State representative, assemblymember or delegate (the lower house).","state_supreme_court":"A justice of the state’s highest court.","state_appellate_court":"A judge of a state intermediate appeals court.","trial_court":"A judge of a general trial court: superior, district, circuit, county or probate court.","municipal_court":"A city or municipal court judge.","magistrate":"A magistrate.","justice_of_the_peace":"A justice of the peace.","court_clerk":"Clerk of a court.","mayor":"Mayor.","local_executive":"Another elected local chief executive: county executive or judge-executive, borough or parish president, first selectman, town or township supervisor, village president.","city_council":"A city, town, village or borough council, select board or board of aldermen seat.","county_legislature":"A county commission, board of supervisors, county council, quorum or fiscal court, or police jury seat.","neighborhood_council":"A neighborhood body: Washington, D.C.’s Advisory Neighborhood Commissions, for example.","school_board":"A school board or board of education seat.","school_superintendent":"An elected county or district school superintendent.","college_board":"A community college district board seat.","special_district_board":"A board of a special district: hospital, fire, park, library, transit, port, utility and similar.","water_conservation_board":"A soil and water conservation, water, irrigation, drainage or flood control district board.","sheriff":"Sheriff.","prosecutor":"District attorney, state’s attorney, county attorney or solicitor.","coroner":"Coroner or medical examiner.","constable":"Constable (or town sergeant).","assessor":"Assessor, appraiser or property valuation administrator.","tax_collector":"Tax collector or tax commissioner.","treasurer":"A county, city or town treasurer.","auditor":"A county, city or town auditor, comptroller or controller.","recorder":"Recorder or register of deeds, wills or probate.","clerk":"A county, city or town clerk, prothonotary or registrar.","surveyor":"County surveyor or engineer.","public_works":"Highway, road or street commissioner, or a public works office.","police_fire":"An elected police chief, fire chief or marshal.","other_county_office":"Another county office: public defender, public administrator, jailer, election director and similar.","other":"An office that fits none of the types above."},"x-values":"office-type"},"level":{"type":"string","description":"federal, state or local.","enum":["federal","state","local"],"x-enumDescriptions":{"federal":"President, U.S. Senate and U.S. House.","state":"Statewide offices, state legislatures and state appellate courts.","local":"Counties, cities, school districts, special districts and trial courts."},"x-values":"office-record-level"},"branch":{"type":["string","null"],"description":"executive, legislative or judicial.","enum":["executive","legislative","judicial",null],"x-enumDescriptions":{"executive":"Runs government: president, governor, mayor, sheriff, clerk, treasurer and other officers.","legislative":"Makes laws or policy as a body: Congress, legislatures, councils, commissions and boards.","judicial":"A judge, justice, magistrate or justice of the peace."},"x-values":"office-branch"},"state":{"type":["string","null"],"pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]},"jurisdiction_ocd_id":{"type":"string","description":"The division the seat belongs to, without a redistricting plan."},"seat_label":{"type":["string","null"],"description":"What tells the seat apart from others of its type in the same place: “Class 3”, “Position 8”, “Department 12”."},"seats":{"type":"integer","description":"Members elected through this office: 1, or the size of an at-large body."},"term_years":{"type":["integer","null"],"description":"Length of a full term in years."},"partisan":{"type":["boolean","null"],"description":"Candidates run with party labels; null when not set."},"established_on":{"type":["string","null"],"description":"When the seat was created, if after 2018.","format":"date"},"abolished_on":{"type":["string","null"],"description":"When the seat stopped existing.","format":"date"},"successor":{"type":["string","null"],"description":"Slug of the seat that replaced it, when it was renumbered or merged."},"districts":{"type":"array","description":"Every version of the seat’s district, oldest first.","items":{"$ref":"#/components/schemas/OfficeDistrict"}},"current_holders":{"type":"array","description":"Who holds it now (empty while vacant or not known).","items":{"$ref":"#/components/schemas/CurrentHolder"}},"updated_at":{"type":"string","description":"When we last changed this record.","format":"date-time"}}},"OfficeTerm":{"type":"object","description":"One person’s term in one seat.","required":["id","office","office_name","state","name","person_key","candidate_id","bioguide_id","openstates_person_id","party","party_changes","how","start_date","end_date","scheduled_end_date","end_reason","dates_basis","election_date","contest_id","district_ocd_id","district_id","source","updated_at"],"properties":{"id":{"type":"integer","description":"Term id."},"office":{"type":"string","description":"The seat’s slug.","pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"},"office_name":{"type":"string","description":"The seat’s name."},"state":{"type":["string","null"],"pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]},"name":{"type":"string","description":"The holder’s name as the source gives it."},"person_key":{"type":"string","description":"Stable id for the person across terms: bioguide:<id>, ocd-person/<uuid>, or name:<state>:<family>-<given>. Pass as person= to list someone’s terms."},"candidate_id":{"type":["integer","null"],"description":"Their candidate id (GET /v1/candidates/{id}) when they were on one of our ballots."},"bioguide_id":{"type":["string","null"],"description":"Congressional Biographical Directory id, for members of Congress."},"openstates_person_id":{"type":["string","null"],"description":"Open States person id (as in GET /v1/officeholders)."},"party":{"type":["string","null"],"description":"Party when the term began."},"party_changes":{"type":"array","description":"Party switches during the term.","items":{"type":"object","required":["on","party_slug"],"properties":{"on":{"type":"string","description":"Date of the switch.","format":"date"},"party_slug":{"type":"string","description":"The new party."}}}},"how":{"type":"string","description":"How the term began.","enum":["elected","special_election","appointed","succeeded","retained","holdover","other"],"x-enumDescriptions":{"elected":"Won a regular election for a full term.","special_election":"Won a special election for the rest of an unexpired term.","appointed":"Appointed to fill a vacancy (by a governor, a board or a council).","succeeded":"Took over by law, such as a lieutenant governor becoming governor.","retained":"A judge who kept the seat in a retention vote.","holdover":"Stayed on past the end of the term until a successor took office.","other":"Any other way; the source explains."},"x-values":"term-how"},"start_date":{"type":["string","null"],"description":"When they took office.","format":"date"},"end_date":{"type":["string","null"],"description":"When they left office; null while serving or not known.","format":"date"},"scheduled_end_date":{"type":["string","null"],"description":"When the term was due to end.","format":"date"},"end_reason":{"type":["string","null"],"description":"How the term ended.","enum":["term_ended","resigned","died","removed","recalled","appointed_elsewhere","elected_elsewhere","succeeded_elsewhere","seat_abolished","other",null],"x-enumDescriptions":{"term_ended":"The term ran its course (including losing re-election or not running).","resigned":"Resigned.","died":"Died in office.","removed":"Removed from office (impeachment, expulsion, a court order).","recalled":"Recalled by the voters.","appointed_elsewhere":"Left to take an appointed office.","elected_elsewhere":"Left to take another elected office.","succeeded_elsewhere":"Left to take another office by succession.","seat_abolished":"The seat stopped existing.","other":"Any other reason; the source explains."},"x-values":"term-end-reason"},"dates_basis":{"type":["string","null"],"description":"Where the dates come from.","enum":["sourced","statutory","next_holder",null],"x-enumDescriptions":{"sourced":"The source gives the dates.","statutory":"Worked out from the law that sets when the term starts and how long it lasts.","next_holder":"The end date is the day the next holder took office."},"x-values":"term-dates-basis"},"election_date":{"type":["string","null"],"description":"The election that gave the term, if any.","format":"date"},"contest_id":{"type":["integer","null"],"description":"That election’s contest (GET /v1/contests/{id})."},"district_ocd_id":{"type":["string","null"],"description":"The district version they served from."},"district_id":{"type":["integer","null"],"description":"Its contest district id."},"source":{"type":"object","description":"Where the term comes from.","required":["kind","name","url","license","retrieved_on"],"properties":{"kind":{"type":"string","description":"What kind of source the term comes from: results, official, dataset or reported.","enum":["results","official","dataset","reported"],"x-enumDescriptions":{"results":"Our certified election results: the winner of the contest that gave the term.","official":"An official roster, record or announcement (a legislature, a secretary of state, a governor’s office, a county clerk).","dataset":"An openly licensed dataset compiled from official records (congress-legislators, Open States), with its license.","reported":"Read from a page that reports it (a news story, a press release): someone taking office, or the end of a term. Two independent AI readers must agree on it, or a person must check it, before it is kept."},"x-values":"term-source-kind"},"name":{"type":"string","description":"Who published the term’s facts: an election office, a legislature, a dataset."},"url":{"type":"string","description":"Where the term’s facts were published.","format":"uri"},"license":{"type":["string","null"],"description":"For a dataset, its license (CC0-1.0, public domain)."},"retrieved_on":{"type":["string","null"],"description":"When we read a dataset.","format":"date"}}},"updated_at":{"type":"string","description":"When we last changed this term.","format":"date-time"}}},"OfficeDetail":{"allOf":[{"$ref":"#/components/schemas/OfficeRecord"},{"type":"object","required":["terms","contests"],"properties":{"terms":{"type":"array","description":"Every term we have, oldest first.","items":{"$ref":"#/components/schemas/OfficeTerm"}},"contests":{"type":"array","description":"Every contest for the seat we have, oldest first.","items":{"type":"object","required":["id","title","election","election_date","race_type","stage","seats_up","result_status","seat_change"],"properties":{"id":{"type":"integer","description":"Contest id."},"title":{"type":"string","description":"Title as printed."},"election":{"type":"string","description":"Election slug."},"election_date":{"type":"string","description":"Election day.","format":"date"},"race_type":{"type":"string","description":"regular, special, recall or retention.","enum":["regular","special","recall","retention"],"x-enumDescriptions":{"regular":"An election for a full term on the regular schedule.","special":"An election for the rest of an unexpired term, or a contest in a special election.","recall":"A recall: whether to remove an officeholder before the term ends (and, where the ballot has one, who replaces them).","retention":"A judicial retention question."},"x-values":"race-type"},"stage":{"type":"string","description":"general, primary or runoff.","enum":["general","primary","runoff"],"x-enumDescriptions":{"general":"The general (or the special general) election that fills the seat.","primary":"A primary that nominates for the seat; never gives a term by itself.","runoff":"A runoff that fills the seat."},"x-values":"office-contest-stage"},"seats_up":{"type":"integer","description":"Members this contest elects."},"result_status":{"type":["string","null"],"description":"The result’s status, once there is one.","enum":["unofficial","certified",null],"x-enumDescriptions":{"unofficial":"Election-night and canvass counts: still changing. We read them again every day until they’re certified.","certified":"The canvass is certified: the final official count."},"x-values":"result-status"},"seat_change":{"description":"Whether the seat changed hands; null for primaries and undecided contests.","oneOf":[{"$ref":"#/components/schemas/SeatChange"},{"type":"null"}]}}}}}}]},"ResultChoice":{"type":"object","description":"One choice’s line in a result.","required":["choice_id","label","measure_answer","candidate_id","party","votes","vote_pct","winner"],"properties":{"choice_id":{"type":"integer","description":"The ballot choice’s id (a contest’s choices[].id)."},"label":{"type":"string","description":"The choice as printed: a candidate’s name, or Yes or No."},"measure_answer":{"type":["string","null"],"description":"For a measure: yes or no.","enum":["yes","no",null],"x-enumDescriptions":{"yes":"The Yes line of a measure or retention question. On an endorsement: the endorser says vote Yes.","no":"The No line. On an endorsement: the endorser says vote No."},"x-values":"measure-answer"},"candidate_id":{"type":["integer","null"],"description":"The candidate (GET /v1/candidates/{id}); null for a measure answer."},"party":{"type":["string","null"],"description":"The party the choice ran under, as printed; null for nonpartisan contests and measures."},"votes":{"type":["integer","null"],"description":"Votes for this choice. null only on a party-reported result, which names a winner without counts."},"vote_pct":{"type":["number","null"],"description":"Share of the contest’s votes, 0 to 100, as the source gives it."},"winner":{"type":["boolean","null"],"description":"true for a winner (for vote for N, each of the N), false for a choice that lost; null when not decided yet or not stated, such as a race headed to a runoff."}}},"ResultMargin":{"type":"object","description":"The deciding margin: between the last place that wins and the next place. First over second in a vote-for-one contest; Nth over N+1th in a vote-for-N contest. Counts as the source publishes them: for ranked choice, the final round where the source gives one, otherwise the first.","required":["votes","pct_points","ahead","behind","winning_places"],"properties":{"votes":{"type":"integer","description":"Votes between the two places. Negative only when the source marks a winner with fewer votes (a measure that needed a supermajority)."},"pct_points":{"type":"number","description":"The same gap in percentage points of the contest’s votes."},"ahead":{"type":"string","description":"The choice in the last winning place."},"behind":{"type":"string","description":"The choice in the next place."},"winning_places":{"type":"integer","description":"How many places win: the choices the source marks as winners, else the votes allowed."}}},"Result":{"type":"object","description":"One contest’s result in brief: who won, by how much, and whether the seat changed hands.","required":["contest_id","title","kind","vote_method","votes_allowed","ranks_allowed","measure_code","office","seat","race_type","partisan","unopposed","on_ballot","off_ballot_reason","district","election","status","source_kind","party_reported","decided","total_votes","precincts_reporting","precincts_total","winners","margin","choices","source","official_url","seat_change","fetched_at"],"properties":{"contest_id":{"type":"integer","description":"The contest (GET /v1/contests/{id} has its choices, endorsements and the full result)."},"title":{"type":"string","description":"Title as printed on the ballot."},"kind":{"type":"string","description":"candidate (an office), measure (a proposition) or retention (keep a judge?).","enum":["candidate","measure","retention"],"x-enumDescriptions":{"candidate":"A race for an office: voters choose among candidates.","measure":"A ballot measure (proposition, amendment, bond, tax, referendum or initiative): voters answer Yes or No.","retention":"A judicial retention question: should this judge stay in office? Voters answer Yes or No."},"x-values":"contest-kind"},"vote_method":{"type":"string","description":"How votes are cast: plurality, multi_seat (vote for up to votes_allowed), ranked_choice, approval, or yes_no.","enum":["plurality","multi_seat","ranked_choice","approval","yes_no"],"x-enumDescriptions":{"plurality":"Vote for one: the candidate with the most votes wins (or goes to a runoff where a majority is required).","multi_seat":"Vote for up to N (votes_allowed): several seats are filled at once and the top N win.","ranked_choice":"Ranked choice: voters rank up to ranks_allowed candidates; endorsements carry the endorser’s rank 1, 2, 3…. rcv_rounds holds the official tabulation once there is one.","approval":"Approval voting: voters mark every candidate they approve of; the most-approved win (Fargo, St. Louis).","yes_no":"A Yes or No question: every measure and retention question."},"x-values":"vote-method"},"votes_allowed":{"type":["integer","null"],"description":"How many choices a voter may mark (vote for N)."},"ranks_allowed":{"type":["integer","null"],"description":"Ranked choice: how many choices a voter may rank."},"measure_code":{"type":["string","null"],"description":"The measure’s letter or number: “K”, “Prop 1”."},"office":{"description":"The office a candidate or retention contest fills; null for a measure.","oneOf":[{"$ref":"#/components/schemas/Office"},{"type":"null"}]},"seat":{"description":"The seat this contest fills (GET /v1/offices/{slug}), once it is linked; null for a measure or a contest not linked yet.","oneOf":[{"$ref":"#/components/schemas/ContestSeat"},{"type":"null"}]},"race_type":{"type":["string","null"],"description":"regular, special, recall or retention; null for a measure.","enum":["regular","special","recall","retention",null],"x-enumDescriptions":{"regular":"An election for a full term on the regular schedule.","special":"An election for the rest of an unexpired term, or a contest in a special election.","recall":"A recall: whether to remove an officeholder before the term ends (and, where the ballot has one, who replaces them).","retention":"A judicial retention question."},"x-values":"race-type"},"partisan":{"type":["boolean","null"],"description":"Candidates run with a party label on the ballot; null for a measure or retention question."},"unopposed":{"type":"boolean","description":"No more candidates were running than seats. Always false for measures."},"on_ballot":{"type":"boolean","description":"Printed on the ballot. false for a race the state or county left off, usually because it was unopposed and the candidates were declared elected; off_ballot_reason says why. endorsedby.org shows only contests on the ballot; filter with on_ballot=true for the same."},"off_ballot_reason":{"type":["string","null"],"description":"Why the contest is not on the ballot: unopposed or cancelled. null when on_ballot is true.","enum":["unopposed","cancelled",null],"x-enumDescriptions":{"unopposed":"No more candidates filed than seats, so the state or county left the race off the ballot and declared them elected.","cancelled":"Left off the ballot for another reason: nobody filed, the seat was filled by appointment, or the election was called off."},"x-values":"off-ballot-reason"},"district":{"type":"object","description":"The district the contest is voted in (GET /v1/contests has its partisanship and demographics).","required":["id","ocd_id","name","level","type","state"],"properties":{"id":{"type":"integer","description":"District id."},"ocd_id":{"type":["string","null"],"description":"Open Civic Data division id, used in districts= filters."},"name":{"type":"string","description":"District name."},"level":{"type":"string","description":"Level of government.","enum":["federal","state","county","city","school","special"],"x-enumDescriptions":{"federal":"The whole country, or a U.S. House district.","state":"A whole state, or a state legislative, judicial or other state district.","county":"A county (a parish in Louisiana, a borough in Alaska) or a district within one.","city":"A city, town, township, village or borough, or a ward or council district within one.","school":"A school district, community college district, or a trustee area within one.","special":"A special district: water, fire, hospital, park, transit, port, conservation and the like."},"x-values":"district-level"},"type":{"type":"string","description":"Kind of district: statewide, congressional, state_upper, state_lower, county, council, school, …","x-enumDescriptions":{"airport_authority":"An airport authority’s district. Example: Hall County Airport Authority.","anc_smd":"A single-member district of a Washington, D.C. Advisory Neighborhood Commission. Example: ANC 1A01.","annexation_area":"The area a proposed annexation would add to a city. Example: Tucker annexation area (SB 622).","appellate_district":"A state appellate court district. Example: Illinois Appellate Court, First District.","appraisal_district":"A property appraisal district. Example: Collin Central Appraisal District.","assistance_district":"A county assistance district (Texas), proposed or in place. Example: Carson County Assistance District (proposed; Carson County outside Panhandle, White Deer, Groom, Skellytown and Fritch).","board_district":"A member district of a local board (a city, utility or similar board). Example: Hot Springs Board District 2.","board_of_education_district":"A member district of a county or city board of education. Example: Anderson County Board of Education District 1.","board_of_equalization":"A district of a state board of equalization (California’s tax board). Example: State Board of Equalization District 2.","board_of_regents":"A district of a state university’s board of regents. Example: University of Nebraska Board of Regents District 1.","board_of_review_district":"A district of a county property-tax board of review. Example: Cook County Board of Review District 1.","cemetery_district":"A cemetery district. Example: Chugwater Cemetery District.","chancery_court_district":"A chancery court district (Mississippi, Tennessee). Example: 1st Chancery Court District.","chancery_court_district_subdistrict":"A subdistrict that elects one chancery judge. Example: Chancery Court Subdistrict 5-1.","circuit_court":"A circuit court’s circuit. Example: 6th Judicial Circuit.","circuit_court_district":"A circuit court district. Example: 1st Circuit Court District.","circuit_court_district_subdistrict":"A subdistrict that elects one circuit judge. Example: Circuit Court Subdistrict 4-1.","city":"A whole city. Example: City of Oakland.","city_council":"A city council district. Example: Portland District 4.","college":"A community college district. Example: Grossmont-Cuyamaca Community College District.","college_district":"A community college district. Example: Collin County Community College District.","commission":"A county commission, or a district of one. Example: Clay County Commission, Eastern District.","commission_district":"A county or city commission district. Example: Jefferson County Commission District 1.","commissioner_district":"A county commissioner district. Example: El Paso County Commissioner District 1.","commissioner_precinct":"A county commissioners court precinct (Texas). Example: Travis County Commissioners Precinct 2.","community_college":"A community college district. Example: San Francisco Community College District.","community_college_district":"A community college district. Example: Lansing Community College.","congressional":"A U.S. House district (or a whole state with one at-large seat). Example: California Congressional District 11.","conservancy_district":"A conservancy (water) district. Example: Garrison Diversion Conservancy District, Wells County.","conservation_district":"A conservation district. Example: Minnehaha Conservation District.","constable_district":"A constable’s district. Example: Washington County Constable District 1.","constable_precinct":"A constable precinct (Texas). Example: Travis County Constable Precinct 4.","council":"A city or county council district. Example: City of Oakland Council District 2.","council_district":"A city or county council district. Example: Austin City Council District 1.","county":"A whole county (parish, borough), or a consolidated city and county. Example: City and County of San Francisco.","county_budget_committee":"A county budget committee district. Example: Knox County Budget Committee District 6.","county_commission":"A county commission or board of supervisors district. Example: Yavapai County Board of Supervisors District 2.","county_commission_district":"A county commission district. Example: Blount County Commission District 4.","county_council":"A county council district. Example: Cuyahoga County Council District 1.","county_council_district":"A county council district. Example: Franklin County Council/Commissioner District 3.","county_court_district":"A county court district. Example: Hinds County Court District 1.","county_division":"A division of a county with its own courthouse or offices (Bessemer, Alabama). Example: Bessemer Division of Jefferson County.","county_part":"The part of a county outside (or inside) certain cities, for a contest voted on only there. Example: Fayette County outside Somerville, Oakland, Piperton and Rossville.","court_district":"The district of a city, municipal or other local court. Example: Lafayette City Court.","court_of_appeal":"A state court of appeal circuit (Louisiana). Example: Louisiana 1st Circuit Court of Appeal.","court_of_appeal_district":"An election district within a court of appeal circuit. Example: 1st Circuit Court of Appeal, District 2.","court_of_appeals":"A state court of appeals district. Example: Fifteenth Court of Appeals District (statewide).","court_of_appeals_district":"A state court of appeals district. Example: Kentucky Court of Appeals District 3.","court_of_appeals_division":"A division of a state court of appeals. Example: Washington Court of Appeals Division 3.","district":"A seat or district of a local board or special district. Example: Beach Mosquito Control District, Seat 2.","district_attorney":"A district attorney’s district. Example: Berkshire District Attorney District.","district_attorney_district":"A district attorney’s district. Example: 17th Circuit Court District (District Attorney).","district_court":"A district court’s district. Example: Kittitas County District Court, Lower County.","district_court_district":"A district court’s district. Example: 14A District Court.","division":"A division (member district) of a special district. Example: Fallbrook Public Utility District Division 2.","educational_service_unit":"An educational service unit district (Nebraska). Example: Educational Service Unit 1 District 1.","election_district":"A county election district. Example: Montgomery County Election District 12 (Damascus).","emergency_services_district":"An emergency services district. Example: Wheeler County Emergency Services District No. 1.","ems_district":"An emergency medical services district. Example: Glendo Emergency Services District.","executive_council":"A district of New Hampshire’s Executive Council. Example: New Hampshire Executive Council District 1.","fire":"A fire protection district. Example: Sni Valley Fire Protection District.","fire_district":"A fire district. Example: Union Grove Volunteer Fire District 16.","fire_protection_district":"A fire protection district. Example: Newport Township Fire Protection District.","forest_preserve_district":"A forest preserve district (Illinois). Example: Forest Preserve District of DuPage County.","gid":"A general improvement district (Nevada). Example: Incline Village General Improvement District.","governors_council":"A district of the Massachusetts Governor’s Council. Example: Massachusetts Governor's Council District 1.","hospital_district":"A hospital district. Example: North Pine Area Hospital District.","judicial":"A judicial district or circuit. Example: Court of Appeal, First Appellate District.","judicial_circuit":"A judicial circuit. Example: 7th Judicial Circuit.","judicial_district":"A judicial district. Example: 207th Judicial District.","judicial_subcircuit":"A judicial subcircuit (Illinois). Example: DuPage County (18th Circuit) Judicial Subcircuit 4.","justice_court":"A justice court’s district. Example: Roy/Weber County Justice Court.","justice_court_district":"A justice court district. Example: Lauderdale County Justice Court District 2.","justice_precinct":"A justice of the peace precinct. Example: Travis County Justice of the Peace Precinct 1.","learning_community_subcouncil":"A subcouncil district of Nebraska’s Learning Community. Example: Learning Community of Douglas and Sarpy Counties Subcouncil 1.","legislative":"A legislative district (Nebraska’s one-house Legislature). Example: Nebraska Legislative District 2.","library_district":"A library district. Example: Vernon Area Public Library District.","magistrate":"A magistrate district. Example: Doña Ana County Magistrate District 1.","magistrate_district":"A magistrate or magisterial district. Example: Jefferson County Magisterial District 1.","mental_health_district":"A mental health services district. Example: Proposed Mid-Northside Expanded Mental Health Services Program territory.","municipality":"A whole municipality: a city, borough, town or village. Example: East Newark Borough.","natural_resources_district":"A natural resources district or subdistrict (Nebraska). Example: Papio-Missouri River NRD Subdistrict 2.","nursing_home":"A nursing home district. Example: Golden Age Nursing Home District.","park_district":"A park district. Example: Hennepin County Park District 1.","pec_district":"A Public Education Commission district (New Mexico). Example: Public Education Commission District 1.","place":"A whole city or town (a Census place). Example: City of Camp Verde.","port_district":"A port district. Example: Grant County Port Dist #4.","precinct":"A single voting precinct. Example: Chicago Ward 7, Precinct 13.","precinct_group":"A group of voting precincts. Example: Chicago Ward 7 Precinct 14 and Ward 10 Precincts 2 and 4.","probate_district":"A probate court district. Example: Tobacco Valley Probate District.","prosecutorial":"A prosecutorial district. Example: Prosecutorial District 1 (York County).","prosecutorial_district":"A prosecutorial district. Example: Prosecutorial District 17.","psc_district":"A public service commission district. Example: Montana Public Service Commission District 1.","public_power_district":"A public power district or subdivision (Nebraska). Example: Omaha Public Power District Subdivision 1.","public_service_commission":"A public service commission district. Example: Louisiana Public Service Commission District 1.","public_service_district":"A public service commission district. Example: Mississippi Central Public Service Commission District.","public_utility_district":"A public utility district. Example: Lincoln County Public Utility District.","quorum_court_district":"A quorum court district (Arkansas’s county legislature). Example: Pulaski County Quorum Court District 1.","reclamation_district":"A reclamation district or subdivision. Example: Twin Loups Reclamation District Subdivision 1.","regents_district":"A board of regents district. Example: Board of Regents District 2.","regional":"A region made of several counties or cities, for a regional measure. Example: Regional Transit Measure area (Alameda, Contra Costa, San Francisco, San Mateo, Santa Clara).","regional_office_of_education":"A regional office of education (Illinois). Example: Regional Office of Education 4 (Boone and Winnebago Counties).","registry_district":"A registry of deeds district. Example: Aroostook County Registry of Deeds, Northern District.","road":"A road district. Example: Stone County Northern Road District.","rtm_district":"A Representative Town Meeting district (Connecticut). Example: Darien RTM District 1.","sanitary_district":"A sanitary district. Example: East Joliet Sanitary District.","sboe":"A state board of education district. Example: Kansas State Board of Education District 10.","sboe_district":"A state board of education district. Example: Nevada State Board of Education District 1.","school":"A school district (or a whole district, for a district-wide seat). Example: San Francisco Unified School District.","school_board":"A school board member district. Example: Matanuska-Susitna Borough School District, School Board District 3.","school_board_district":"A school board member district. Example: Jefferson County Board of Education District 4.","school_district":"A whole school district. Example: Princeton Independent School District.","school_district_area":"A residence or trustee area of a school district. Example: LCSD 1 Residence Area 1.","school_subdistrict":"A school board subdistrict. Example: Omaha Public Schools Subdistrict 8.","school_tax_district":"A school tax or attendance district. Example: Odenville School Attendance and Tax District.","school_zone":"A school board zone. Example: Conway Public Schools Zone 3.","service_district":"A service district (senior citizens, recreation and the like). Example: Natrona County Senior Citizens Service District.","sewer_district":"A sewer district. Example: West Side Sewer District.","sldl":"A district of the lower house of the state legislature. Example: Arizona State House District 1.","sldu":"A district of the upper house (state senate). Example: Colorado State Senate District 10.","soil_conservation_district":"A soil conservation district. Example: Cass County Soil Conservation District.","soil_water_district":"A soil and water conservation district. Example: Aitkin County Soil and Water Conservation District.","special":"A special district: library, water, fire, park, transit and the like. Example: Altadena Library District.","special_district":"A special district. Example: Tarrant Appraisal District.","state":"A whole state. Example: Nevada.","state_board_of_education":"A state board of education district. Example: Texas State Board of Education District 2.","state_house":"A state house district (the lower house). Example: South Carolina House District 1.","state_lower":"A district of the lower house of the state legislature. Example: State Assembly District 17.","state_upper":"A district of the upper house (state senate). Example: State Senate District 2.","statewide":"A whole state. Example: California.","superior_court":"A superior court’s district. Example: Superior Court of Ferry, Pend Oreille and Stevens Counties.","superior_court_district":"A superior court district. Example: Superior Court District 17.","supervisorial":"A county (or city and county) supervisorial district. Example: Supervisorial District 2.","supreme_court_district":"A state supreme court district. Example: Kentucky Supreme Court District 3.","tax_district":"A tax district. Example: Fulton County outside the City of Atlanta.","town":"A whole town. Example: Town of Carmel.","township":"A township. Example: Pulaski County, Big Rock Township (Constable).","transit":"A transit district’s member district. Example: BART District 8.","transit_district":"A transit district or its director district. Example: RTD Director District B.","transportation_district":"A transportation district (a transportation benefit district, for example). Example: Chelan Transportation Benefit District.","trustee_area":"A trustee area of a school or college district. Example: Grossmont-Cuyamaca Community College District Trustee Area 5.","trustee_district":"A trustee district of a school district. Example: Austin ISD Trustee District 1.","tv_district":"A television district (Nevada’s TV translator districts). Example: Verdi Television District.","utility_district":"A utility district. Example: Horizon Regional MUD, Mountain Shadow Unit 1 Defined Area.","village":"A whole village. Example: Village of Brewster.","ward":"A city ward. Example: Little Rock Ward 1.","water":"A water supply district. Example: Stone County Public Water Supply District No. 1.","water_district":"A water district. Example: Lower Valley Water District.","water_reclamation_district":"A water reclamation district. Example: Metropolitan Water Reclamation District of Greater Chicago.","water_sewer_district":"A water and sewer district. Example: Jamestown/Rio Vista Water and Sewer District.","watershed_district":"A watershed district. Example: South Tyger River Watershed Conservation District."},"x-values":"district-type"},"state":{"type":["string","null"],"pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}}},"election":{"type":"object","description":"The election the contest is in.","required":["slug","name","date","type","stage"],"properties":{"slug":{"type":"string","description":"Election slug."},"name":{"type":"string","description":"Election name."},"date":{"type":"string","description":"Election day.","format":"date"},"type":{"type":"string","description":"Kind of election.","enum":["general","primary","special","special_primary","runoff","consolidated"],"x-enumDescriptions":{"general":"A general election: the November election (or a state’s regular election day) that fills offices and decides measures.","primary":"A primary: voters choose each party’s nominee, or (in top-two and Louisiana-style states) the candidates who go on to the general.","special":"A special election held outside the regular schedule, usually to fill a vacancy or decide a measure.","special_primary":"The primary for a special election.","runoff":"A runoff between the leading candidates when no one won the earlier round outright (the share needed is in the contest’s details.majority_required or vote_required).","consolidated":"Several jurisdictions’ elections held together on one ballot (a city and school election on the same day, for example); details.consolidated_with names them."},"x-values":"election-type"},"stage":{"type":"string","description":"general, primary or runoff, from the kind of election.","enum":["general","primary","runoff"],"x-enumDescriptions":{"general":"A general, special or consolidated election: it fills the office or decides the measure.","primary":"A primary or special primary: it nominates, or in top-two states picks who goes on to the general.","runoff":"A runoff between the leading candidates of an earlier round."},"x-values":"election-stage"}}},"status":{"type":"string","description":"unofficial (election-night and canvass counts, still changing) or certified (the canvass is certified).","enum":["unofficial","certified"],"x-enumDescriptions":{"unofficial":"Election-night and canvass counts: still changing. We read them again every day until they’re certified.","certified":"The canvass is certified: the final official count."},"x-values":"result-status"},"source_kind":{"type":"string","description":"Where the result comes from: official (a state, county, city or federal election office), compiled (certified official returns compiled by a research group, such as the MIT Election Data and Science Lab’s precinct returns, summed to the contest) party (a state or national party’s own announcement of the winner, with no vote counts; replaced as soon as an official result appears) or reported (read from a page that reports the result, such as a news story calling the race or a concession; always unofficial, used only where nothing else exists, replaced as soon as an official result appears).","enum":["official","compiled","party","reported"],"x-enumDescriptions":{"official":"A state, county, city or federal election office.","compiled":"Certified official returns compiled by a research group (the MIT Election Data and Science Lab’s precinct returns), summed to the contest. Used for past elections; official_url links to the state’s own results where we have them.","party":"A state or national party’s announcement of the winner, with no vote counts (party_reported is true). Replaced as soon as an official result appears.","reported":"Read from a page that reports the result: a news story calling the race, a candidate’s concession, a results post. Status is always unofficial; vote counts and shares only as the page printed them, often none. Two independent AI readers must agree on it, or a person must check it, before it is kept. Used only where no official, compiled or party result exists, and replaced as soon as an official result appears."},"x-values":"result-source-kind"},"party_reported":{"type":"boolean","description":"true when the result is a party’s announcement (source_kind party), not an official count."},"decided":{"type":"boolean","description":"The source names at least one winner. false while counts are still coming in, for a race headed to a runoff, or where the source doesn’t say."},"total_votes":{"type":["integer","null"],"description":"Votes cast in the contest: the printed choices plus write-ins. null on a party-reported result."},"precincts_reporting":{"type":["integer","null"],"description":"Precincts counted so far, where the source says."},"precincts_total":{"type":["integer","null"],"description":"Precincts in the contest, where the source says."},"winners":{"type":"array","description":"The choices marked winner, most votes first. Empty until the source names one.","items":{"$ref":"#/components/schemas/ResultChoice"}},"margin":{"description":"The deciding margin; null without votes for both places (a party-reported winner, an uncontested race). While a count is unofficial it is the current lead.","oneOf":[{"$ref":"#/components/schemas/ResultMargin"},{"type":"null"}]},"choices":{"type":"array","description":"Every choice with a result line, most votes first.","items":{"$ref":"#/components/schemas/ResultChoice"}},"source":{"type":"object","description":"The source of the result.","required":["name","url","contest_name","updated_at"],"properties":{"name":{"type":"string","description":"Who published the result.","examples":["California Secretary of State"]},"url":{"type":"string","description":"Where it was published. Every result has one.","format":"uri"},"contest_name":{"type":["string","null"],"description":"The contest’s name in the source, which may differ from the printed title."},"updated_at":{"type":["string","null"],"description":"When the source last updated it, if it says.","format":"date-time"}}},"official_url":{"type":["string","null"],"description":"For a compiled result, the state’s own certified results, where we have them.","format":"uri"},"seat_change":{"description":"Whether the incumbent kept the seat and whether a partisan seat flipped, judged against whoever held it going in; null until the contest has a winner and is linked to its seat.","oneOf":[{"$ref":"#/components/schemas/SeatChange"},{"type":"null"}]},"fetched_at":{"type":"string","description":"When we last read it from the source.","format":"date-time"}}},"SeatChangeParty":{"type":"object","description":"One party’s seats in the selection.","required":["party","slug","held_going_in","won","gained","lost","net"],"properties":{"party":{"type":"string","description":"Party name."},"slug":{"type":"string","description":"Party slug, for flipped_to= and flipped_from=.","examples":["democratic"],"x-enumDescriptions":{"conservative":"Conservative (CON).","constitution":"Constitution (CON).","dc-statehood-green":"DC Statehood Green (STG).","democratic":"Democratic (DEM).","green":"Green (GRN).","independent-american":"Independent American (IAP).","independent-party":"Independent Party (IP).","independent-party-of-delaware":"Independent Party of Delaware (IPD).","independent-party-of-oregon":"Independent Party of Oregon (IPO).","legal-marijuana-now":"Legal Marijuana NOW (LMN).","libertarian":"Libertarian (LIB).","pacific-green":"Pacific Green (PGP).","progressive":"Progressive (PRO).","progressive-party-of-oregon":"Progressive Party (PRO).","republican":"Republican (REP).","working-families":"Working Families (WFP)."},"x-values":"party"},"held_going_in":{"type":"integer","description":"Contests whose holders going in included this party."},"won":{"type":"integer","description":"Contests this party won (for vote for N, at least one seat)."},"gained":{"type":"integer","description":"Flipped contests this party won without holding a seat up going in."},"lost":{"type":"integer","description":"Flipped contests this party held going in and won no seat in."},"net":{"type":"integer","description":"gained minus lost."}}},"SeatChangeCounts":{"type":"object","description":"Seat outcomes counted over a set of contests. A vote-for-N contest counts once for each party in it, not once per seat.","required":["contests","partisan","flipped","flip_unknown","outcomes","parties"],"properties":{"contests":{"type":"integer","description":"Decided contests linked to a seat."},"partisan":{"type":"integer","description":"Of those, contests for partisan seats."},"flipped":{"type":"integer","description":"Partisan seats that changed party."},"flip_unknown":{"type":"integer","description":"Partisan seats where the holder’s or the winner’s party isn’t known, so flipped is null."},"outcomes":{"type":"object","additionalProperties":{"type":"integer"},"description":"Contests by seat outcome (incumbent_reelected, incumbent_defeated, open_seat, new_seat, unknown, incumbents_reelected, mixed); outcomes with none are left out."},"parties":{"type":"array","description":"Each party with a seat up or won, most wins first.","items":{"$ref":"#/components/schemas/SeatChangeParty"}}}},"SeatChangeSummary":{"type":"object","description":"Seats that changed hands, counted.","required":["group_by","totals","groups"],"properties":{"group_by":{"type":["string","null"],"description":"How groups are split; null when group_by wasn’t given.","enum":["state","office_type","election","stage",null],"x-enumDescriptions":{"state":"One group per state (USPS code).","office_type":"One group per office type, such as us_representative or state_senator.","election":"One group per election (its slug).","stage":"One group per election stage: general or runoff (primaries don’t fill seats)."},"x-values":"seat-change-group"},"totals":{"$ref":"#/components/schemas/SeatChangeCounts"},"groups":{"type":["array","null"],"description":"The same counts for each group, most contests first; null without group_by.","items":{"allOf":[{"type":"object","required":["group"],"properties":{"group":{"type":["string","null"],"description":"The group: a state code, office type, election slug or stage; null for contests without one."}}},{"$ref":"#/components/schemas/SeatChangeCounts"}]}}}},"Coverage":{"type":"object","required":["state","name","election_count","contest_count","measure_count","endorser_count","endorsement_count","endorsed_contest_count","first_election","last_election","updated_at"],"properties":{"state":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]},"name":{"type":"string","description":"State name."},"election_count":{"type":"integer","description":"Elections in this state."},"contest_count":{"type":"integer","description":"Contests in those elections."},"measure_count":{"type":"integer","description":"Of those, ballot measures."},"endorser_count":{"type":"integer","description":"Endorsers with endorsements here."},"endorsement_count":{"type":"integer","description":"Endorsements in those contests."},"endorsed_contest_count":{"type":"integer","description":"Contests with at least one endorsement."},"first_election":{"type":["string","null"],"description":"Day of the earliest election counted.","format":"date"},"last_election":{"type":["string","null"],"description":"Day of the latest election counted.","format":"date"},"updated_at":{"type":["string","null"],"description":"When a contest or endorsement last changed.","format":"date-time"}}},"Event":{"type":"object","description":"One endorsement change, as the Endorsement Stream delivers it.","required":["id","type","occurred_at","endorsement","changed","previous","endorser","contest","election","choice"],"properties":{"id":{"type":"string","description":"The change’s id: increasing and unique. Use it to drop repeats."},"type":{"type":"string","description":"What happened: an endorsement created, updated or deleted.","enum":["endorsement.created","endorsement.updated","endorsement.deleted"],"x-enumDescriptions":{"endorsement.created":"A new endorsement.","endorsement.updated":"An endorsement changed; changed and previous say how.","endorsement.deleted":"An endorsement was withdrawn or removed."},"x-values":"event-type"},"occurred_at":{"type":"string","description":"When the change was made.","format":"date-time"},"endorsement":{"type":"object","description":"The endorsement as it is now (for endorsement.deleted, as it was).","required":["id","rank","statement","source_url","published_on","added_by"],"properties":{"id":{"type":"integer","description":"Endorsement id."},"rank":{"type":["integer","null"],"description":"Ranked choice: the rank the endorser gave; null otherwise."},"statement":{"type":["string","null"],"description":"What the endorser said."},"source_url":{"type":["string","null"],"description":"Where it was published.","format":"uri"},"published_on":{"type":["string","null"],"description":"When it was published.","format":"date"},"added_by":{"type":"string","description":"How the endorsement got here: automatic (added by our automatic watch of the endorser’s own page), staff (entered by hand by BallotData staff) or data_load (loaded in a researched data pass).","enum":["automatic","staff","data_load"],"x-enumDescriptions":{"automatic":"Added by our automatic watch of the endorser’s own website. It only adds a candidate the endorser’s own page names for that election; source_url is that page.","staff":"Entered by hand by BallotData staff.","data_load":"Loaded in one of our researched data passes."},"x-values":"added-by"}}},"changed":{"type":"array","description":"For endorsement.updated: the fields that changed. Empty for other events.","items":{"type":"string","enum":["choice_id","rank","statement","source_url","published_on"],"x-enumDescriptions":{"choice_id":"The endorser now backs a different choice in the same contest.","rank":"The ranked-choice rank changed.","statement":"What the endorser said changed.","source_url":"Where it was published changed.","published_on":"The publication date changed."},"x-values":"changed-field"}},"previous":{"description":"For endorsement.updated: the values before the change. null for other events.","oneOf":[{"type":"object","required":["choice_id","rank","statement","source_url","published_on"],"properties":{"choice_id":{"type":"integer","description":"The choice endorsed before."},"rank":{"type":["integer","null"],"description":"The rank before."},"statement":{"type":["string","null"],"description":"The statement before."},"source_url":{"type":["string","null"],"description":"The source URL before.","format":"uri"},"published_on":{"type":["string","null"],"description":"The publication date before.","format":"date"}}},{"type":"null"}]},"endorser":{"type":"object","description":"Who made the endorsement.","required":["id","slug","name","category","state"],"properties":{"id":{"type":"integer","description":"Endorser id."},"slug":{"type":["string","null"],"description":"Endorser slug; null if the endorser has since been removed."},"name":{"type":["string","null"],"description":"Endorser name; null if the endorser has since been removed."},"category":{"description":"The endorser’s category.","oneOf":[{"$ref":"#/components/schemas/Category"},{"type":"null"}]},"state":{"type":["string","null"],"description":"Home state, or null for a national endorser."}}},"contest":{"type":"object","description":"The contest.","required":["id","title","short_title","kind","vote_method","votes_allowed","ranks_allowed","measure_code","district"],"properties":{"id":{"type":"integer","description":"Contest id."},"title":{"type":["string","null"],"description":"Title as printed on the ballot."},"short_title":{"type":["string","null"],"description":"Shorter title."},"kind":{"type":["string","null"],"description":"candidate (an office), measure (a proposition) or retention (keep a judge?).","enum":["candidate","measure","retention",null],"x-enumDescriptions":{"candidate":"A race for an office: voters choose among candidates.","measure":"A ballot measure (proposition, amendment, bond, tax, referendum or initiative): voters answer Yes or No.","retention":"A judicial retention question: should this judge stay in office? Voters answer Yes or No."},"x-values":"contest-kind"},"vote_method":{"type":["string","null"],"description":"How votes are cast.","enum":["plurality","multi_seat","ranked_choice","approval","yes_no",null],"x-enumDescriptions":{"plurality":"Vote for one: the candidate with the most votes wins (or goes to a runoff where a majority is required).","multi_seat":"Vote for up to N (votes_allowed): several seats are filled at once and the top N win.","ranked_choice":"Ranked choice: voters rank up to ranks_allowed candidates; endorsements carry the endorser’s rank 1, 2, 3…. rcv_rounds holds the official tabulation once there is one.","approval":"Approval voting: voters mark every candidate they approve of; the most-approved win (Fargo, St. Louis).","yes_no":"A Yes or No question: every measure and retention question."},"x-values":"vote-method"},"votes_allowed":{"type":["integer","null"],"description":"How many choices a voter may mark (vote for N)."},"ranks_allowed":{"type":["integer","null"],"description":"Ranked choice: how many choices a voter may rank."},"measure_code":{"type":["string","null"],"description":"The measure’s letter or number."},"district":{"description":"The district the contest is voted in.","oneOf":[{"type":"object","required":["id","name","level","ocd_id","state"],"properties":{"id":{"type":"integer","description":"District id."},"name":{"type":"string","description":"District name."},"level":{"type":"string","description":"Level of government.","enum":["federal","state","county","city","school","special"],"x-enumDescriptions":{"federal":"The whole country, or a U.S. House district.","state":"A whole state, or a state legislative, judicial or other state district.","county":"A county (a parish in Louisiana, a borough in Alaska) or a district within one.","city":"A city, town, township, village or borough, or a ward or council district within one.","school":"A school district, community college district, or a trustee area within one.","special":"A special district: water, fire, hospital, park, transit, port, conservation and the like."},"x-values":"district-level"},"ocd_id":{"type":["string","null"],"description":"Open Civic Data division id."},"state":{"type":["string","null"],"description":"USPS state code."}}},{"type":"null"}]}}},"election":{"description":"The contest’s election.","oneOf":[{"type":"object","required":["id","slug","name","date","state","type"],"properties":{"id":{"type":"integer","description":"Election id."},"slug":{"type":"string","description":"Election slug."},"name":{"type":"string","description":"Election name."},"date":{"type":"string","description":"Election day.","format":"date"},"state":{"type":["string","null"],"description":"USPS state code; null for a multi-state election."},"type":{"type":"string","description":"Kind of election.","enum":["general","primary","special","special_primary","runoff","consolidated"],"x-enumDescriptions":{"general":"A general election: the November election (or a state’s regular election day) that fills offices and decides measures.","primary":"A primary: voters choose each party’s nominee, or (in top-two and Louisiana-style states) the candidates who go on to the general.","special":"A special election held outside the regular schedule, usually to fill a vacancy or decide a measure.","special_primary":"The primary for a special election.","runoff":"A runoff between the leading candidates when no one won the earlier round outright (the share needed is in the contest’s details.majority_required or vote_required).","consolidated":"Several jurisdictions’ elections held together on one ballot (a city and school election on the same day, for example); details.consolidated_with names them."},"x-values":"election-type"}}},{"type":"null"}]},"choice":{"type":"object","description":"The choice endorsed.","required":["id","label","measure_answer","candidate","party","withdrawn","incumbent"],"properties":{"id":{"type":"integer","description":"Choice id."},"label":{"type":["string","null"],"description":"As printed: the candidate’s ballot name, or Yes / No."},"measure_answer":{"type":["string","null"],"description":"yes or no for a measure; null for a candidate.","enum":["yes","no",null],"x-enumDescriptions":{"yes":"The Yes line of a measure or retention question. On an endorsement: the endorser says vote Yes.","no":"The No line. On an endorsement: the endorser says vote No."},"x-values":"measure-answer"},"candidate":{"description":"The candidate; null for a measure answer.","oneOf":[{"type":"object","required":["id","full_name"],"properties":{"id":{"type":"integer","description":"Candidate id."},"full_name":{"type":"string","description":"Full name."}}},{"type":"null"}]},"party":{"description":"The party printed beside the name.","oneOf":[{"type":"object","required":["slug","name"],"properties":{"slug":{"type":"string","description":"Party slug."},"name":{"type":"string","description":"Party name."}}},{"type":"null"}]},"withdrawn":{"type":["boolean","null"],"description":"The candidate withdrew but is still printed on the ballot."},"incumbent":{"type":["boolean","null"],"description":"The candidate holds this seat now: true or false where we know, null where we don’t (and for a measure answer)."}}}}},"Subscription":{"type":"object","required":["id","name","filter","created_at","updated_at"],"properties":{"id":{"type":"integer","description":"Subscription id."},"name":{"type":"string","description":"Name, unique in your account."},"filter":{"$ref":"#/components/schemas/Filter"},"created_at":{"type":"string","description":"When the subscription was created.","format":"date-time"},"updated_at":{"type":"string","description":"When it last changed.","format":"date-time"}}},"SubscriptionInput":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"1–100 letters, digits, spaces, dots, dashes or underscores.","pattern":"^[A-Za-z0-9][A-Za-z0-9 ._-]{0,99}$"},"filter":{"$ref":"#/components/schemas/Filter"}}}},"responses":{"BadRequest":{"description":"A parameter is missing or not valid.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"invalid_parameter":{"value":{"error":{"code":"invalid_parameter","message":"states: \"California\" isn't valid.","request_id":"8c1f2a4e-6b7d-4c3e-9f10-2a3b4c5d6e7f"}}},"invalid_cursor":{"value":{"error":{"code":"invalid_cursor","message":"That cursor is not valid.","request_id":"8c1f2a4e-6b7d-4c3e-9f10-2a3b4c5d6e7f"}}}}}}},"Unauthorized":{"description":"No API key, or one that isn’t valid, was revoked or expired.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"missing_api_key":{"value":{"error":{"code":"missing_api_key","message":"Send your API key as \"Authorization: Bearer <key>\".","request_id":"8c1f2a4e-6b7d-4c3e-9f10-2a3b4c5d6e7f"}}},"invalid_api_key":{"value":{"error":{"code":"invalid_api_key","message":"That API key is not valid.","request_id":"8c1f2a4e-6b7d-4c3e-9f10-2a3b4c5d6e7f"}}}}}}},"Forbidden":{"description":"The key can’t be used for this: a missing scope, an IP allowlist, an account not yet approved, or data the account hasn’t bought.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"insufficient_scope":{"value":{"error":{"code":"insufficient_scope","message":"This API key doesn't have the data:read scope.","request_id":"8c1f2a4e-6b7d-4c3e-9f10-2a3b4c5d6e7f"}}},"no_access":{"value":{"error":{"code":"no_access","message":"Your account has no API data yet, or its purchase has ended. Buy API access at ballotdata.ai with the email address you use here.","request_id":"8c1f2a4e-6b7d-4c3e-9f10-2a3b4c5d6e7f"}}},"outside_purchase":{"value":{"error":{"code":"outside_purchase","message":"Your account hasn't bought NY. It covers CA.","request_id":"8c1f2a4e-6b7d-4c3e-9f10-2a3b4c5d6e7f"}}},"account_pending":{"value":{"error":{"code":"account_pending","message":"Your account is waiting for approval.","request_id":"8c1f2a4e-6b7d-4c3e-9f10-2a3b4c5d6e7f"}}}}}}},"NotFound":{"description":"Nothing has that id or slug.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"not_found":{"value":{"error":{"code":"not_found","message":"No contest has that id.","request_id":"8c1f2a4e-6b7d-4c3e-9f10-2a3b4c5d6e7f"}}}}}}},"Conflict":{"description":"A subscription with that name already exists.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"conflict":{"value":{"error":{"code":"conflict","message":"A subscription with that name already exists.","request_id":"8c1f2a4e-6b7d-4c3e-9f10-2a3b4c5d6e7f"}}}}}}},"TooManyRequests":{"description":"Over a rate limit: your account’s requests a minute or a day (UTC), its open streams, or too many requests with a missing or wrong key from your address. Wait Retry-After seconds.","headers":{"Retry-After":{"description":"Seconds to wait.","schema":{"type":"integer"}},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"rate_limit_exceeded":{"value":{"error":{"code":"rate_limit_exceeded","message":"Your plan allows 600 requests a minute.","request_id":"8c1f2a4e-6b7d-4c3e-9f10-2a3b4c5d6e7f"}}},"daily_limit_exceeded":{"value":{"error":{"code":"daily_limit_exceeded","message":"Your plan allows 200000 requests a day (UTC).","request_id":"8c1f2a4e-6b7d-4c3e-9f10-2a3b4c5d6e7f"}}},"too_many_streams":{"value":{"error":{"code":"too_many_streams","message":"Your plan allows 5 open stream connections.","request_id":"8c1f2a4e-6b7d-4c3e-9f10-2a3b4c5d6e7f"}}},"too_many_failures":{"value":{"error":{"code":"too_many_failures","message":"Too many requests with a missing or wrong API key.","request_id":"8c1f2a4e-6b7d-4c3e-9f10-2a3b4c5d6e7f"}}}}}}},"Gone":{"description":"The cursor is older than the stream keeps.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"cursor_expired":{"value":{"error":{"code":"cursor_expired","message":"That position is older than the stream keeps. Catch up with GET /v1/endorsements, then start again with from=latest.","request_id":"8c1f2a4e-6b7d-4c3e-9f10-2a3b4c5d6e7f"}}}}}}},"Unavailable":{"description":"Not ready yet on this server. Wait Retry-After seconds.","headers":{"Retry-After":{"description":"Seconds to wait.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"warming_up":{"value":{"error":{"code":"warming_up","message":"The stream is still loading on this server. Try again in a few seconds.","request_id":"8c1f2a4e-6b7d-4c3e-9f10-2a3b4c5d6e7f"}}},"not_available":{"value":{"error":{"code":"not_available","message":"Officeholder data is not loaded yet. Try again later.","request_id":"8c1f2a4e-6b7d-4c3e-9f10-2a3b4c5d6e7f"}}}}}}}}},"paths":{"/v1/states":{"get":{"operationId":"listStates","tags":["Elections"],"summary":"List states","description":"Every state, D.C. and territory, with its USPS and FIPS codes. Use the codes in states= filters.","responses":{"200":{"description":"Every state.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","description":"Every item.","items":{"$ref":"#/components/schemas/State"}}}},"example":{"data":[{"code":"AK","fips":"02","name":"Alaska"},{"code":"AL","fips":"01","name":"Alabama"},{"code":"AR","fips":"05","name":"Arkansas"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/states\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst states = await client.states.list();"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nstates = client.states.list()"}],"parameters":[{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"code,name"}]}},"/v1/elections":{"get":{"operationId":"listElections","tags":["Elections"],"summary":"List elections","description":"Elections, with their voting rules in details (all-mail, ranked choice, fusion, runoff dates) and how many contests, endorsements and results each has. Past elections kept for their results (the November 5, 2024 general in every state) are listed too, with details.historical; upcoming=true leaves them out. Find one by words with q (georgia 2024 general). Use an election’s slug to ask for its contests or endorsements.","parameters":[{"name":"states","in":"query","description":"USPS codes. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}},"style":"form","explode":false,"example":"CA"},{"name":"types","in":"query","description":"Kinds of election (general, primary, special, runoff and so on). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["general","primary","special","special_primary","runoff","consolidated"],"x-enumDescriptions":{"general":"A general election: the November election (or a state’s regular election day) that fills offices and decides measures.","primary":"A primary: voters choose each party’s nominee, or (in top-two and Louisiana-style states) the candidates who go on to the general.","special":"A special election held outside the regular schedule, usually to fill a vacancy or decide a measure.","special_primary":"The primary for a special election.","runoff":"A runoff between the leading candidates when no one won the earlier round outright (the share needed is in the contest’s details.majority_required or vote_required).","consolidated":"Several jurisdictions’ elections held together on one ballot (a city and school election on the same day, for example); details.consolidated_with names them."},"x-values":"election-type"}},"style":"form","explode":false,"example":"general"},{"name":"upcoming","in":"query","description":"true for only elections from yesterday on; false (the default) for every election.","schema":{"type":"boolean","default":false},"example":true},{"name":"from","in":"query","description":"Elections on or after this date.","schema":{"type":"string","format":"date"},"example":"2026-11-01"},{"name":"to","in":"query","description":"Elections on or before this date.","schema":{"type":"string","format":"date"},"example":"2026-12-31"},{"name":"q","in":"query","description":"Search words, up to 200 characters: every word must start a word of the election’s name, slug, state name or code, date (2024 12 03), month name, year or type (case-insensitive; a number must match a whole word). Up to 8 words count. GET /v1/search also finds the nationwide names, such as 2026-11-03-general.","schema":{"type":"string","maxLength":200},"example":"georgia 2024 general"},{"name":"lang","in":"query","description":"es for Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English otherwise. Names are never translated.","schema":{"type":"string","enum":["en","es"],"x-enumDescriptions":{"en":"English (the default).","es":"Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English where it doesn’t. Names are never translated."},"x-values":"lang","default":"en"},"example":"es"},{"name":"limit","in":"query","description":"Results per page, 1–500.","schema":{"type":"integer","minimum":1,"maximum":500,"default":100},"example":20},{"name":"cursor","in":"query","description":"Where the next page starts: the next_cursor from the previous page. Leave it out for the first page; it is opaque, so pass it back exactly as you got it.","schema":{"type":"string"},"example":"aTo0NDEw"},{"name":"format","in":"query","description":"json (the default) or csv: the same page as CSV, with the next page’s cursor in the X-Next-Cursor header. The data dictionaries list the columns.","schema":{"type":"string","enum":["json","csv"],"x-enumDescriptions":{"json":"The JSON response, { \"data\": [...], \"next_cursor\": \"…\" } (the default).","csv":"The same page as CSV (text/csv), one row per record or per choice, contest, election or endorser compared, as each endpoint says. The columns are listed in the data dictionaries; the next page’s cursor comes in the X-Next-Cursor header and a Link header."},"x-values":"list-format","default":"json"},"example":"csv"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"slug,name,date,state"}],"responses":{"200":{"description":"A page of elections, by id. With format=csv, the same as CSV (text/csv). One row per election.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-Next-Cursor":{"description":"format=csv: the next page’s cursor (absent on the last page).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","description":"This page.","items":{"$ref":"#/components/schemas/ElectionSummary"}},"next_cursor":{"type":["string","null"],"description":"Pass as cursor= for the next page; null on the last page."}}},"example":{"data":[{"id":3,"slug":"ca-2026-11-03-general","name":"California General Election","short_name":"General Election","date":"2026-11-03","state":"CA","type":"general","primary_system":"top_two","info_url":"https://www.sos.ca.gov/elections/upcoming-elections","details":{"all_mail":true},"contest_count":1184,"endorsement_count":9632,"result_count":1012},{"id":812,"slug":"ca-2024-11-05-general","name":"California General Election","short_name":"General Election","date":"2024-11-05","state":"CA","type":"general","primary_system":"top_two","info_url":"https://www.sos.ca.gov/elections/upcoming-elections","details":{"all_mail":true,"historical":true},"contest_count":1630,"endorsement_count":0,"result_count":1630}],"next_cursor":"aToz"}},"text/csv":{"schema":{"type":"string"},"example":"election_id,slug,name,short_name,date,state,type,primary_system,info_url,contest_count,endorsement_count,result_count\r\n3,ca-2026-11-03-general,California General Election,General Election,2026-11-03,CA,general,top_two,https://www.sos.ca.gov/elections/upcoming-elections,1184,9632,1012\r\n812,ca-2024-11-05-general,California General Election,General Election,2024-11-05,CA,general,top_two,https://www.sos.ca.gov/elections/upcoming-elections,1630,0,1630\r\n"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/elections?states=CA&upcoming=true\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst { data: elections } = await client.elections.list({ states: 'CA', upcoming: true });"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nelections = client.elections.list(states=\"CA\", upcoming=True).data"}]}},"/v1/search":{"get":{"operationId":"search","tags":["Search"],"summary":"Search everything by name","description":"One search across elections, contests, candidates, endorsers and offices, for when you know a name and need its slug or id. Each match gives its type, slug or id, a label and a few words of detail, and the API path that gets it. Elections include the nationwide names an elections filter takes: a date and type (2026-11-03-general) and a bare date (2026-11-03). Every word must start a word of the record’s name or of what describes it (state, category, district, election, other names); a number must match a whole word. Matches on the slug or the name come first, then each kind’s best in turn. One page, best first: narrow with types or states, or use the list endpoints’ q to page through every match of one kind.","parameters":[{"name":"q","in":"query","description":"Search words, up to 200 characters, or a slug. Up to 8 words count.","schema":{"type":"string","maxLength":200},"example":"georgia senate 43","required":true},{"name":"types","in":"query","description":"Only these kinds: election, contest, candidate (people and candidate records), endorser, office. All of them by default. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["election","contest","candidate","endorser","office"],"x-enumDescriptions":{"election":"Elections, and the nationwide names an elections filter takes (2026-11-03-general, 2026-11-03).","contest":"Contests and ballot measures, by title, district, state, election, office or candidate (as GET /v1/contests?q= finds them).","candidate":"People who ran (a person slug ties together every candidate record for one person), and candidate records not yet linked to a person.","endorser":"Endorsers, by name, category and home state.","office":"Seats that last across elections (GET /v1/offices), by name, seat, office type and state."},"x-values":"search-type"}},"style":"form","explode":false,"example":"election,endorser"},{"name":"states","in":"query","description":"Only records in these states (USPS codes). Leaves out national endorsers and the nationwide election names. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}},"style":"form","explode":false,"example":"GA"},{"name":"limit","in":"query","description":"Matches to return, 1–100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"example":10},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"type,slug,label,path"}],"responses":{"200":{"description":"The best matches, best first.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","description":"Every item.","items":{"$ref":"#/components/schemas/SearchMatch"}}}},"example":{"data":[{"type":"office","slug":"ga-state-senate-43","id":null,"label":"Georgia Senate District 43","detail":"Georgia","state":"GA","date":null,"path":"/v1/offices/ga-state-senate-43","match":2},{"type":"contest","slug":null,"id":10861,"label":"State Senator, District 43","detail":"Georgia Senate District 43, Georgia General Election","state":"GA","date":"2026-11-03","path":"/v1/contests/10861","match":3},{"type":"contest","slug":null,"id":46799,"label":"State Senate - District 43","detail":"Georgia Senate District 43, Georgia General Election","state":"GA","date":"2024-11-05","path":"/v1/contests/46799","match":3}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/search?q=georgia+senate+43\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst matches = await client.search({ q: 'georgia senate 43' });"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nmatches = client.search(\"georgia senate 43\")"}]}},"/v1/coverage":{"get":{"operationId":"getCoverage","tags":["Elections"],"summary":"Coverage by state","description":"What the API has for each state: elections, contests, measures, endorsers and endorsements, and when they last changed. Handy for deciding what to sync.","parameters":[{"name":"upcoming","in":"query","description":"true (the default) counts only upcoming elections; false counts every election.","schema":{"type":"boolean","default":true},"example":false},{"name":"format","in":"query","description":"json (the default) or csv: the same page as CSV, with the next page’s cursor in the X-Next-Cursor header. The data dictionaries list the columns.","schema":{"type":"string","enum":["json","csv"],"x-enumDescriptions":{"json":"The JSON response, { \"data\": [...], \"next_cursor\": \"…\" } (the default).","csv":"The same page as CSV (text/csv), one row per record or per choice, contest, election or endorser compared, as each endpoint says. The columns are listed in the data dictionaries; the next page’s cursor comes in the X-Next-Cursor header and a Link header."},"x-values":"list-format","default":"json"},"example":"csv"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"state,contest_count,endorsement_count"}],"responses":{"200":{"description":"One row per state. With format=csv, the same as CSV (text/csv). One row per state.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-Next-Cursor":{"description":"format=csv: the next page’s cursor (absent on the last page).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","description":"Every item.","items":{"$ref":"#/components/schemas/Coverage"}}}},"example":{"data":[{"state":"CA","name":"California","election_count":1,"contest_count":1184,"measure_count":402,"endorser_count":611,"endorsement_count":9632,"endorsed_contest_count":730,"first_election":"2026-11-03","last_election":"2026-11-03","updated_at":"2026-10-21T14:02:11.408Z"}]}},"text/csv":{"schema":{"type":"string"},"example":"state,name,election_count,contest_count,measure_count,endorser_count,endorsement_count,endorsed_contest_count,first_election,last_election,updated_at\r\nCA,California,1,1184,402,611,9632,730,2026-11-03,2026-11-03,2026-10-21T14:02:11.408Z\r\n"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/coverage\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst coverage = await client.coverage.list();"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\ncoverage = client.coverage.list()"}]}},"/v1/contests":{"get":{"operationId":"listContests","tags":["Contests"],"summary":"List contests","description":"The races on the ballot, each with its district, its election, its voting rules, every choice in ballot order and, once a source has one, its result (votes for each choice and the winners). Filter by election, state, level, kind, district, office, measure topic or result, or search every election by words (q), a candidate’s name (candidate) and election dates (from, to); sort=newest puts the latest elections first. To see who endorsed whom, use GET /v1/contests/{id} or /v1/endorsements.","parameters":[{"name":"slugs","in":"query","description":"Only these contests, by slug (Contest.slug, also in search results). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]*/[a-z0-9][a-z0-9-]*$"}},"style":"form","explode":false,"example":"ca-2026-11-03-general/prop-50"},{"name":"elections","in":"query","description":"Election slugs (GET /v1/elections). A date and type (2026-11-03-general) matches every election of that type that day nationwide, and a bare date (2026-11-03) every election that day. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"ca-2026-11-03-general"},{"name":"states","in":"query","description":"States the contests are voted in (USPS codes). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}},"style":"form","explode":false,"example":"CA"},{"name":"levels","in":"query","description":"Levels of the contest’s district, from federal down to school and special districts. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["federal","state","county","city","school","special"],"x-enumDescriptions":{"federal":"The whole country, or a U.S. House district.","state":"A whole state, or a state legislative, judicial or other state district.","county":"A county (a parish in Louisiana, a borough in Alaska) or a district within one.","city":"A city, town, township, village or borough, or a ward or council district within one.","school":"A school district, community college district, or a trustee area within one.","special":"A special district: water, fire, hospital, park, transit, port, conservation and the like."},"x-values":"district-level"}},"style":"form","explode":false,"example":"county,city"},{"name":"contest_kinds","in":"query","description":"Contest kinds: candidate (an office), measure, or retention (whether to keep a judge). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["candidate","measure","retention"],"x-enumDescriptions":{"candidate":"A race for an office: voters choose among candidates.","measure":"A ballot measure (proposition, amendment, bond, tax, referendum or initiative): voters answer Yes or No.","retention":"A judicial retention question: should this judge stay in office? Voters answer Yes or No."},"x-values":"contest-kind"}},"style":"form","explode":false,"example":"measure"},{"name":"districts","in":"query","description":"OCD division ids of the contests’ districts. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"ocd-division/country:us/state:ca/county:san_francisco"},{"name":"offices","in":"query","description":"Only contests for these offices (Office.type): us_representative, governor, mayor, school_board, … Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["president","us_senator","us_representative","governor","lieutenant_governor","attorney_general","secretary_of_state","state_treasurer","state_auditor","state_superintendent","insurance_commissioner","agriculture_commissioner","land_commissioner","labor_commissioner","utility_commission","university_board","state_board_of_education","state_senator","state_representative","state_supreme_court","state_appellate_court","trial_court","municipal_court","magistrate","justice_of_the_peace","court_clerk","mayor","local_executive","city_council","county_legislature","neighborhood_council","school_board","school_superintendent","college_board","special_district_board","water_conservation_board","sheriff","prosecutor","coroner","constable","assessor","tax_collector","treasurer","auditor","recorder","clerk","surveyor","public_works","police_fire","other_county_office","other"],"x-enumDescriptions":{"president":"President of the United States (with the vice president on the same ticket).","us_senator":"U.S. Senator.","us_representative":"U.S. Representative, or a non-voting delegate to the House.","governor":"Governor.","lieutenant_governor":"Lieutenant governor.","attorney_general":"State attorney general.","secretary_of_state":"Secretary of state.","state_treasurer":"State treasurer.","state_auditor":"State auditor, comptroller or controller.","state_superintendent":"State superintendent of public instruction (the elected head of state schools).","insurance_commissioner":"State insurance commissioner.","agriculture_commissioner":"State agriculture commissioner.","land_commissioner":"State land commissioner (public lands).","labor_commissioner":"State labor commissioner.","utility_commission":"A state utility, public service or corporation commission seat.","university_board":"A state university board of regents or trustees seat.","state_board_of_education":"A state board of education seat.","state_senator":"State senator (the upper house of the legislature; Nebraska’s one-house Legislature too).","state_representative":"State representative, assemblymember or delegate (the lower house).","state_supreme_court":"A justice of the state’s highest court.","state_appellate_court":"A judge of a state intermediate appeals court.","trial_court":"A judge of a general trial court: superior, district, circuit, county or probate court.","municipal_court":"A city or municipal court judge.","magistrate":"A magistrate.","justice_of_the_peace":"A justice of the peace.","court_clerk":"Clerk of a court.","mayor":"Mayor.","local_executive":"Another elected local chief executive: county executive or judge-executive, borough or parish president, first selectman, town or township supervisor, village president.","city_council":"A city, town, village or borough council, select board or board of aldermen seat.","county_legislature":"A county commission, board of supervisors, county council, quorum or fiscal court, or police jury seat.","neighborhood_council":"A neighborhood body: Washington, D.C.’s Advisory Neighborhood Commissions, for example.","school_board":"A school board or board of education seat.","school_superintendent":"An elected county or district school superintendent.","college_board":"A community college district board seat.","special_district_board":"A board of a special district: hospital, fire, park, library, transit, port, utility and similar.","water_conservation_board":"A soil and water conservation, water, irrigation, drainage or flood control district board.","sheriff":"Sheriff.","prosecutor":"District attorney, state’s attorney, county attorney or solicitor.","coroner":"Coroner or medical examiner.","constable":"Constable (or town sergeant).","assessor":"Assessor, appraiser or property valuation administrator.","tax_collector":"Tax collector or tax commissioner.","treasurer":"A county, city or town treasurer.","auditor":"A county, city or town auditor, comptroller or controller.","recorder":"Recorder or register of deeds, wills or probate.","clerk":"A county, city or town clerk, prothonotary or registrar.","surveyor":"County surveyor or engineer.","public_works":"Highway, road or street commissioner, or a public works office.","police_fire":"An elected police chief, fire chief or marshal.","other_county_office":"Another county office: public defender, public administrator, jailer, election director and similar.","other":"An office that fits none of the types above."},"x-values":"office-type"}},"style":"form","explode":false,"example":"mayor,city_council"},{"name":"topics","in":"query","description":"Only measures on any of these topics (GET /v1/measure-topics). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["taxes","bonds","budgets","education","housing","elections","government","term_limits","ethics","local_boundaries","public_safety","criminal_justice","health","mental_health","environment","energy","water","transportation","parks_recreation","libraries","land_use","economic_development","cannabis","alcohol","gambling","abortion","civil_rights","labor","pensions","firearms","utilities","immigration","veterans","animals","seniors","children"],"x-enumDescriptions":{"taxes":"Taxes: new or changed taxes, levies, millage, fees, assessments and exemptions.","bonds":"Bonds and borrowing: general obligation bonds, debt, lease-purchase.","budgets":"Budgets and spending limits: appropriations, revenue and spending caps.","education":"Education and schools: school funding, facilities, districts and colleges.","housing":"Housing: affordable housing, rent, homelessness.","elections":"Elections and voting: how elections are run, voting rules, redistricting.","government":"Government structure and charters: charter amendments, who appoints whom, how offices work.","term_limits":"Term limits for elected officials.","ethics":"Ethics and transparency: conflicts of interest, open records, campaign finance.","local_boundaries":"Annexation, incorporation and dissolution: changing a city’s or district’s boundaries, merging or dissolving one.","public_safety":"Police, fire and emergency services.","criminal_justice":"Criminal justice: sentencing, courts, jails, victims’ rights.","health":"Health care and hospitals.","mental_health":"Mental health and addiction services.","environment":"Environment and conservation: open space, pollution, climate.","energy":"Energy: power generation, fuels, renewables.","water":"Water and sewer: water supply, treatment and rights.","transportation":"Transportation and roads: transit, highways, streets.","parks_recreation":"Parks and recreation.","libraries":"Libraries.","land_use":"Land use and zoning: development, planning, growth limits.","economic_development":"Economic development: business incentives, tourism, development districts.","cannabis":"Marijuana: legalization, sales, local bans.","alcohol":"Alcohol: liquor sales, local option (wet/dry) questions.","gambling":"Gambling: casinos, sports betting, lotteries.","abortion":"Abortion and reproductive rights.","civil_rights":"Civil rights: equal rights, discrimination, privacy.","labor":"Labor and wages: minimum wage, paid leave, unions.","pensions":"Pensions and public employees: retirement benefits, pay and rules for government workers.","firearms":"Firearms.","utilities":"Utilities and broadband: public utilities, franchises, internet service.","immigration":"Immigration and citizenship.","veterans":"Veterans’ benefits and services.","animals":"Animals: animal welfare, hunting, fishing.","seniors":"Seniors: services and tax relief for older residents.","children":"Children and families: child care, youth services."},"x-values":"measure-topic"}},"style":"form","explode":false,"example":"housing"},{"name":"q","in":"query","description":"Search words, up to 200 characters: every word must start a word of the contest’s title or short title, measure code, district, state, election name, election year, office type or a candidate’s name on the ballot (case-insensitive; a number must match a whole word, so 1 finds Proposition 1 but not Proposition 12). Up to 8 words count. Needs no election, so it searches every election the account can read.","schema":{"type":"string","maxLength":200},"example":"san francisco mayor"},{"name":"candidate","in":"query","description":"Only contests with a candidate whose name has every one of these words (each starting a word of the name, case-insensitive, up to 100 characters).","schema":{"type":"string","maxLength":100},"example":"lurie"},{"name":"from","in":"query","description":"Only contests in elections on or after this date.","schema":{"type":"string","format":"date"},"example":"2024-01-01"},{"name":"to","in":"query","description":"Only contests in elections on or before this date.","schema":{"type":"string","format":"date"},"example":"2026-12-31"},{"name":"sort","in":"query","description":"The order: id (by contest id, the default) or newest (newest election first). A cursor works only with the sort it came from.","schema":{"type":"string","enum":["id","newest"],"x-enumDescriptions":{"id":"By contest id (the default).","newest":"Newest election first, then by contest id. Good with q= when searching every election."},"x-values":"contest-sort","default":"id"},"example":"newest"},{"name":"upcoming","in":"query","description":"true for only elections from yesterday on; false (the default) for every election.","schema":{"type":"boolean","default":false},"example":true},{"name":"has_result","in":"query","description":"true for only contests with a result; false for only contests without one yet. Leave it out for both.","schema":{"type":"boolean"},"example":true},{"name":"on_ballot","in":"query","description":"true for only contests printed on the ballot; false for only races left off it (unopposed or cancelled, see off_ballot_reason). Leave it out for both.","schema":{"type":"boolean"},"example":true},{"name":"result_statuses","in":"query","description":"Only contests whose result has one of these statuses: unofficial (counts still changing) or certified. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["unofficial","certified"],"x-enumDescriptions":{"unofficial":"Election-night and canvass counts: still changing. We read them again every day until they’re certified.","certified":"The canvass is certified: the final official count."},"x-values":"result-status"}},"style":"form","explode":false,"example":"certified"},{"name":"lang","in":"query","description":"es for Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English otherwise. Names are never translated.","schema":{"type":"string","enum":["en","es"],"x-enumDescriptions":{"en":"English (the default).","es":"Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English where it doesn’t. Names are never translated."},"x-values":"lang","default":"en"},"example":"es"},{"name":"limit","in":"query","description":"Results per page, 1–200.","schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"example":20},{"name":"cursor","in":"query","description":"Where the next page starts: the next_cursor from the previous page. Leave it out for the first page; it is opaque, so pass it back exactly as you got it.","schema":{"type":"string"},"example":"aTo0NDEw"},{"name":"format","in":"query","description":"json (the default) or csv: the same page as CSV, with the next page’s cursor in the X-Next-Cursor header. The data dictionaries list the columns.","schema":{"type":"string","enum":["json","csv"],"x-enumDescriptions":{"json":"The JSON response, { \"data\": [...], \"next_cursor\": \"…\" } (the default).","csv":"The same page as CSV (text/csv), one row per record or per choice, contest, election or endorser compared, as each endpoint says. The columns are listed in the data dictionaries; the next page’s cursor comes in the X-Next-Cursor header and a Link header."},"x-values":"list-format","default":"json"},"example":"csv"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"id,title,district.name,choices(label,party)"}],"responses":{"200":{"description":"A page of contests, by id. With format=csv, the same as CSV (text/csv). One row per choice on the ballot, each repeating its contest, election, district and result; a page still holds limit contests.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-Next-Cursor":{"description":"format=csv: the next page’s cursor (absent on the last page).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","description":"This page.","items":{"$ref":"#/components/schemas/Contest"}},"next_cursor":{"type":["string","null"],"description":"Pass as cursor= for the next page; null on the last page."}}},"example":{"data":[{"id":4410,"slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8","title":"Member, Board of Supervisors, District 8","short_title":"Supervisor, D8","kind":"candidate","vote_method":"ranked_choice","votes_allowed":1,"ranks_allowed":10,"measure_code":null,"description":null,"ballot_text":null,"full_text_url":null,"unopposed":false,"on_ballot":true,"off_ballot_reason":null,"ballot_order":41,"party":null,"details":{"nonpartisan":true},"source_url":"https://www.sf.gov/departments/department-elections","office":{"type":"county_legislature","level":"local","branch":"legislative"},"seat":{"slug":"ca-san-francisco-board-of-supervisors-8","name":"San Francisco Board of Supervisors, District 8","race_type":"regular","stage":"general","seats_up":1},"race_type":"regular","partisan":false,"topics":[],"district":{"id":77,"ocd_id":"ocd-division/country:us/state:ca/county:san_francisco/council_district:8","name":"San Francisco Supervisorial District 8","level":"county","type":"council","state":"CA","partisanship":{"president_2016":null,"president_2020":null,"president_2024":null},"demographics":null},"election":{"id":3,"slug":"ca-2026-11-03-general","name":"California General Election","short_name":"General Election","date":"2026-11-03","state":"CA","type":"general","primary_system":"top_two","info_url":"https://www.sos.ca.gov/elections/upcoming-elections","details":{"all_mail":true}},"result":{"status":"unofficial","source_kind":"official","party_reported":false,"total_votes":52418,"precincts_reporting":41,"precincts_total":41,"source":{"name":"San Francisco Department of Elections","url":"https://www.sf.gov/departments/department-elections/results","contest_name":"Member, Board of Supervisors, District 8","updated_at":"2026-11-12T17:00:00-08:00"},"official_url":null,"more_sources":[],"write_in_votes":212,"blank_votes":null,"over_votes":null,"under_votes":null,"other_choices":[{"label":"Write-in","votes":212,"write_in":true}],"rcv_rounds":[{"round":1,"tallies":{"Jane Doe":24133,"Sam Rivera":21907,"Lee Park":6166},"eliminated":["Lee Park"]},{"round":2,"tallies":{"Jane Doe":27310,"Sam Rivera":23998}}],"notes":"Ranked choice: Jane Doe leads after round 2.","turnout":null,"seat_change":null,"fetched_at":"2026-11-13T06:30:12Z"},"choices":[{"id":20931,"slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8/jane-doe","label":"Jane Doe","measure_answer":null,"option":null,"ballot_designation":"Transit Planner","withdrawn":false,"status":"on_ballot","incumbent":true,"vote_meaning":null,"endorsement_count":14,"candidate":{"id":8811,"full_name":"Jane Doe","name":{"given":"Jane","middle":null,"family":"Doe","suffix":null,"nickname":null},"website_url":"https://example.com/janedoe","photo_url":null,"ids":{"fec":null,"bioguide":null},"contact":{"website":null,"email":"info@example.com","phone":null,"mailing_address":null,"social":{"facebook":"https://www.facebook.com/janedoeforsupervisor","instagram":"https://www.instagram.com/janedoesf"},"sources":[{"url":"https://example.com/janedoe","kind":"campaign_website","read_on":"2026-11-13"}]}},"party":null,"party_label":null,"party_lines":[],"result":{"votes":24133,"vote_pct":46.039,"winner":null}},{"id":20932,"slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8/sam-rivera","label":"Sam Rivera","measure_answer":null,"option":null,"ballot_designation":"Small Business Owner","withdrawn":false,"status":"on_ballot","incumbent":false,"vote_meaning":null,"endorsement_count":9,"candidate":{"id":8812,"full_name":"Sam Rivera","name":{"given":"Sam","middle":null,"family":"Rivera","suffix":null,"nickname":null},"website_url":null,"photo_url":null,"ids":{"fec":null,"bioguide":null},"contact":{"website":null,"email":null,"phone":null,"mailing_address":null,"social":{},"sources":[]}},"party":null,"party_label":null,"party_lines":[],"result":{"votes":21907,"vote_pct":41.793,"winner":null}}],"other_candidates":[{"id":311,"name":"Alex Kim","candidate_id":null,"party":null,"party_label":null,"status":"qualified","write_in":true,"status_date":"2026-10-20","votes":188,"winner":false,"note":null,"source":{"name":"San Francisco Department of Elections","url":"https://www.sf.gov/departments/department-elections/qualified-write-in-candidates","read_on":"2026-10-21"}}]},{"id":4502,"slug":"ca-2026-11-03-general/proposition-k-affordable-housing-bond","title":"Proposition K: Affordable Housing Bond","short_title":"Prop K","kind":"measure","vote_method":"yes_no","votes_allowed":1,"ranks_allowed":null,"measure_code":"K","description":"Affordable housing bond.","ballot_text":"Shall the City and County of San Francisco issue $300,000,000 in general obligation bonds to build and repair affordable housing?","full_text_url":"https://www.sf.gov/departments/department-elections/prop-k-full-text","unopposed":false,"on_ballot":true,"off_ballot_reason":null,"ballot_order":88,"party":null,"details":{"measure_type":"bond","vote_required":"2/3","amount":300000000},"source_url":"https://www.sf.gov/departments/department-elections","office":null,"seat":null,"race_type":null,"partisan":null,"topics":["bonds","housing"],"district":{"id":70,"ocd_id":"ocd-division/country:us/state:ca/county:san_francisco","name":"San Francisco","level":"county","type":"county","state":"CA","partisanship":{"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"}},"demographics":{"acs_year":2024,"population":830235,"citizen_voting_age_population":616394,"median_household_income":140970,"median_age":40,"pct_bachelors_or_higher":60.34,"pct_white_alone_not_hispanic":36.81,"pct_black_alone":4.98,"pct_asian_alone":35.19,"pct_hispanic":16.22,"pct_foreign_born":34.05,"pct_owner_occupied":38.21,"pct_below_poverty":11.15,"source":{"name":"U.S. Census Bureau, American Community Survey 2020-2024 5-year estimates","url":"https://www2.census.gov/programs-surveys/acs/summary_file/2024/table-based-SF/data/5YRData/"},"retrieved_on":"2026-11-14"}},"election":{"id":3,"slug":"ca-2026-11-03-general","name":"California General Election","short_name":"General Election","date":"2026-11-03","state":"CA","type":"general","primary_system":"top_two","info_url":"https://www.sos.ca.gov/elections/upcoming-elections","details":{"all_mail":true}},"result":{"status":"certified","source_kind":"official","party_reported":false,"total_votes":389104,"precincts_reporting":517,"precincts_total":517,"source":{"name":"San Francisco Department of Elections","url":"https://www.sf.gov/departments/department-elections/results","contest_name":"Proposition K","updated_at":"2026-12-01T12:00:00-08:00"},"official_url":null,"more_sources":[],"write_in_votes":null,"blank_votes":null,"over_votes":null,"under_votes":null,"other_choices":[],"rcv_rounds":null,"notes":null,"turnout":{"registered_voters":596864,"ballots_cast":411691,"turnout_pct":68.98,"status":"certified","source":{"name":"U.S. Election Assistance Commission, Election Administration and Voting Survey 2024","url":"https://www.eac.gov/sites/default/files/2026-02/2024_EAVS_for_Public_Release_nolabel_V2_csv.zip"},"retrieved_on":"2026-11-14"},"seat_change":null,"fetched_at":"2026-11-13T06:30:12Z"},"choices":[{"id":21050,"slug":"ca-2026-11-03-general/proposition-k-affordable-housing-bond/yes","label":"Yes","measure_answer":"yes","option":null,"ballot_designation":null,"withdrawn":false,"status":null,"incumbent":null,"vote_meaning":"A Yes vote means the City may issue the bonds.","endorsement_count":31,"candidate":null,"party":null,"party_label":null,"party_lines":[],"result":{"votes":264590,"vote_pct":68,"winner":true}},{"id":21051,"slug":"ca-2026-11-03-general/proposition-k-affordable-housing-bond/no","label":"No","measure_answer":"no","option":null,"ballot_designation":null,"withdrawn":false,"status":null,"incumbent":null,"vote_meaning":"A No vote means the City may not issue the bonds.","endorsement_count":4,"candidate":null,"party":null,"party_label":null,"party_lines":[],"result":{"votes":124514,"vote_pct":32,"winner":false}}],"other_candidates":[]}],"next_cursor":"aTo0NTAy"}},"text/csv":{"schema":{"type":"string"},"example":"contest_id,contest_title,contest_kind,vote_method,votes_allowed,ranks_allowed,measure_code,unopposed,on_ballot,off_ballot_reason,race_type,partisan,office_type,office_level,office_branch,topics,primary_party,election_id,election_slug,election_date,election_type,district_id,district_ocd_id,district_name,district_level,district_type,state,result_status,result_source_kind,result_total_votes,result_source_url,result_source_name,turnout_registered_voters,turnout_ballots_cast,turnout_pct,district_pres_2016_dem_two_party_pct,district_pres_2016_total_votes,district_pres_2020_dem_two_party_pct,district_pres_2020_total_votes,district_pres_2024_dem_two_party_pct,district_pres_2024_total_votes,district_acs_year,district_population,district_citizen_voting_age_population,district_median_household_income,district_median_age,district_pct_bachelors_or_higher,district_pct_white_alone_not_hispanic,district_pct_black_alone,district_pct_asian_alone,district_pct_hispanic,district_pct_foreign_born,district_pct_owner_occupied,district_pct_below_poverty,seat,seat_outcome,seat_flipped,choice_id,choice_label,measure_answer,ballot_designation,withdrawn,incumbent,candidate_id,candidate_name,party,party_label,choice_endorsement_count,choice_votes,choice_vote_pct,choice_winner\r\n4410,\"Member, Board of Supervisors, District 8\",candidate,ranked_choice,1,10,,false,true,,regular,false,county_legislature,local,legislative,,,3,ca-2026-11-03-general,2026-11-03,general,77,ocd-division/country:us/state:ca/county:san_francisco/council_district:8,San Francisco Supervisorial District 8,county,council,CA,unofficial,official,52418,https://www.sf.gov/departments/department-elections/results,San Francisco Department of Elections,,,,,,,,,,,,,,,,,,,,,,,ca-san-francisco-board-of-supervisors-8,,,20931,Jane Doe,,Transit Planner,false,true,8811,Jane Doe,,,14,24133,46.039,\r\n4410,\"Member, Board of Supervisors, District 8\",candidate,ranked_choice,1,10,,false,true,,regular,false,county_legislature,local,legislative,,,3,ca-2026-11-03-general,2026-11-03,general,77,ocd-division/country:us/state:ca/county:san_francisco/council_district:8,San Francisco Supervisorial District 8,county,council,CA,unofficial,official,52418,https://www.sf.gov/departments/department-elections/results,San Francisco Department of Elections,,,,,,,,,,,,,,,,,,,,,,,ca-san-francisco-board-of-supervisors-8,,,20932,Sam Rivera,,Small Business Owner,false,false,8812,Sam Rivera,,,9,21907,41.793,\r\n4502,Proposition K: Affordable Housing Bond,measure,yes_no,1,,K,false,true,,,,,,,bonds; housing,,3,ca-2026-11-03-general,2026-11-03,general,70,ocd-division/country:us/state:ca/county:san_francisco,San Francisco,county,county,CA,certified,official,389104,https://www.sf.gov/departments/department-elections/results,San Francisco Department of Elections,596864,411691,68.98,,,87.018,443553,83.797,402964,2024,830235,616394,140970,40,60.34,36.81,4.98,35.19,16.22,34.05,38.21,11.15,,,,21050,Yes,yes,,false,,,,,,31,264590,68,true\r\n4502,Proposition K: Affordable Housing Bond,measure,yes_no,1,,K,false,true,,,,,,,bonds; housing,,3,ca-2026-11-03-general,2026-11-03,general,70,ocd-division/country:us/state:ca/county:san_francisco,San Francisco,county,county,CA,certified,official,389104,https://www.sf.gov/departments/department-elections/results,San Francisco Department of Elections,596864,411691,68.98,,,87.018,443553,83.797,402964,2024,830235,616394,140970,40,60.34,36.81,4.98,35.19,16.22,34.05,38.21,11.15,,,,21051,No,no,,false,,,,,,4,124514,32,false\r\n"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/contests?elections=ca-2026-11-03-general&levels=county&limit=20\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst { data: contests } = await client.contests.list({ elections: 'ca-2026-11-03-general', levels: 'county', limit: 20 });"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\ncontests = client.contests.list(elections=\"ca-2026-11-03-general\", levels=\"county\", limit=20).data"}]}},"/v1/contests/{id}":{"get":{"operationId":"getContest","tags":["Contests"],"summary":"Get a contest with endorsements","description":"One contest with its choices, its result once a source has one (votes and winners per choice, the source’s URL, ranked-choice rounds and write-ins), and every endorser’s position: one pick for vote-for-one, up to N picks for vote-for-N, ranked picks for ranked choice, Yes or No for a measure. Narrow the endorsers with categories, endorsers or endorser_states.","parameters":[{"name":"id","in":"path","required":true,"description":"Contest id (from GET /v1/contests).","schema":{"type":"integer","minimum":1},"example":4410},{"name":"categories","in":"query","description":"Only endorsers in these categories. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"labor,editorial"},{"name":"endorsers","in":"query","description":"Only these endorsers (slugs). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"sf-labor-council"},{"name":"endorser_states","in":"query","description":"Only endorsers based in these states (USPS codes), or national for endorsers with none. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"CA,national"},{"name":"lang","in":"query","description":"es for Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English otherwise. Names are never translated.","schema":{"type":"string","enum":["en","es"],"x-enumDescriptions":{"en":"English (the default).","es":"Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English where it doesn’t. Names are never translated."},"x-values":"lang","default":"en"},"example":"es"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"id,title,choices.label,endorsements(endorser.name,picks.label)"}],"responses":{"200":{"description":"The contest.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ContestDetail"}}},"example":{"data":{"id":4410,"slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8","title":"Member, Board of Supervisors, District 8","short_title":"Supervisor, D8","kind":"candidate","vote_method":"ranked_choice","votes_allowed":1,"ranks_allowed":10,"measure_code":null,"description":null,"ballot_text":null,"full_text_url":null,"unopposed":false,"on_ballot":true,"off_ballot_reason":null,"ballot_order":41,"party":null,"details":{"nonpartisan":true},"source_url":"https://www.sf.gov/departments/department-elections","office":{"type":"county_legislature","level":"local","branch":"legislative"},"seat":{"slug":"ca-san-francisco-board-of-supervisors-8","name":"San Francisco Board of Supervisors, District 8","race_type":"regular","stage":"general","seats_up":1},"race_type":"regular","partisan":false,"topics":[],"district":{"id":77,"ocd_id":"ocd-division/country:us/state:ca/county:san_francisco/council_district:8","name":"San Francisco Supervisorial District 8","level":"county","type":"council","state":"CA","partisanship":{"president_2016":null,"president_2020":null,"president_2024":null},"demographics":null},"election":{"id":3,"slug":"ca-2026-11-03-general","name":"California General Election","short_name":"General Election","date":"2026-11-03","state":"CA","type":"general","primary_system":"top_two","info_url":"https://www.sos.ca.gov/elections/upcoming-elections","details":{"all_mail":true}},"result":{"status":"unofficial","source_kind":"official","party_reported":false,"total_votes":52418,"precincts_reporting":41,"precincts_total":41,"source":{"name":"San Francisco Department of Elections","url":"https://www.sf.gov/departments/department-elections/results","contest_name":"Member, Board of Supervisors, District 8","updated_at":"2026-11-12T17:00:00-08:00"},"official_url":null,"more_sources":[],"write_in_votes":212,"blank_votes":null,"over_votes":null,"under_votes":null,"other_choices":[{"label":"Write-in","votes":212,"write_in":true}],"rcv_rounds":[{"round":1,"tallies":{"Jane Doe":24133,"Sam Rivera":21907,"Lee Park":6166},"eliminated":["Lee Park"]},{"round":2,"tallies":{"Jane Doe":27310,"Sam Rivera":23998}}],"notes":"Ranked choice: Jane Doe leads after round 2.","turnout":null,"seat_change":null,"fetched_at":"2026-11-13T06:30:12Z"},"choices":[{"id":20931,"slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8/jane-doe","label":"Jane Doe","measure_answer":null,"option":null,"ballot_designation":"Transit Planner","withdrawn":false,"status":"on_ballot","incumbent":true,"vote_meaning":null,"endorsement_count":14,"candidate":{"id":8811,"full_name":"Jane Doe","name":{"given":"Jane","middle":null,"family":"Doe","suffix":null,"nickname":null},"website_url":"https://example.com/janedoe","photo_url":null,"ids":{"fec":null,"bioguide":null},"contact":{"website":null,"email":"info@example.com","phone":null,"mailing_address":null,"social":{"facebook":"https://www.facebook.com/janedoeforsupervisor","instagram":"https://www.instagram.com/janedoesf"},"sources":[{"url":"https://example.com/janedoe","kind":"campaign_website","read_on":"2026-11-13"}]}},"party":null,"party_label":null,"party_lines":[],"result":{"votes":24133,"vote_pct":46.039,"winner":null}},{"id":20932,"slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8/sam-rivera","label":"Sam Rivera","measure_answer":null,"option":null,"ballot_designation":"Small Business Owner","withdrawn":false,"status":"on_ballot","incumbent":false,"vote_meaning":null,"endorsement_count":9,"candidate":{"id":8812,"full_name":"Sam Rivera","name":{"given":"Sam","middle":null,"family":"Rivera","suffix":null,"nickname":null},"website_url":null,"photo_url":null,"ids":{"fec":null,"bioguide":null},"contact":{"website":null,"email":null,"phone":null,"mailing_address":null,"social":{},"sources":[]}},"party":null,"party_label":null,"party_lines":[],"result":{"votes":21907,"vote_pct":41.793,"winner":null}}],"other_candidates":[{"id":311,"name":"Alex Kim","candidate_id":null,"party":null,"party_label":null,"status":"qualified","write_in":true,"status_date":"2026-10-20","votes":188,"winner":false,"note":null,"source":{"name":"San Francisco Department of Elections","url":"https://www.sf.gov/departments/department-elections/qualified-write-in-candidates","read_on":"2026-10-21"}}],"rescinded_endorsements":[],"endorsements":[{"endorser":{"id":512,"slug":"sf-labor-council","name":"San Francisco Labor Council","category":{"slug":"labor","name":"Labor"},"state":"CA"},"picks":[{"endorsement_id":90211,"choice_id":20931,"choice_slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8/jane-doe","label":"Jane Doe","measure_answer":null,"rank":1,"statement":null,"source_url":"https://sflaborcouncil.org/endorsements","published_on":"2026-09-18","first_seen_on":"2026-09-18","date_source":"page","added_by":"data_load","stage":"general"},{"endorsement_id":90212,"choice_id":20932,"choice_slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8/sam-rivera","label":"Sam Rivera","measure_answer":null,"rank":2,"statement":null,"source_url":"https://sflaborcouncil.org/endorsements","published_on":"2026-09-18","first_seen_on":"2026-09-18","date_source":"page","added_by":"data_load","stage":"general"}]},{"endorser":{"id":88,"slug":"sf-chronicle","name":"San Francisco Chronicle","category":{"slug":"editorial","name":"Voter guides & editorial boards"},"state":"CA"},"picks":[{"endorsement_id":90377,"choice_id":20932,"choice_slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8/sam-rivera","label":"Sam Rivera","measure_answer":null,"rank":null,"statement":"Rivera has the clearer plan for the district’s corridors.","source_url":"https://www.sfchronicle.com/opinion/endorsements","published_on":"2026-10-02","first_seen_on":"2026-10-02","date_source":"page","added_by":"automatic","stage":"general"}]}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/contests/4410?categories=labor,editorial\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst contest = await client.contests.get(4410, { categories: 'labor,editorial' });"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\ncontest = client.contests.get(4410, categories=\"labor,editorial\")"}]}},"/v1/ballot":{"post":{"operationId":"lookupBallot","tags":["Ballot"],"summary":"Look up the ballot at an address","description":"The ballot at a street address (or a point): the districts it is in on today’s lines, and every contest on its ballot, grouped by election, in ballot order, with each choice and how many endorsers back it. By default every election from 60 days ago on, so the latest election’s results are included; ask for others with elections. Use GET /v1/contests/{id} for each endorser’s position in a contest.\n\nThe address is found with the U.S. Census Bureau’s geocoder and matched to our districts the same way endorsedby.org does. It is sent in the body so it stays out of URLs and logs, and it is used for this request only: we never store it. Each lookup counts as one request, and an account may make up to 60 lookups a minute. Districts are matched on today’s maps, so a past election in a redistricted area can show the wrong district’s contests.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BallotLookupInput"},"example":{"address":"1 Dr Carlton B Goodlett Pl, San Francisco, CA 94102"}}}},"responses":{"200":{"description":"The ballot.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/BallotLookup"}}},"example":{"data":{"state":"CA","matched_address":"1 DR CARLTON P GOODLETT PL, SAN FRANCISCO, CA, 94102","districts":[{"id":2,"ocd_id":"ocd-division/country:us/state:ca/cd:11","name":"California Congressional District 11","level":"federal","type":"congressional","state":"CA"},{"id":1,"ocd_id":"ocd-division/country:us/state:ca","name":"California","level":"state","type":"statewide","state":"CA"}],"elections":[{"election":{"id":1,"slug":"ca-2026-11-03-general","name":"California General Election","short_name":"CA General","date":"2026-11-03","state":"CA","type":"general","primary_system":"none","info_url":"https://www.sf.gov/november-3-2026-consolidated-general-election","details":{"consolidated_with":["San Francisco Consolidated General Election"]}},"contests":[{"id":14,"slug":"ca-2026-11-03-general/united-states-representative-district-11","title":"United States Representative, District 11","short_title":"U.S. Representative","kind":"candidate","vote_method":"plurality","votes_allowed":1,"ranks_allowed":null,"measure_code":null,"office":{"type":"us_representative","level":"federal","branch":"legislative"},"race_type":"regular","partisan":true,"party":null,"unopposed":false,"on_ballot":true,"off_ballot_reason":null,"district_id":2,"endorsement_count":177,"result_status":"unofficial","choices":[{"id":66,"slug":"ca-2026-11-03-general/united-states-representative-district-11/connie-chan","label":"Connie Chan","measure_answer":null,"party":"Democratic","ballot_designation":"San Francisco Supervisor","incumbent":false,"withdrawn":false,"candidate_id":1,"endorsement_count":99,"winner":null},{"id":67,"slug":"ca-2026-11-03-general/united-states-representative-district-11/scott-wiener","label":"Scott Wiener","measure_answer":null,"party":"Democratic","ballot_designation":"State Senator","incumbent":false,"withdrawn":false,"candidate_id":2,"endorsement_count":78,"winner":null}]},{"id":1,"slug":"ca-2026-11-03-general/proposition-5-changes-recall-election-process-for-statewide-officers","title":"Proposition 5: Changes Recall Election Process for Statewide Officers","short_title":"Prop 5","kind":"measure","vote_method":"yes_no","votes_allowed":1,"ranks_allowed":null,"measure_code":"5","office":null,"race_type":null,"partisan":null,"party":null,"unopposed":false,"on_ballot":true,"off_ballot_reason":null,"district_id":1,"endorsement_count":72,"result_status":"unofficial","choices":[{"id":104,"slug":"ca-2026-11-03-general/proposition-5-changes-recall-election-process-for-statewide-officers/yes","label":"Yes","measure_answer":"yes","party":null,"ballot_designation":null,"incumbent":null,"withdrawn":false,"candidate_id":null,"endorsement_count":56,"winner":null},{"id":105,"slug":"ca-2026-11-03-general/proposition-5-changes-recall-election-process-for-statewide-officers/no","label":"No","measure_answer":"no","party":null,"ballot_designation":null,"incumbent":null,"withdrawn":false,"candidate_id":null,"endorsement_count":16,"winner":null}]}],"contests_outside_purchase":0}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"The Census Bureau’s geocoder isn’t answering (geocoder_unavailable). Try again in a minute."}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl -X POST \"https://api.ballotdata.ai/v1/ballot\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"address\":\"1 Dr Carlton B Goodlett Pl, San Francisco, CA 94102\"}'"},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst ballot = await client.ballot.lookup({ address: '1 Dr Carlton B Goodlett Pl, San Francisco, CA 94102' });"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nballot = client.ballot.lookup(address=\"1 Dr Carlton B Goodlett Pl, San Francisco, CA 94102\")"}],"parameters":[{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"districts.name,elections(election.slug,contests(title,choices.label))"}]}},"/v1/endorser-categories":{"get":{"operationId":"listEndorserCategories","tags":["Endorsers"],"summary":"List endorser categories","description":"The kinds of endorser (labor, editorial, environment, business, party, club, community, officials), with how many endorsers each has. Use the slugs in categories= filters.","parameters":[{"name":"lang","in":"query","description":"es for Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English otherwise. Names are never translated.","schema":{"type":"string","enum":["en","es"],"x-enumDescriptions":{"en":"English (the default).","es":"Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English where it doesn’t. Names are never translated."},"x-values":"lang","default":"en"},"example":"es"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"slug,name"}],"responses":{"200":{"description":"Every category, in display order.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","description":"Every item.","items":{"$ref":"#/components/schemas/EndorserCategory"}}}},"example":{"data":[{"slug":"editorial","name":"Voter guides & editorial boards","singular_name":"Voter guide","endorser_count":214},{"slug":"labor","name":"Labor","singular_name":"Labor union","endorser_count":391},{"slug":"environment","name":"Environment & transportation","singular_name":"Environmental group","endorser_count":167}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/endorser-categories\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst categories = await client.endorserCategories.list();"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\ncategories = client.endorser_categories.list()"}]}},"/v1/endorsers":{"get":{"operationId":"listEndorsers","tags":["Endorsers"],"summary":"List endorsers","description":"Endorsers by category, home state, or the elections they’ve endorsed in, or search by name. Every endorser we’ve found is here, however few endorsements it has made; min_endorsements leaves out the smallest.","parameters":[{"name":"categories","in":"query","description":"Category slugs. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"labor"},{"name":"states","in":"query","description":"Home states (USPS codes), or national. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"CA"},{"name":"elections","in":"query","description":"Only endorsers with endorsements in these elections (slugs). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"ca-2026-11-03-general"},{"name":"q","in":"query","description":"Name contains (case-insensitive, up to 100 characters).","schema":{"type":"string","maxLength":100},"example":"labor council"},{"name":"min_endorsements","in":"query","description":"Only endorsers with at least this many contests (endorsement_count). endorsedby.org lists endorsers with 5 or more by default and finds the rest by search; pass 5 to match.","schema":{"type":"integer","minimum":0,"maximum":100000},"example":5},{"name":"lang","in":"query","description":"es for Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English otherwise. Names are never translated.","schema":{"type":"string","enum":["en","es"],"x-enumDescriptions":{"en":"English (the default).","es":"Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English where it doesn’t. Names are never translated."},"x-values":"lang","default":"en"},"example":"es"},{"name":"limit","in":"query","description":"Results per page, 1–500.","schema":{"type":"integer","minimum":1,"maximum":500,"default":100},"example":20},{"name":"cursor","in":"query","description":"Where the next page starts: the next_cursor from the previous page. Leave it out for the first page; it is opaque, so pass it back exactly as you got it.","schema":{"type":"string"},"example":"aTo0NDEw"},{"name":"format","in":"query","description":"json (the default) or csv: the same page as CSV, with the next page’s cursor in the X-Next-Cursor header. The data dictionaries list the columns.","schema":{"type":"string","enum":["json","csv"],"x-enumDescriptions":{"json":"The JSON response, { \"data\": [...], \"next_cursor\": \"…\" } (the default).","csv":"The same page as CSV (text/csv), one row per record or per choice, contest, election or endorser compared, as each endpoint says. The columns are listed in the data dictionaries; the next page’s cursor comes in the X-Next-Cursor header and a Link header."},"x-values":"list-format","default":"json"},"example":"csv"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"slug,name,category.name,state"}],"responses":{"200":{"description":"A page of endorsers, by id. With format=csv, the same as CSV (text/csv). One row per endorser.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-Next-Cursor":{"description":"format=csv: the next page’s cursor (absent on the last page).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","description":"This page.","items":{"$ref":"#/components/schemas/Endorser"}},"next_cursor":{"type":["string","null"],"description":"Pass as cursor= for the next page; null on the last page."}}},"example":{"data":[{"id":512,"slug":"sf-labor-council","name":"San Francisco Labor Council","category":{"slug":"labor","name":"Labor"},"description":"The central labor council for San Francisco, representing over 150 unions.","website_url":"https://sflaborcouncil.org","logo_url":null,"state":"CA","party":null,"endorsement_count":84,"facts":{"fec_committee_ids":[],"ein":null,"irs_subsection":null,"union_members":null,"union_members_as_of":null,"olms_file_number":null,"founded_year":null,"parent_organization":null,"sources":[]}}],"next_cursor":"aTo1MTI"}},"text/csv":{"schema":{"type":"string"},"example":"endorser_id,slug,name,category,category_name,description,website_url,logo_url,state,party,endorsement_count,fec_committee_ids,ein,irs_subsection,union_members,union_members_as_of,olms_file_number,founded_year,parent_organization\r\n512,sf-labor-council,San Francisco Labor Council,labor,Labor,\"The central labor council for San Francisco, representing over 150 unions.\",https://sflaborcouncil.org,,CA,,84,,,,,,,,\r\n"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/endorsers?categories=labor&states=CA&q=labor+council\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst { data: endorsers } = await client.endorsers.list({ categories: 'labor', states: 'CA', q: 'labor council' });"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nendorsers = client.endorsers.list(categories=\"labor\", states=\"CA\", q=\"labor council\").data"}]}},"/v1/endorsers/{slug}":{"get":{"operationId":"getEndorser","tags":["Endorsers"],"summary":"Get an endorser","description":"One endorser, with how many contests they’ve taken a position in, and the elections they’ve endorsed in with how many contests in each.","parameters":[{"name":"slug","in":"path","required":true,"description":"Endorser slug (from GET /v1/endorsers).","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,199}$"},"example":"sf-labor-council"},{"name":"lang","in":"query","description":"es for Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English otherwise. Names are never translated.","schema":{"type":"string","enum":["en","es"],"x-enumDescriptions":{"en":"English (the default).","es":"Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English where it doesn’t. Names are never translated."},"x-values":"lang","default":"en"},"example":"es"},{"name":"outside_spending_cycles","in":"query","description":"FEC cycles (by their last year, such as 2024 or 2026) that outside_spending shows; leave it out for every cycle we hold. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"integer","minimum":2000}},"style":"form","explode":false,"example":"2024"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"slug,name,category.name,website_url,endorsement_count"}],"responses":{"200":{"description":"The endorser.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/EndorserDetail"}}},"example":{"data":{"id":512,"slug":"sf-labor-council","name":"San Francisco Labor Council","category":{"slug":"labor","name":"Labor"},"description":"The central labor council for San Francisco, representing over 150 unions.","website_url":"https://sflaborcouncil.org","logo_url":null,"state":"CA","party":null,"endorsement_count":84,"facts":{"fec_committee_ids":[],"ein":null,"irs_subsection":null,"union_members":null,"union_members_as_of":null,"olms_file_number":null,"founded_year":null,"parent_organization":null,"sources":[]},"outside_spending":[],"fec_committees":[],"contributions_to_candidates":[],"elections":[{"election":"ca-2026-11-03-general","name":"California General Election","date":"2026-11-03","contests":61},{"election":"ca-2026-06-02-primary","name":"California Primary Election","date":"2026-06-02","contests":23}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/endorsers/sf-labor-council\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst endorser = await client.endorsers.get('sf-labor-council');"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nendorser = client.endorsers.get(\"sf-labor-council\")"}]}},"/v1/endorsers/{slug}/record":{"get":{"operationId":"getEndorserRecord","tags":["Endorsers"],"summary":"Get an endorser’s track record","description":"How the choices an endorser backed did: contests, picks, wins, losses, win rate and average vote share, in total, by contest kind, by election stage and by election. Only top picks count (a ranked-choice endorsement’s first choice, every candidate of a vote-for-N slate, the Yes or No on a measure), and a pick is won or lost by its choice’s result, so contests without a result yet are undecided. A win rate describes the endorser’s picks; it does not show the endorsement changed the outcome (endorsers often back incumbents and favorites), which is why picks of incumbents are counted separately.","parameters":[{"name":"slug","in":"path","required":true,"description":"Endorser slug (from GET /v1/endorsers).","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,199}$"},"example":"sf-labor-council"},{"name":"elections","in":"query","description":"Election slugs (GET /v1/elections). A date and type (2026-11-03-general) matches every election of that type that day nationwide, and a bare date (2026-11-03) every election that day. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"ca-2026-11-03-general"},{"name":"states","in":"query","description":"States the contests are voted in (USPS codes). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}},"style":"form","explode":false,"example":"CA"},{"name":"contest_kinds","in":"query","description":"Contest kinds: candidate (an office), measure, or retention (whether to keep a judge). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["candidate","measure","retention"],"x-enumDescriptions":{"candidate":"A race for an office: voters choose among candidates.","measure":"A ballot measure (proposition, amendment, bond, tax, referendum or initiative): voters answer Yes or No.","retention":"A judicial retention question: should this judge stay in office? Voters answer Yes or No."},"x-values":"contest-kind"}},"style":"form","explode":false,"example":"measure"},{"name":"stages","in":"query","description":"Election stages: primary, general or runoff. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["general","primary","runoff"],"x-enumDescriptions":{"general":"The endorsement is for a general, special or consolidated election.","primary":"The endorsement is for a primary or special primary.","runoff":"The endorsement is for a runoff."},"x-values":"stage"}},"style":"form","explode":false,"example":"primary"},{"name":"lang","in":"query","description":"es for Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English otherwise. Names are never translated.","schema":{"type":"string","enum":["en","es"],"x-enumDescriptions":{"en":"English (the default).","es":"Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English where it doesn’t. Names are never translated."},"x-values":"lang","default":"en"},"example":"es"},{"name":"format","in":"query","description":"json (the default) or csv: one row per election.","schema":{"type":"string","enum":["json","csv"],"x-enumDescriptions":{"json":"The JSON response, { \"data\": [...], \"next_cursor\": \"…\" } (the default).","csv":"The same page as CSV (text/csv), one row per record or per choice, contest, election or endorser compared, as each endpoint says. The columns are listed in the data dictionaries; the next page’s cursor comes in the X-Next-Cursor header and a Link header."},"x-values":"list-format","default":"json"},"example":"csv"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"endorser.name,totals"}],"responses":{"200":{"description":"The track record. With format=csv, the same as CSV (text/csv). One row per election the endorser took positions in, newest first. The JSON also has totals and breakdowns by contest kind and stage.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-Next-Cursor":{"description":"format=csv: the next page’s cursor (absent on the last page).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/EndorserRecord"}}},"example":{"data":{"endorser":{"id":512,"slug":"sf-labor-council","name":"San Francisco Labor Council","category":{"slug":"labor","name":"Labor"},"state":"CA"},"totals":{"contests":84,"picks":97,"won":61,"lost":22,"undecided":14,"win_rate":0.735,"avg_vote_pct":54.812,"incumbent_picks":31,"incumbent_won":29,"non_incumbent_picks":58,"non_incumbent_won":28},"by_kind":[{"kind":"candidate","contests":66,"picks":79,"won":47,"lost":20,"undecided":12,"win_rate":0.701,"avg_vote_pct":52.307,"incumbent_picks":31,"incumbent_won":29,"non_incumbent_picks":58,"non_incumbent_won":28},{"kind":"measure","contests":18,"picks":18,"won":14,"lost":2,"undecided":2,"win_rate":0.875,"avg_vote_pct":63.918,"incumbent_picks":0,"incumbent_won":0,"non_incumbent_picks":0,"non_incumbent_won":0}],"by_stage":[{"stage":"primary","contests":30,"picks":34,"won":21,"lost":12,"undecided":1,"win_rate":0.636,"avg_vote_pct":47.551,"incumbent_picks":11,"incumbent_won":11,"non_incumbent_picks":20,"non_incumbent_won":9},{"stage":"general","contests":54,"picks":63,"won":40,"lost":10,"undecided":13,"win_rate":0.8,"avg_vote_pct":58.649,"incumbent_picks":20,"incumbent_won":18,"non_incumbent_picks":38,"non_incumbent_won":19}],"elections":[{"election":{"slug":"ca-2026-11-03-general","name":"California General Election","date":"2026-11-03","type":"general"},"contests":54,"picks":63,"won":40,"lost":10,"undecided":13,"win_rate":0.8,"avg_vote_pct":58.649,"incumbent_picks":20,"incumbent_won":18,"non_incumbent_picks":38,"non_incumbent_won":19},{"election":{"slug":"ca-2026-06-02-primary","name":"California Primary Election","date":"2026-06-02","type":"primary"},"contests":30,"picks":34,"won":21,"lost":12,"undecided":1,"win_rate":0.636,"avg_vote_pct":47.551,"incumbent_picks":11,"incumbent_won":11,"non_incumbent_picks":20,"non_incumbent_won":9}]}}},"text/csv":{"schema":{"type":"string"},"example":"endorser_slug,election_slug,election_name,election_date,election_type,contests,picks,won,lost,undecided,win_rate,avg_vote_pct,incumbent_picks,incumbent_won,non_incumbent_picks,non_incumbent_won\r\nsf-labor-council,ca-2026-11-03-general,California General Election,2026-11-03,general,54,63,40,10,13,0.8,58.649,20,18,38,19\r\nsf-labor-council,ca-2026-06-02-primary,California Primary Election,2026-06-02,primary,30,34,21,12,1,0.636,47.551,11,11,20,9\r\n"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/endorsers/sf-labor-council/record?stages=general\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst record = await client.endorsers.record('sf-labor-council', { stages: 'general' });"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nrecord = client.endorsers.record(\"sf-labor-council\", stages=\"general\")"}]}},"/v1/endorsers/{slug}/agreement":{"get":{"operationId":"getEndorserAgreement","tags":["Endorsers"],"summary":"Compare an endorser with others","description":"How often other endorsers took the same side as this one, over the contests both took a position in: the contests in common, how many they agreed on, partly agreed on and disagreed on, and the agreement rate. The other endorsers come most contests in common first; name them with `with`, or narrow them by category. Positions are compared by top picks: the first choice in a ranked-choice contest, the whole slate in a vote-for-N contest, the Yes or No on a measure.","parameters":[{"name":"slug","in":"path","required":true,"description":"Endorser slug (from GET /v1/endorsers).","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,199}$"},"example":"sf-labor-council"},{"name":"with","in":"query","description":"Compare with only these endorsers (slugs). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"sf-chronicle"},{"name":"categories","in":"query","description":"Compare with only endorsers in these categories. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","x-enumDescriptions":{"editorial":"Voter guides & editorial boards: each one a voter guide.","labor":"Labor: each one a labor union.","environment":"Environment & transportation: each one a environmental group.","business":"Housing & business: each one a housing or business group.","party":"Political parties: each one a political party.","club":"Political clubs: each one a political club.","community":"Community & advocacy: each one a community group.","officials":"Elected officials: each one a elected official."},"x-values":"endorser-category"}},"style":"form","explode":false,"example":"editorial"},{"name":"elections","in":"query","description":"Election slugs (GET /v1/elections). A date and type (2026-11-03-general) matches every election of that type that day nationwide, and a bare date (2026-11-03) every election that day. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"ca-2026-11-03-general"},{"name":"states","in":"query","description":"States the contests are voted in (USPS codes). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}},"style":"form","explode":false,"example":"CA"},{"name":"contest_kinds","in":"query","description":"Contest kinds: candidate (an office), measure, or retention (whether to keep a judge). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["candidate","measure","retention"],"x-enumDescriptions":{"candidate":"A race for an office: voters choose among candidates.","measure":"A ballot measure (proposition, amendment, bond, tax, referendum or initiative): voters answer Yes or No.","retention":"A judicial retention question: should this judge stay in office? Voters answer Yes or No."},"x-values":"contest-kind"}},"style":"form","explode":false,"example":"measure"},{"name":"stages","in":"query","description":"Election stages: primary, general or runoff. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["general","primary","runoff"],"x-enumDescriptions":{"general":"The endorsement is for a general, special or consolidated election.","primary":"The endorsement is for a primary or special primary.","runoff":"The endorsement is for a runoff."},"x-values":"stage"}},"style":"form","explode":false,"example":"general"},{"name":"min_shared","in":"query","description":"Leave out endorsers with fewer contests in common than this.","schema":{"type":"integer","minimum":1,"maximum":1000,"default":3},"example":5},{"name":"limit","in":"query","description":"How many endorsers to compare with, 1–100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"example":10},{"name":"lang","in":"query","description":"es for Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English otherwise. Names are never translated.","schema":{"type":"string","enum":["en","es"],"x-enumDescriptions":{"en":"English (the default).","es":"Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English where it doesn’t. Names are never translated."},"x-values":"lang","default":"en"},"example":"es"},{"name":"format","in":"query","description":"json (the default) or csv: one row per endorser compared.","schema":{"type":"string","enum":["json","csv"],"x-enumDescriptions":{"json":"The JSON response, { \"data\": [...], \"next_cursor\": \"…\" } (the default).","csv":"The same page as CSV (text/csv), one row per record or per choice, contest, election or endorser compared, as each endpoint says. The columns are listed in the data dictionaries; the next page’s cursor comes in the X-Next-Cursor header and a Link header."},"x-values":"list-format","default":"json"},"example":"csv"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"endorser.slug,compared(endorser.name,agreement_rate)"}],"responses":{"200":{"description":"The comparison. With format=csv, the same as CSV (text/csv). One row per endorser compared, most contests in common first.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-Next-Cursor":{"description":"format=csv: the next page’s cursor (absent on the last page).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/EndorserAgreement"}}},"example":{"data":{"endorser":{"id":512,"slug":"sf-labor-council","name":"San Francisco Labor Council","category":{"slug":"labor","name":"Labor"},"state":"CA"},"contests":84,"compared":[{"endorser":{"id":88,"slug":"sf-chronicle","name":"San Francisco Chronicle","category":{"slug":"editorial","name":"Voter guides & editorial boards"},"state":"CA"},"shared_contests":41,"agreed":22,"partly_agreed":3,"disagreed":16,"agreement_rate":0.537},{"endorser":{"id":97,"slug":"sf-democratic-party","name":"San Francisco Democratic Party","category":{"slug":"party","name":"Political parties"},"state":"CA"},"shared_contests":38,"agreed":33,"partly_agreed":2,"disagreed":3,"agreement_rate":0.868}]}}},"text/csv":{"schema":{"type":"string"},"example":"endorser_slug,endorser_contests,other_endorser_id,other_endorser_slug,other_endorser_name,other_endorser_category,other_endorser_state,shared_contests,agreed,partly_agreed,disagreed,agreement_rate\r\nsf-labor-council,84,88,sf-chronicle,San Francisco Chronicle,editorial,CA,41,22,3,16,0.537\r\nsf-labor-council,84,97,sf-democratic-party,San Francisco Democratic Party,party,CA,38,33,2,3,0.868\r\n"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/endorsers/sf-labor-council/agreement?categories=editorial\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst { compared } = await client.endorsers.agreement('sf-labor-council', { categories: 'editorial' });"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\ncompared = client.endorsers.agreement(\"sf-labor-council\", categories=\"editorial\")[\"compared\"]"}]}},"/v1/endorsements":{"get":{"operationId":"listEndorsements","tags":["Endorsements"],"summary":"List endorsements","description":"Endorsements, one per endorser and choice, with the basics of each: the endorser, contest, election and choice it’s for. A ranked-choice endorsement of three candidates is three rows with ranks 1–3. This is the way to sync everything, or with changed_since just what’s new since your last sync. GET /v1/endorsements/{id} has the full record, and GET /v1/contests/{id} every position in a contest.","parameters":[{"name":"categories","in":"query","description":"Endorser category slugs (GET /v1/endorser-categories). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","x-enumDescriptions":{"editorial":"Voter guides & editorial boards: each one a voter guide.","labor":"Labor: each one a labor union.","environment":"Environment & transportation: each one a environmental group.","business":"Housing & business: each one a housing or business group.","party":"Political parties: each one a political party.","club":"Political clubs: each one a political club.","community":"Community & advocacy: each one a community group.","officials":"Elected officials: each one a elected official."},"x-values":"endorser-category"}},"style":"form","explode":false,"example":"labor"},{"name":"endorsers","in":"query","description":"Endorser slugs (GET /v1/endorsers). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"sf-labor-council"},{"name":"endorser_states","in":"query","description":"Endorsers’ home states (USPS codes), or national for endorsers with none. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"CA,national"},{"name":"elections","in":"query","description":"Election slugs (GET /v1/elections). A date and type (2026-11-03-general) matches every election of that type that day nationwide, and a bare date (2026-11-03) every election that day. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"ca-2026-11-03-general"},{"name":"states","in":"query","description":"States the contests are voted in (USPS codes). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}},"style":"form","explode":false,"example":"CA"},{"name":"contest_kinds","in":"query","description":"Contest kinds: candidate (an office), measure, or retention (whether to keep a judge). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["candidate","measure","retention"],"x-enumDescriptions":{"candidate":"A race for an office: voters choose among candidates.","measure":"A ballot measure (proposition, amendment, bond, tax, referendum or initiative): voters answer Yes or No.","retention":"A judicial retention question: should this judge stay in office? Voters answer Yes or No."},"x-values":"contest-kind"}},"style":"form","explode":false,"example":"measure"},{"name":"levels","in":"query","description":"Levels of the contest’s district, from federal down to school and special districts. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["federal","state","county","city","school","special"],"x-enumDescriptions":{"federal":"The whole country, or a U.S. House district.","state":"A whole state, or a state legislative, judicial or other state district.","county":"A county (a parish in Louisiana, a borough in Alaska) or a district within one.","city":"A city, town, township, village or borough, or a ward or council district within one.","school":"A school district, community college district, or a trustee area within one.","special":"A special district: water, fire, hospital, park, transit, port, conservation and the like."},"x-values":"district-level"}},"style":"form","explode":false,"example":"county,city"},{"name":"contest","in":"query","description":"Only this contest.","schema":{"type":"integer","minimum":1},"example":4410},{"name":"changed_since","in":"query","description":"Only endorsements added or changed at or after this time (ISO 8601). Use the time you last synced to fetch just what’s new; deletions aren’t listed here, so check GET /v1/endorsements/{id}/history for ids you hold that stop appearing.","schema":{"type":"string","format":"date-time"},"example":"2026-11-01T00:00:00Z"},{"name":"upcoming","in":"query","description":"true for only elections from yesterday on; false (the default) for every election.","schema":{"type":"boolean","default":false},"example":true},{"name":"lang","in":"query","description":"es for Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English otherwise. Names are never translated.","schema":{"type":"string","enum":["en","es"],"x-enumDescriptions":{"en":"English (the default).","es":"Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English where it doesn’t. Names are never translated."},"x-values":"lang","default":"en"},"example":"es"},{"name":"limit","in":"query","description":"Results per page, 1–500.","schema":{"type":"integer","minimum":1,"maximum":500,"default":100},"example":20},{"name":"cursor","in":"query","description":"Where the next page starts: the next_cursor from the previous page. Leave it out for the first page; it is opaque, so pass it back exactly as you got it.","schema":{"type":"string"},"example":"aTo0NDEw"},{"name":"format","in":"query","description":"json (the default) or csv: the same page as CSV, with the next page’s cursor in the X-Next-Cursor header. The data dictionaries list the columns.","schema":{"type":"string","enum":["json","csv"],"x-enumDescriptions":{"json":"The JSON response, { \"data\": [...], \"next_cursor\": \"…\" } (the default).","csv":"The same page as CSV (text/csv), one row per record or per choice, contest, election or endorser compared, as each endpoint says. The columns are listed in the data dictionaries; the next page’s cursor comes in the X-Next-Cursor header and a Link header."},"x-values":"list-format","default":"json"},"example":"csv"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"id,endorser.name,contest.title,choice.label"}],"responses":{"200":{"description":"A page of endorsements, by id. With format=csv, the same as CSV (text/csv). One row per endorsement: one endorser’s pick of one choice (a ranked-choice ranking is a row per rank).","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-Next-Cursor":{"description":"format=csv: the next page’s cursor (absent on the last page).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","description":"This page.","items":{"$ref":"#/components/schemas/Endorsement"}},"next_cursor":{"type":["string","null"],"description":"Pass as cursor= for the next page; null on the last page."}}},"example":{"data":[{"id":90211,"rank":1,"published_on":"2026-09-18","first_seen_on":"2026-09-18","date_source":"page","added_by":"data_load","stage":"general","endorser":{"id":512,"slug":"sf-labor-council","name":"San Francisco Labor Council"},"contest":{"id":4410,"slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8","title":"Member, Board of Supervisors, District 8"},"election":{"id":3,"slug":"ca-2026-11-03-general","date":"2026-11-03"},"choice":{"id":20931,"slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8/jane-doe","label":"Jane Doe","measure_answer":null}}],"next_cursor":"aTo5MDIxMQ"}},"text/csv":{"schema":{"type":"string"},"example":"endorsement_id,rank,published_on,added_by,stage,endorser_id,endorser_slug,endorser_name,contest_id,contest_title,election_id,election_slug,election_date,choice_id,choice_label,measure_answer,first_seen_on,date_source\r\n90211,1,2026-09-18,data_load,general,512,sf-labor-council,San Francisco Labor Council,4410,\"Member, Board of Supervisors, District 8\",3,ca-2026-11-03-general,2026-11-03,20931,Jane Doe,,2026-09-18,page\r\n"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/endorsements?elections=ca-2026-11-03-general&categories=labor\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst { data: endorsements } = await client.endorsements.list({ elections: 'ca-2026-11-03-general', categories: 'labor' });\n\n// Or every endorsement, fetching page after page:\n// for await (const endorsement of client.endorsements.list({ ... })) { … }"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nendorsements = client.endorsements.list(elections=\"ca-2026-11-03-general\", categories=\"labor\").data\n\n# Or every endorsement, fetching page after page:\n# for endorsement in client.endorsements.list(...): ..."}]}},"/v1/endorsements/{id}":{"get":{"operationId":"getEndorsement","tags":["Endorsements"],"summary":"Get an endorsement","description":"One endorsement in full: what the endorser said and where, the endorser, the contest with its district, election and voting rules, and the choice with its candidate and party.","parameters":[{"name":"id","in":"path","required":true,"description":"Endorsement id (from GET /v1/endorsements).","schema":{"type":"integer","minimum":1},"example":90211},{"name":"lang","in":"query","description":"es for Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English otherwise. Names are never translated.","schema":{"type":"string","enum":["en","es"],"x-enumDescriptions":{"en":"English (the default).","es":"Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English where it doesn’t. Names are never translated."},"x-values":"lang","default":"en"},"example":"es"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"id,statement,source_url,endorser.name,choice.label"}],"responses":{"200":{"description":"The endorsement.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/EndorsementDetail"}}},"example":{"data":{"id":90211,"rank":1,"statement":null,"source_url":"https://sflaborcouncil.org/endorsements","published_on":"2026-09-18","first_seen_on":"2026-09-18","date_source":"page","retrieved_at":"2026-09-19T04:12:08.331Z","added_by":"data_load","stage":"general","endorser":{"id":512,"slug":"sf-labor-council","name":"San Francisco Labor Council","category":{"slug":"labor","name":"Labor"},"state":"CA","description":"The central labor council for San Francisco, representing over 150 unions.","website_url":"https://sflaborcouncil.org","logo_url":null,"party":null},"contest":{"id":4410,"slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8","title":"Member, Board of Supervisors, District 8","short_title":"Supervisor, D8","kind":"candidate","vote_method":"ranked_choice","votes_allowed":1,"ranks_allowed":10,"measure_code":null,"description":null,"ballot_text":null,"full_text_url":null,"unopposed":false,"on_ballot":true,"off_ballot_reason":null,"ballot_order":41,"party":null,"details":{"nonpartisan":true},"source_url":"https://www.sf.gov/departments/department-elections","office":{"type":"county_legislature","level":"local","branch":"legislative"},"seat":{"slug":"ca-san-francisco-board-of-supervisors-8","name":"San Francisco Board of Supervisors, District 8","race_type":"regular","stage":"general","seats_up":1},"race_type":"regular","partisan":false,"topics":[],"district":{"id":77,"ocd_id":"ocd-division/country:us/state:ca/county:san_francisco/council_district:8","name":"San Francisco Supervisorial District 8","level":"county","type":"council","state":"CA","partisanship":{"president_2016":null,"president_2020":null,"president_2024":null},"demographics":null},"election":{"id":3,"slug":"ca-2026-11-03-general","name":"California General Election","short_name":"General Election","date":"2026-11-03","state":"CA","type":"general","primary_system":"top_two","info_url":"https://www.sos.ca.gov/elections/upcoming-elections","details":{"all_mail":true}},"result":{"status":"unofficial","source_kind":"official","party_reported":false,"total_votes":52418,"precincts_reporting":41,"precincts_total":41,"source":{"name":"San Francisco Department of Elections","url":"https://www.sf.gov/departments/department-elections/results","contest_name":"Member, Board of Supervisors, District 8","updated_at":"2026-11-12T17:00:00-08:00"},"official_url":null,"more_sources":[],"write_in_votes":212,"blank_votes":null,"over_votes":null,"under_votes":null,"other_choices":[{"label":"Write-in","votes":212,"write_in":true}],"rcv_rounds":[{"round":1,"tallies":{"Jane Doe":24133,"Sam Rivera":21907,"Lee Park":6166},"eliminated":["Lee Park"]},{"round":2,"tallies":{"Jane Doe":27310,"Sam Rivera":23998}}],"notes":"Ranked choice: Jane Doe leads after round 2.","turnout":null,"seat_change":null,"fetched_at":"2026-11-13T06:30:12Z"}},"choice":{"id":20931,"slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8/jane-doe","label":"Jane Doe","measure_answer":null,"option":null,"ballot_designation":"Transit Planner","withdrawn":false,"status":"on_ballot","incumbent":true,"vote_meaning":null,"endorsement_count":14,"candidate":{"id":8811,"full_name":"Jane Doe","name":{"given":"Jane","middle":null,"family":"Doe","suffix":null,"nickname":null},"website_url":"https://example.com/janedoe","photo_url":null,"ids":{"fec":null,"bioguide":null},"contact":{"website":null,"email":"info@example.com","phone":null,"mailing_address":null,"social":{"facebook":"https://www.facebook.com/janedoeforsupervisor","instagram":"https://www.instagram.com/janedoesf"},"sources":[{"url":"https://example.com/janedoe","kind":"campaign_website","read_on":"2026-11-13"}]}},"party":null,"party_label":null,"party_lines":[],"result":{"votes":24133,"vote_pct":46.039,"winner":null}}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/endorsements/90211\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst endorsement = await client.endorsements.get(90211);"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nendorsement = client.endorsements.get(90211)"}]}},"/v1/endorsements/{id}/history":{"get":{"operationId":"getEndorsementHistory","tags":["Endorsements"],"summary":"Get an endorsement’s history","description":"Every change to one endorsement, oldest first: when it was added, each change to its choice, rank, statement, source or date with the values before and after, and its deletion. Works after an endorsement is deleted too, so you can tell why an id stopped appearing.","parameters":[{"name":"id","in":"path","required":true,"description":"Endorsement id (from GET /v1/endorsements, or one you stored earlier).","schema":{"type":"integer","minimum":1},"example":90211},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"at,change,changed"}],"responses":{"200":{"description":"Every change, oldest first.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","description":"Every item.","items":{"$ref":"#/components/schemas/HistoryEntry"}}}},"example":{"data":[{"at":"2026-09-19T04:12:08.331Z","change":"created","changed":[],"before":null,"after":{"choice_id":20931,"choice_label":"Jane Doe","rank":2,"statement":null,"source_url":"https://sflaborcouncil.org/endorsements","published_on":"2026-09-18"}},{"at":"2026-10-03T16:40:51.020Z","change":"updated","changed":["rank"],"before":{"choice_id":20931,"choice_label":"Jane Doe","rank":2,"statement":null,"source_url":"https://sflaborcouncil.org/endorsements","published_on":"2026-09-18"},"after":{"choice_id":20931,"choice_label":"Jane Doe","rank":1,"statement":null,"source_url":"https://sflaborcouncil.org/endorsements","published_on":"2026-09-18"}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/endorsements/90211/history\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst history = await client.endorsements.history(90211);"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nhistory = client.endorsements.history(90211)"}]}},"/v1/changes":{"get":{"operationId":"listChanges","tags":["Endorsements"],"summary":"List changes since a time","description":"Every endorsement added, changed or deleted since a time, in the order they happened, deletions included: the way to keep a copy current without the stream. Each change has the values before and after. Start with since= (the time of your last sync); page on with the cursor. The cursor follows the order changes were made, so changes made while you page show up on later pages, never missed.","parameters":[{"name":"since","in":"query","description":"Changes at or after this time (ISO 8601). Required unless you pass a cursor.","schema":{"type":"string","format":"date-time"},"example":"2026-11-01T00:00:00Z"},{"name":"categories","in":"query","description":"Endorser category slugs (GET /v1/endorser-categories). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","x-enumDescriptions":{"editorial":"Voter guides & editorial boards: each one a voter guide.","labor":"Labor: each one a labor union.","environment":"Environment & transportation: each one a environmental group.","business":"Housing & business: each one a housing or business group.","party":"Political parties: each one a political party.","club":"Political clubs: each one a political club.","community":"Community & advocacy: each one a community group.","officials":"Elected officials: each one a elected official."},"x-values":"endorser-category"}},"style":"form","explode":false,"example":"labor"},{"name":"endorsers","in":"query","description":"Endorser slugs (GET /v1/endorsers). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"sf-labor-council"},{"name":"elections","in":"query","description":"Election slugs (GET /v1/elections). A date and type (2026-11-03-general) matches every election of that type that day nationwide, and a bare date (2026-11-03) every election that day. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"ca-2026-11-03-general"},{"name":"states","in":"query","description":"States the contests are voted in (USPS codes). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}},"style":"form","explode":false,"example":"CA"},{"name":"limit","in":"query","description":"Results per page, 1–1000.","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"example":20},{"name":"cursor","in":"query","description":"Where the next page starts: the next_cursor from the previous page. Leave it out for the first page; it is opaque, so pass it back exactly as you got it.","schema":{"type":"string"},"example":"aTo0NDEw"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"at,change,endorsement_id,endorser.slug"}],"responses":{"200":{"description":"A page of changes, oldest first.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","description":"This page.","items":{"$ref":"#/components/schemas/Change"}},"next_cursor":{"type":["string","null"],"description":"Pass as cursor= for the next page; null on the last page."}}},"example":{"data":[{"id":512330,"at":"2026-11-02T18:04:11.902Z","change":"updated","changed":["rank"],"endorsement_id":90211,"endorser":{"id":512,"slug":"sf-labor-council","name":"San Francisco Labor Council","category":{"slug":"labor","name":"Labor"}},"contest":{"id":4410,"title":"Member, Board of Supervisors, District 8"},"election":{"id":3,"slug":"ca-2026-11-03-general","date":"2026-11-03"},"before":{"choice_id":20931,"choice_label":"Jane Doe","rank":2,"statement":null,"source_url":"https://sflaborcouncil.org/endorsements","published_on":"2026-09-18"},"after":{"choice_id":20931,"choice_label":"Jane Doe","rank":1,"statement":null,"source_url":"https://sflaborcouncil.org/endorsements","published_on":"2026-09-18"}},{"id":512331,"at":"2026-11-02T18:04:11.902Z","change":"deleted","changed":[],"endorsement_id":90377,"endorser":{"id":88,"slug":"sf-chronicle","name":"San Francisco Chronicle","category":{"slug":"editorial","name":"Voter guides & editorial boards"}},"contest":{"id":4410,"title":"Member, Board of Supervisors, District 8"},"election":{"id":3,"slug":"ca-2026-11-03-general","date":"2026-11-03"},"before":{"choice_id":20932,"choice_label":"Sam Rivera","rank":null,"statement":null,"source_url":"https://www.sfchronicle.com/opinion/endorsements","published_on":"2026-10-02"},"after":null}],"next_cursor":"aTo1MTIzMzE"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/changes?since=2026-11-01T00%3A00%3A00Z&states=CA\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst { data: changes } = await client.changes.list({ since: '2026-11-01T00:00:00Z', states: 'CA' });"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nchanges = client.changes.list(since=\"2026-11-01T00:00:00Z\", states=\"CA\").data"}]}},"/v1/changes.atom":{"get":{"operationId":"getChangesAtom","tags":["Endorsements"],"summary":"Changes as an Atom 1.0 feed","description":"The changes of GET /v1/changes as an Atom 1.0 feed for feed readers, newest first: one entry per endorsement added, changed or removed in what your account bought, with the values before and after, linking to the endorser’s source. Takes the same filters. Without since it shows the last 7 days; it has no cursor, so to catch up on more than one feed’s worth use GET /v1/changes. Send your key as usual, or, for feed readers that can’t send headers, as HTTP Basic: the key as the password (any user name), which most readers ask for when they get the 401. Never put a key in the URL. Each request counts against your rate limit like any other. Readers may keep a feed for 5 minutes (Cache-Control), and an unchanged feed answers If-None-Match or If-Modified-Since with 304.","parameters":[{"name":"since","in":"query","description":"Changes at or after this time (ISO 8601). Leave it out for the last 7 days.","schema":{"type":"string","format":"date-time"},"example":"2026-11-01T00:00:00Z"},{"name":"categories","in":"query","description":"Endorser category slugs (GET /v1/endorser-categories). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","x-enumDescriptions":{"editorial":"Voter guides & editorial boards: each one a voter guide.","labor":"Labor: each one a labor union.","environment":"Environment & transportation: each one a environmental group.","business":"Housing & business: each one a housing or business group.","party":"Political parties: each one a political party.","club":"Political clubs: each one a political club.","community":"Community & advocacy: each one a community group.","officials":"Elected officials: each one a elected official."},"x-values":"endorser-category"}},"style":"form","explode":false,"example":"labor"},{"name":"endorsers","in":"query","description":"Endorser slugs (GET /v1/endorsers). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"sf-labor-council"},{"name":"elections","in":"query","description":"Election slugs (GET /v1/elections). A date and type (2026-11-03-general) matches every election of that type that day nationwide, and a bare date (2026-11-03) every election that day. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"ca-2026-11-03-general"},{"name":"states","in":"query","description":"States the contests are voted in (USPS codes). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}},"style":"form","explode":false,"example":"CA"},{"name":"limit","in":"query","description":"Entries in the feed, 1–200: the newest changes.","schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"example":20}],"responses":{"200":{"description":"The feed (application/atom+xml), newest first.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/atom+xml":{"schema":{"type":"string"},"example":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<feed xmlns=\"http://www.w3.org/2005/Atom\">\n  <id>https://api.ballotdata.ai/v1/changes.atom?since=2026-11-01T00%3A00%3A00Z&amp;states=CA</id>\n  <title>BallotData endorsement changes</title>\n  <updated>2026-11-02T18:04:11.902Z</updated>\n  <link rel=\"self\" type=\"application/atom+xml\" href=\"https://api.ballotdata.ai/v1/changes.atom?since=2026-11-01T00%3A00%3A00Z&amp;states=CA\"/>\n  <author><name>BallotData</name></author>\n  <generator uri=\"https://ballotdata.ai\">BallotData API</generator>\n  <entry>\n    <id>tag:ballotdata.ai,2026:change:512331</id>\n    <title>San Francisco Chronicle’s endorsement of Sam Rivera was withdrawn or removed: Member, Board of Supervisors, District 8</title>\n    <updated>2026-11-02T18:04:11.902Z</updated>\n    <author><name>San Francisco Chronicle</name></author>\n    <link rel=\"alternate\" href=\"https://www.sfchronicle.com/opinion/endorsements\"/>\n    <category term=\"sf-chronicle\"/>\n    <category term=\"deleted\"/>\n    <content type=\"text\">San Francisco Chronicle’s endorsement of Sam Rivera was withdrawn or removed: Member, Board of Supervisors, District 8.\nElection: ca-2026-11-03-general (2026-11-03).\nchoice: Sam Rivera\nsource: https://www.sfchronicle.com/opinion/endorsements\npublished: 2026-10-02\nEndorsement 90377, change 512331.</content>\n  </entry>\n  <entry>\n    <id>tag:ballotdata.ai,2026:change:512330</id>\n    <title>San Francisco Labor Council changed from Jane Doe (rank 2) to Jane Doe (rank 1): Member, Board of Supervisors, District 8</title>\n    <updated>2026-11-02T18:04:11.902Z</updated>\n    <author><name>San Francisco Labor Council</name></author>\n    <link rel=\"alternate\" href=\"https://sflaborcouncil.org/endorsements\"/>\n    <category term=\"sf-labor-council\"/>\n    <category term=\"updated\"/>\n    <content type=\"text\">San Francisco Labor Council changed from Jane Doe (rank 2) to Jane Doe (rank 1): Member, Board of Supervisors, District 8.\nElection: ca-2026-11-03-general (2026-11-03).\nrank: 2 → 1\nEndorsement 90211, change 512330.</content>\n  </entry>\n</feed>\n"}}},"304":{"description":"Not modified: the feed is the same as the copy named in If-None-Match or If-Modified-Since."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"# A feed reader sends the key the same way: as the password, with any user name.\ncurl \"https://api.ballotdata.ai/v1/changes.atom?since=2026-11-01T00%3A00%3A00Z&states=CA\" \\\n  -u \"feed:$BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"// Most readers take the key as a password. In code, send it as usual:\nconst res = await fetch('https://api.ballotdata.ai/v1/changes.atom?since=2026-11-01T00%3A00%3A00Z&states=CA', {\n  headers: { Authorization: `Bearer ${process.env.BALLOTDATA_API_KEY}` },\n});\nconst xml = await res.text(); // Atom 1.0"},{"lang":"Python","label":"Python","source":"# Most readers take the key as a password. In code, send it as usual:\nimport os\nimport httpx\n\nres = httpx.get(\n    \"https://api.ballotdata.ai/v1/changes.atom?since=2026-11-01T00%3A00%3A00Z&states=CA\",\n    headers={\"Authorization\": f\"Bearer {os.environ['BALLOTDATA_API_KEY']}\"},\n)\nxml = res.text  # Atom 1.0"}]}},"/v1/changes.rss":{"get":{"operationId":"getChangesRss","tags":["Endorsements"],"summary":"Changes as an RSS 2.0 feed","description":"The changes of GET /v1/changes as an RSS 2.0 feed for feed readers, newest first: one entry per endorsement added, changed or removed in what your account bought, with the values before and after, linking to the endorser’s source. Takes the same filters. Without since it shows the last 7 days; it has no cursor, so to catch up on more than one feed’s worth use GET /v1/changes. Send your key as usual, or, for feed readers that can’t send headers, as HTTP Basic: the key as the password (any user name), which most readers ask for when they get the 401. Never put a key in the URL. Each request counts against your rate limit like any other. Readers may keep a feed for 5 minutes (Cache-Control), and an unchanged feed answers If-None-Match or If-Modified-Since with 304.","parameters":[{"name":"since","in":"query","description":"Changes at or after this time (ISO 8601). Leave it out for the last 7 days.","schema":{"type":"string","format":"date-time"},"example":"2026-11-01T00:00:00Z"},{"name":"categories","in":"query","description":"Endorser category slugs (GET /v1/endorser-categories). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","x-enumDescriptions":{"editorial":"Voter guides & editorial boards: each one a voter guide.","labor":"Labor: each one a labor union.","environment":"Environment & transportation: each one a environmental group.","business":"Housing & business: each one a housing or business group.","party":"Political parties: each one a political party.","club":"Political clubs: each one a political club.","community":"Community & advocacy: each one a community group.","officials":"Elected officials: each one a elected official."},"x-values":"endorser-category"}},"style":"form","explode":false,"example":"labor"},{"name":"endorsers","in":"query","description":"Endorser slugs (GET /v1/endorsers). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"sf-labor-council"},{"name":"elections","in":"query","description":"Election slugs (GET /v1/elections). A date and type (2026-11-03-general) matches every election of that type that day nationwide, and a bare date (2026-11-03) every election that day. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"ca-2026-11-03-general"},{"name":"states","in":"query","description":"States the contests are voted in (USPS codes). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}},"style":"form","explode":false,"example":"CA"},{"name":"limit","in":"query","description":"Entries in the feed, 1–200: the newest changes.","schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"example":20}],"responses":{"200":{"description":"The feed (application/rss+xml), newest first.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/rss+xml":{"schema":{"type":"string"},"example":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n  <channel>\n    <title>BallotData endorsement changes</title>\n    <link>https://ballotdata.ai</link>\n    <description>Endorsements added, changed or removed in the data your BallotData account bought, newest first.</description>\n    <atom:link rel=\"self\" type=\"application/rss+xml\" href=\"https://api.ballotdata.ai/v1/changes.rss?since=2026-11-01T00%3A00%3A00Z&amp;states=CA\"/>\n    <lastBuildDate>Mon, 02 Nov 2026 18:04:11 GMT</lastBuildDate>\n    <ttl>5</ttl>\n    <item>\n      <title>San Francisco Chronicle’s endorsement of Sam Rivera was withdrawn or removed: Member, Board of Supervisors, District 8</title>\n      <link>https://www.sfchronicle.com/opinion/endorsements</link>\n      <guid isPermaLink=\"false\">tag:ballotdata.ai,2026:change:512331</guid>\n      <pubDate>Mon, 02 Nov 2026 18:04:11 GMT</pubDate>\n      <category>sf-chronicle</category>\n      <category>deleted</category>\n      <description>San Francisco Chronicle’s endorsement of Sam Rivera was withdrawn or removed: Member, Board of Supervisors, District 8.\nElection: ca-2026-11-03-general (2026-11-03).\nchoice: Sam Rivera\nsource: https://www.sfchronicle.com/opinion/endorsements\npublished: 2026-10-02\nEndorsement 90377, change 512331.</description>\n    </item>\n    <item>\n      <title>San Francisco Labor Council changed from Jane Doe (rank 2) to Jane Doe (rank 1): Member, Board of Supervisors, District 8</title>\n      <link>https://sflaborcouncil.org/endorsements</link>\n      <guid isPermaLink=\"false\">tag:ballotdata.ai,2026:change:512330</guid>\n      <pubDate>Mon, 02 Nov 2026 18:04:11 GMT</pubDate>\n      <category>sf-labor-council</category>\n      <category>updated</category>\n      <description>San Francisco Labor Council changed from Jane Doe (rank 2) to Jane Doe (rank 1): Member, Board of Supervisors, District 8.\nElection: ca-2026-11-03-general (2026-11-03).\nrank: 2 → 1\nEndorsement 90211, change 512330.</description>\n    </item>\n  </channel>\n</rss>\n"}}},"304":{"description":"Not modified: the feed is the same as the copy named in If-None-Match or If-Modified-Since."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"# A feed reader sends the key the same way: as the password, with any user name.\ncurl \"https://api.ballotdata.ai/v1/changes.rss?since=2026-11-01T00%3A00%3A00Z&states=CA\" \\\n  -u \"feed:$BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"// Most readers take the key as a password. In code, send it as usual:\nconst res = await fetch('https://api.ballotdata.ai/v1/changes.rss?since=2026-11-01T00%3A00%3A00Z&states=CA', {\n  headers: { Authorization: `Bearer ${process.env.BALLOTDATA_API_KEY}` },\n});\nconst xml = await res.text(); // RSS 2.0"},{"lang":"Python","label":"Python","source":"# Most readers take the key as a password. In code, send it as usual:\nimport os\nimport httpx\n\nres = httpx.get(\n    \"https://api.ballotdata.ai/v1/changes.rss?since=2026-11-01T00%3A00%3A00Z&states=CA\",\n    headers={\"Authorization\": f\"Bearer {os.environ['BALLOTDATA_API_KEY']}\"},\n)\nxml = res.text  # RSS 2.0"}]}},"/v1/candidates":{"get":{"operationId":"listCandidates","tags":["Candidates"],"summary":"List candidates","description":"Candidates, each with the contests they’re on and how many endorsers backed them in each. Search by name, or narrow by state, election or incumbency. GET /v1/candidates/{id} has the endorsements themselves.","parameters":[{"name":"q","in":"query","description":"Name contains (case-insensitive, up to 100 characters).","schema":{"type":"string","maxLength":100},"example":"doe"},{"name":"states","in":"query","description":"States the contests are voted in (USPS codes). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}},"style":"form","explode":false,"example":"CA"},{"name":"elections","in":"query","description":"Election slugs (GET /v1/elections). A date and type (2026-11-03-general) matches every election of that type that day nationwide, and a bare date (2026-11-03) every election that day. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"ca-2026-11-03-general"},{"name":"incumbent","in":"query","description":"true for only incumbents, false for only candidates known not to hold the seat. Leave it out for everyone.","schema":{"type":"boolean"},"example":true},{"name":"person","in":"query","description":"A person’s slug (Person.slug): every candidate record for that person.","schema":{"type":"string","maxLength":100},"example":"hochul-kathy-ny"},{"name":"upcoming","in":"query","description":"true for only elections from yesterday on; false (the default) for every election.","schema":{"type":"boolean","default":false},"example":true},{"name":"lang","in":"query","description":"es for Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English otherwise. Names are never translated.","schema":{"type":"string","enum":["en","es"],"x-enumDescriptions":{"en":"English (the default).","es":"Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English where it doesn’t. Names are never translated."},"x-values":"lang","default":"en"},"example":"es"},{"name":"limit","in":"query","description":"Results per page, 1–500.","schema":{"type":"integer","minimum":1,"maximum":500,"default":100},"example":20},{"name":"cursor","in":"query","description":"Where the next page starts: the next_cursor from the previous page. Leave it out for the first page; it is opaque, so pass it back exactly as you got it.","schema":{"type":"string"},"example":"aTo0NDEw"},{"name":"format","in":"query","description":"json (the default) or csv: the same page as CSV, with the next page’s cursor in the X-Next-Cursor header. The data dictionaries list the columns.","schema":{"type":"string","enum":["json","csv"],"x-enumDescriptions":{"json":"The JSON response, { \"data\": [...], \"next_cursor\": \"…\" } (the default).","csv":"The same page as CSV (text/csv), one row per record or per choice, contest, election or endorser compared, as each endpoint says. The columns are listed in the data dictionaries; the next page’s cursor comes in the X-Next-Cursor header and a Link header."},"x-values":"list-format","default":"json"},"example":"csv"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"id,full_name,contests.contest.title"}],"responses":{"200":{"description":"A page of candidates, by id. With format=csv, the same as CSV (text/csv). One row per candidate and contest they are on the ballot in; a page still holds limit candidates.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-Next-Cursor":{"description":"format=csv: the next page’s cursor (absent on the last page).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","description":"This page.","items":{"$ref":"#/components/schemas/CandidateSummary"}},"next_cursor":{"type":["string","null"],"description":"Pass as cursor= for the next page; null on the last page."}}},"example":{"data":[{"id":8811,"full_name":"Jane Doe","name":{"given":"Jane","middle":null,"family":"Doe","suffix":null,"nickname":null},"website_url":"https://example.com/janedoe","photo_url":null,"ids":{"fec":null,"bioguide":null},"contact":{"website":null,"email":"info@example.com","phone":null,"mailing_address":null,"social":{"facebook":"https://www.facebook.com/janedoeforsupervisor","instagram":"https://www.instagram.com/janedoesf"},"sources":[{"url":"https://example.com/janedoe","kind":"campaign_website","read_on":"2026-11-13"}]},"incumbent":true,"background":{"held_elected_office":true,"prior_offices":["Member, Board of Supervisors, District 8"],"gender":"woman","veteran":null,"sources":[{"attribute":"gender","value":"woman","basis":"candidate_statement","quote":"As a woman who has ridden Muni every day for twenty years, I know what our riders need.","source":{"name":"Candidate campaign website","url":"https://example.com/janedoe/about"},"retrieved_on":"2026-11-14"},{"attribute":"held_elected_office","value":"true","basis":"our_results","quote":null,"source":{"name":"San Francisco Department of Elections","url":"https://www.sf.gov/departments/department-elections/results"},"retrieved_on":"2026-11-14"},{"attribute":"prior_office","value":"Member, Board of Supervisors, District 8","basis":"our_results","quote":null,"source":{"name":"San Francisco Department of Elections","url":"https://www.sf.gov/departments/department-elections/results"},"retrieved_on":"2026-11-14"}]},"ideology":{"dime_cfscore":null,"scores":[]},"person":{"id":52001,"slug":"doe-jane-ca","full_name":"Jane Doe","link_basis":"seat","candidate_ids":[8811,61290],"other_names":[{"name":"Jane Smith","kind":"former","first_used":"2022-11-08","last_used":"2022-11-08"}],"party_changes":[]},"contests":[{"contest":{"id":4410,"slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8","title":"Member, Board of Supervisors, District 8","kind":"candidate","vote_method":"ranked_choice","votes_allowed":1,"ranks_allowed":10,"office":{"type":"county_legislature","level":"local","branch":"legislative"},"race_type":"regular"},"district":{"id":77,"ocd_id":"ocd-division/country:us/state:ca/county:san_francisco/council_district:8","name":"San Francisco Supervisorial District 8","level":"county","state":"CA"},"election":{"id":3,"slug":"ca-2026-11-03-general","name":"California General Election","date":"2026-11-03"},"choice":{"id":20931,"slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8/jane-doe","label":"Jane Doe","ballot_designation":"Transit Planner","withdrawn":false,"status":"on_ballot","party":null,"party_label":null,"party_lines":[],"result":{"votes":24133,"vote_pct":46.039,"winner":null}},"result":{"status":"unofficial","source_kind":"official","party_reported":false,"total_votes":52418,"source_url":"https://www.sf.gov/departments/department-elections/results","seat_change":null},"endorsement_count":14}]}],"next_cursor":"aTo4ODEx"}},"text/csv":{"schema":{"type":"string"},"example":"candidate_id,full_name,given_name,middle_name,family_name,suffix,nickname,incumbent,fec_id,bioguide_id,website,held_elected_office,prior_offices,gender,veteran,dime_cfscore,contest_id,contest_title,contest_kind,vote_method,office_type,race_type,election_slug,election_date,district_ocd_id,district_name,district_level,state,choice_id,ballot_name,ballot_designation,withdrawn,party,party_label,endorsement_count,votes,vote_pct,winner,result_status,result_source_kind,result_total_votes\r\n8811,Jane Doe,Jane,,Doe,,,true,,,,true,\"Member, Board of Supervisors, District 8\",woman,,,4410,\"Member, Board of Supervisors, District 8\",candidate,ranked_choice,county_legislature,regular,ca-2026-11-03-general,2026-11-03,ocd-division/country:us/state:ca/county:san_francisco/council_district:8,San Francisco Supervisorial District 8,county,CA,20931,Jane Doe,Transit Planner,false,,,14,24133,46.039,,unofficial,official,52418\r\n"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/candidates?q=doe&states=CA\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst { data: candidates } = await client.candidates.list({ q: 'doe', states: 'CA' });"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\ncandidates = client.candidates.list(q=\"doe\", states=\"CA\").data"}]}},"/v1/candidates/{id}":{"get":{"operationId":"getCandidate","tags":["Candidates"],"summary":"Get a candidate with endorsements","description":"One candidate, with every contest they’re on, how each turned out once it has a result, and every endorsement they received in each: who, the rank for ranked choice, what they said and where.","parameters":[{"name":"id","in":"path","required":true,"description":"Candidate id (from GET /v1/candidates, or a choice’s candidate.id).","schema":{"type":"integer","minimum":1},"example":8811},{"name":"lang","in":"query","description":"es for Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English otherwise. Names are never translated.","schema":{"type":"string","enum":["en","es"],"x-enumDescriptions":{"en":"English (the default).","es":"Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English where it doesn’t. Names are never translated."},"x-values":"lang","default":"en"},"example":"es"},{"name":"outside_spending_cycles","in":"query","description":"FEC cycles (by their last year, such as 2024 or 2026) that outside_spending shows; leave it out for every cycle we hold. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"integer","minimum":2000}},"style":"form","explode":false,"example":"2024"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"full_name,website_url,contests(contest.title,endorsement_count),issue_positions(issue,stance)"}],"responses":{"200":{"description":"The candidate.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/CandidateDetail"}}},"example":{"data":{"id":8811,"full_name":"Jane Doe","name":{"given":"Jane","middle":null,"family":"Doe","suffix":null,"nickname":null},"website_url":"https://example.com/janedoe","photo_url":null,"ids":{"fec":null,"bioguide":null},"contact":{"website":null,"email":"info@example.com","phone":null,"mailing_address":null,"social":{"facebook":"https://www.facebook.com/janedoeforsupervisor","instagram":"https://www.instagram.com/janedoesf"},"sources":[{"url":"https://example.com/janedoe","kind":"campaign_website","read_on":"2026-11-13"}]},"incumbent":true,"finance":[],"outside_spending":[],"fec_committees":[],"contributions_from_committees":[],"spending":[],"background":{"held_elected_office":true,"prior_offices":["Member, Board of Supervisors, District 8"],"gender":"woman","veteran":null,"sources":[{"attribute":"gender","value":"woman","basis":"candidate_statement","quote":"As a woman who has ridden Muni every day for twenty years, I know what our riders need.","source":{"name":"Candidate campaign website","url":"https://example.com/janedoe/about"},"retrieved_on":"2026-11-14"},{"attribute":"held_elected_office","value":"true","basis":"our_results","quote":null,"source":{"name":"San Francisco Department of Elections","url":"https://www.sf.gov/departments/department-elections/results"},"retrieved_on":"2026-11-14"},{"attribute":"prior_office","value":"Member, Board of Supervisors, District 8","basis":"our_results","quote":null,"source":{"name":"San Francisco Department of Elections","url":"https://www.sf.gov/departments/department-elections/results"},"retrieved_on":"2026-11-14"}]},"ideology":{"dime_cfscore":null,"scores":[]},"contests":[{"contest":{"id":4410,"slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8","title":"Member, Board of Supervisors, District 8","kind":"candidate","vote_method":"ranked_choice","votes_allowed":1,"ranks_allowed":10,"office":{"type":"county_legislature","level":"local","branch":"legislative"},"race_type":"regular"},"district":{"id":77,"ocd_id":"ocd-division/country:us/state:ca/county:san_francisco/council_district:8","name":"San Francisco Supervisorial District 8","level":"county","state":"CA"},"election":{"id":3,"slug":"ca-2026-11-03-general","name":"California General Election","date":"2026-11-03"},"choice":{"id":20931,"slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8/jane-doe","label":"Jane Doe","ballot_designation":"Transit Planner","withdrawn":false,"status":"on_ballot","party":null,"party_label":null,"party_lines":[],"result":{"votes":24133,"vote_pct":46.039,"winner":null}},"result":{"status":"unofficial","source_kind":"official","party_reported":false,"total_votes":52418,"source_url":"https://www.sf.gov/departments/department-elections/results","seat_change":null},"endorsement_count":14,"endorsements":[{"endorsement_id":90211,"endorser":{"id":512,"slug":"sf-labor-council","name":"San Francisco Labor Council","category":{"slug":"labor","name":"Labor"},"state":"CA"},"rank":1,"statement":null,"source_url":"https://sflaborcouncil.org/endorsements","published_on":"2026-09-18","first_seen_on":"2026-09-18","date_source":"page","added_by":"data_load","stage":"general"}],"rescinded_endorsements":[]}],"issue_positions":[{"id":502,"issue":{"slug":"abortion","name":"Abortion"},"stance":"supports","summary":"Says abortion should stay legal and supports writing protections into state law.","quote":"Decisions about pregnancy belong to patients and their doctors.","checked_on":"2026-11-12","sources":[{"url":"https://example.com/janedoe/issues","kind":"candidate_website","publisher":"Campaign website","title":"Issues","published_on":null},{"url":"https://example.com/news/supervisor-questionnaire","kind":"questionnaire","publisher":"Example News","title":"District 8 candidate questionnaire","published_on":"2026-09-30"}]}],"person":{"id":52001,"slug":"doe-jane-ca","full_name":"Jane Doe","link_basis":"seat","candidate_ids":[8811,61290],"other_names":[{"name":"Jane Smith","kind":"former","first_used":"2022-11-08","last_used":"2022-11-08"}],"party_changes":[]},"other_candidacies":[]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/candidates/8811\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst candidate = await client.candidates.get(8811);"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\ncandidate = client.candidates.get(8811)"}]}},"/v1/measure-topics":{"get":{"operationId":"listMeasureTopics","tags":["Contests"],"summary":"List measure topics","description":"The topics ballot measures are tagged with (taxes, bonds, housing, elections, …). Use the slugs in topics= filters on GET /v1/contests.","parameters":[{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"slug,name"}],"responses":{"200":{"description":"Every topic, in display order.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","description":"Every item.","items":{"$ref":"#/components/schemas/MeasureTopic"}}}},"example":{"data":[{"slug":"taxes","name":"Taxes"},{"slug":"bonds","name":"Bonds and borrowing"},{"slug":"housing","name":"Housing"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/measure-topics\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst topics = await client.measureTopics.list();"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\ntopics = client.measure_topics.list()"}]}},"/v1/issues":{"get":{"operationId":"listIssues","tags":["Candidates"],"summary":"List issues","description":"The policy issues we record candidates’ positions on (abortion, guns, immigration, schools, the safety net and more), each phrased as a yes/no question that a position’s stance answers. Use the slugs in issues= filters.","parameters":[{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"slug,question"}],"responses":{"200":{"description":"Every issue, in display order.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","description":"Every item.","items":{"$ref":"#/components/schemas/Issue"}}}},"example":{"data":[{"slug":"abortion","name":"Abortion","question":"Should abortion be legal in most or all cases?","description":"Access to abortion, including bans, gestational limits, exceptions, federal protections and medication abortion."},{"slug":"guns","name":"Gun laws","question":"Should gun laws be made stricter?","description":"Background checks, assault-weapon and magazine limits, red-flag laws, permit and carry rules."}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/issues\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst issues = await client.issues.list();"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nissues = client.issues.list()"}]}},"/v1/issue-positions":{"get":{"operationId":"listIssuePositions","tags":["Candidates"],"summary":"List issue positions","description":"Where candidates stand on common issues, one row per candidate and issue, each with a neutral summary, the candidate’s own words where we have them, and the links it came from: their own site and statements, debates, questionnaires, reputable news, and official roll-call votes for members of Congress. Narrow by issue, stance, candidate, contest, election or state. GET /v1/candidates/{id} has one candidate’s positions with everything else about them.","parameters":[{"name":"issues","in":"query","description":"Issue slugs (GET /v1/issues). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","x-enumDescriptions":{"abortion":"Abortion. Should abortion be legal in most or all cases?","death-penalty":"Death penalty. Should the death penalty be allowed?","guns":"Gun laws. Should gun laws be made stricter?","immigration-enforcement":"Immigration enforcement. Should immigration enforcement be expanded, including large-scale deportations?","path-to-citizenship":"Path to citizenship. Should some undocumented immigrants, such as those brought here as children, be able to earn legal status or citizenship?","school-choice":"School choice. Should public money pay for private or religious school tuition (vouchers, education savings accounts, tax-credit scholarships)?","public-school-funding":"Public school funding. Should funding for public K-12 schools be increased?","social-security-medicare":"Social Security and Medicare. Should Social Security and Medicare benefits be protected from cuts?","medicaid-snap":"Medicaid and SNAP. Should Medicaid and SNAP (food assistance) be protected from cuts and new eligibility limits such as work requirements?","health-coverage":"Health coverage. Should government do more to provide health coverage (for example, keep enhanced ACA subsidies, expand Medicaid, or add a public option or Medicare for All)?","climate-clean-energy":"Climate and clean energy. Should government act to cut greenhouse gas emissions and speed the shift to clean energy?","taxes-high-earners":"Taxes on high earners and corporations. Should taxes be raised on high earners and corporations?","minimum-wage":"Minimum wage. Should the minimum wage be raised?","unions":"Labor unions. Should it be easier for workers to form unions and bargain collectively (for example, the PRO Act)?","lgbtq-protections":"LGBTQ protections. Should LGBTQ people have legal protection from discrimination (for example, the Equality Act)?","transgender-athletes":"Transgender athletes. Should school and college sports teams be limited by sex at birth?","criminal-justice":"Criminal justice. Should criminal-justice policy focus more on reducing incarceration (for example, sentencing reform, bail reform, alternatives to jail)?","marijuana":"Marijuana. Should recreational marijuana be legal?","voter-id":"Voter ID and proof of citizenship. Should voters have to show photo ID to vote, or prove citizenship to register?","tariffs":"Tariffs. Should the U.S. impose broad tariffs on imported goods?","ukraine-aid":"Aid to Ukraine. Should the U.S. keep providing military aid to Ukraine?","money-in-politics":"Money in politics. Should limits on money in politics be strengthened (for example, overturning Citizens United or banning corporate PAC money)?","congress-stock-trading":"Stock trading by members of Congress. Should members of Congress be banned from trading individual stocks?"},"x-values":"issue"}},"style":"form","explode":false,"example":"abortion,guns"},{"name":"stances","in":"query","description":"Stances: supports, opposes or mixed. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["supports","opposes","mixed"],"x-enumDescriptions":{"supports":"Yes to the issue’s question.","opposes":"No to the issue’s question.","mixed":"Yes to part of it, or yes with limits the summary spells out."},"x-values":"stance"}},"style":"form","explode":false,"example":"supports"},{"name":"candidates","in":"query","description":"Candidate ids. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"integer","minimum":1}},"style":"form","explode":false,"example":"8811"},{"name":"contests","in":"query","description":"Contest ids: positions of the candidates on these contests. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"integer","minimum":1}},"style":"form","explode":false,"example":"4410"},{"name":"elections","in":"query","description":"Election slugs (GET /v1/elections). A date and type (2026-11-03-general) matches every election of that type that day nationwide, and a bare date (2026-11-03) every election that day. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"ca-2026-11-03-general"},{"name":"states","in":"query","description":"States the contests are voted in (USPS codes). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}},"style":"form","explode":false,"example":"CA"},{"name":"limit","in":"query","description":"Results per page, 1–1000.","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"example":20},{"name":"cursor","in":"query","description":"Where the next page starts: the next_cursor from the previous page. Leave it out for the first page; it is opaque, so pass it back exactly as you got it.","schema":{"type":"string"},"example":"aTo0NDEw"},{"name":"format","in":"query","description":"json (the default) or csv: the same page as CSV, with the next page’s cursor in the X-Next-Cursor header. The data dictionaries list the columns.","schema":{"type":"string","enum":["json","csv"],"x-enumDescriptions":{"json":"The JSON response, { \"data\": [...], \"next_cursor\": \"…\" } (the default).","csv":"The same page as CSV (text/csv), one row per record or per choice, contest, election or endorser compared, as each endpoint says. The columns are listed in the data dictionaries; the next page’s cursor comes in the X-Next-Cursor header and a Link header."},"x-values":"list-format","default":"json"},"example":"csv"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"issue,stance,summary,candidate.full_name"}],"responses":{"200":{"description":"A page of positions, by id. With format=csv, the same as CSV (text/csv). One row per candidate and issue.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-Next-Cursor":{"description":"format=csv: the next page’s cursor (absent on the last page).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","description":"This page.","items":{"$ref":"#/components/schemas/IssuePositionItem"}},"next_cursor":{"type":["string","null"],"description":"Pass as cursor= for the next page; null on the last page."}}},"example":{"data":[{"id":502,"issue":{"slug":"abortion","name":"Abortion"},"stance":"supports","summary":"Says abortion should stay legal and supports writing protections into state law.","quote":"Decisions about pregnancy belong to patients and their doctors.","checked_on":"2026-11-12","sources":[{"url":"https://example.com/janedoe/issues","kind":"candidate_website","publisher":"Campaign website","title":"Issues","published_on":null},{"url":"https://example.com/news/supervisor-questionnaire","kind":"questionnaire","publisher":"Example News","title":"District 8 candidate questionnaire","published_on":"2026-09-30"}],"candidate":{"id":8811,"full_name":"Jane Doe"},"contests":[{"id":4410,"title":"Member, Board of Supervisors, District 8","election":{"slug":"ca-2026-11-03-general","date":"2026-11-03"},"state":"CA"}]}],"next_cursor":"aTo1MDI"}},"text/csv":{"schema":{"type":"string"},"example":"position_id,candidate_id,candidate_name,issue,issue_name,stance,summary,quote,checked_on,source_urls,source_kinds,contest_ids\r\n502,8811,Jane Doe,abortion,Abortion,supports,Says abortion should stay legal and supports writing protections into state law.,Decisions about pregnancy belong to patients and their doctors.,2026-11-12,https://example.com/janedoe/issues; https://example.com/news/supervisor-questionnaire,candidate_website; questionnaire,4410\r\n"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/issue-positions?issues=abortion&states=CA\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst { data: positions } = await client.issuePositions.list({ issues: 'abortion', states: 'CA' });"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\npositions = client.issue_positions.list(issues=\"abortion\", states=\"CA\").data"}]}},"/v1/committee-contributions":{"get":{"operationId":"listCommitteeContributions","tags":["Candidates"],"summary":"List committee contributions","description":"Contributions from PACs, parties and other political committees to federal candidates, as filed with the Federal Election Commission (its bulk file of contributions from committees to candidates): money given, goods and services given, and party spending coordinated with a candidate. Each names the committee, the endorser it is or that sponsors it, the candidate and the filing. Only candidates on contests you can read; memo lines (money already counted on another line) are left out. Narrow by candidate, committee, endorser, type, cycle, state or amount. A contribution isn’t an endorsement.","parameters":[{"name":"candidates","in":"query","description":"Candidate ids. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"integer","minimum":1}},"style":"form","explode":false,"example":"8811"},{"name":"committees","in":"query","description":"FEC committee ids of the givers. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^C[0-9]{8}$"}},"style":"form","explode":false,"example":"C00030718"},{"name":"endorsers","in":"query","description":"Endorser slugs: contributions from their committees (their own, and PACs they sponsor). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"national-education-association"},{"name":"types","in":"query","description":"Contribution types. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["contribution","in_kind","coordinated_expenditure"],"x-enumDescriptions":{"contribution":"Money a committee gave the candidate’s campaign (FEC transaction type 24K).","in_kind":"Goods or services a committee gave the campaign, at their value (24Z).","coordinated_expenditure":"Money a party committee spent in coordination with the candidate, such as on ads (24C)."},"x-values":"contribution-type"}},"style":"form","explode":false,"example":"contribution"},{"name":"cycles","in":"query","description":"FEC cycles, by their last year: 2024 and 2026 are loaded. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"integer","minimum":2000}},"style":"form","explode":false,"example":"2026"},{"name":"min_amount","in":"query","description":"Only contributions of at least this many dollars.","schema":{"type":"number"},"example":"5000"},{"name":"states","in":"query","description":"States the contests are voted in (USPS codes). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}},"style":"form","explode":false,"example":"CA"},{"name":"limit","in":"query","description":"Results per page, 1–1000.","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"example":20},{"name":"cursor","in":"query","description":"Where the next page starts: the next_cursor from the previous page. Leave it out for the first page; it is opaque, so pass it back exactly as you got it.","schema":{"type":"string"},"example":"aTo0NDEw"},{"name":"format","in":"query","description":"json (the default) or csv: the same page as CSV, with the next page’s cursor in the X-Next-Cursor header. The data dictionaries list the columns.","schema":{"type":"string","enum":["json","csv"],"x-enumDescriptions":{"json":"The JSON response, { \"data\": [...], \"next_cursor\": \"…\" } (the default).","csv":"The same page as CSV (text/csv), one row per record or per choice, contest, election or endorser compared, as each endpoint says. The columns are listed in the data dictionaries; the next page’s cursor comes in the X-Next-Cursor header and a Link header."},"x-values":"list-format","default":"json"},"example":"csv"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"amount,date,committee.name,candidate.full_name"}],"responses":{"200":{"description":"A page of contributions, in FEC row id order. With format=csv, the same as CSV (text/csv). One row per contribution.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-Next-Cursor":{"description":"format=csv: the next page’s cursor (absent on the last page).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","description":"This page.","items":{"$ref":"#/components/schemas/CommitteeContribution"}},"next_cursor":{"type":["string","null"],"description":"Pass as cursor= for the next page; null on the last page."}}},"example":{"data":[{"id":"4041120251183915669","cycle":2026,"type":"contribution","transaction_type":"24K","amount":5000,"date":"2025-03-14","election":{"stage":"primary","year":2026},"committee":{"fec_committee_id":"C00030718","name":"NATIONAL ASSOCIATION OF REALTORS POLITICAL ACTION COMMITTEE","committee_type":"Q","connected_organization":"NATIONAL ASSOCIATION OF REALTORS","endorser":null},"candidate":{"id":9120,"full_name":"Sam Rivera","fec_candidate_id":"H6CA12093"},"recipient_committee_id":"C00912345","report_type":"M4","source_url":"https://docquery.fec.gov/cgi-bin/fecimg/?202504119755211297"}],"next_cursor":"Zjo0MDQxMTIwMjUxMTgzOTE1NjY5"}},"text/csv":{"schema":{"type":"string"},"example":"contribution_id,cycle,type,transaction_type,amount,date,election_stage,election_year,committee_fec_id,committee_name,committee_type,connected_organization,endorser,candidate_id,candidate_name,candidate_fec_id,recipient_committee_id,report_type,source_url\r\n4041120251183915669,2026,contribution,24K,5000,2025-03-14,primary,2026,C00030718,NATIONAL ASSOCIATION OF REALTORS POLITICAL ACTION COMMITTEE,Q,NATIONAL ASSOCIATION OF REALTORS,,9120,Sam Rivera,H6CA12093,C00912345,M4,https://docquery.fec.gov/cgi-bin/fecimg/?202504119755211297\r\n"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/committee-contributions?candidates=8811&min_amount=5000\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst { data: contributions } = await client.committeeContributions.list({ candidates: 8811, min_amount: 5000 });"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\ncontributions = client.committee_contributions.list(candidates=8811, min_amount=5000).data"}]}},"/v1/elections/{slug}/export":{"get":{"operationId":"exportElection","tags":["Elections"],"summary":"Download a whole election","description":"Everything you can read in one election in one response: the election, and each contest with its choices, its result once a source has one, and every endorser’s position, in ballot order. Past elections (details.historical, such as the November 5, 2024 general) export the same way. format=csv gives one row per endorsement instead, each repeating its election, contest, district, choice, the choice’s result and the endorser (contests no one endorsed in have no rows).","parameters":[{"name":"slug","in":"path","required":true,"description":"Election slug (from GET /v1/elections).","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,199}$"},"example":"ca-2026-11-03-general"},{"name":"format","in":"query","description":"json (the default) or csv.","schema":{"type":"string","enum":["json","csv"],"x-enumDescriptions":{"json":"One JSON document: the election, then every contest with its choices, result and every endorser’s position (the default).","csv":"One row per endorsement (a ranked-choice order is a row per rank), with its election, contest, district, choice and result. Contests with no endorsements have no rows."},"x-values":"export-format","default":"json"},"example":"csv"},{"name":"lang","in":"query","description":"es for Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English otherwise. Names are never translated.","schema":{"type":"string","enum":["en","es"],"x-enumDescriptions":{"en":"English (the default).","es":"Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English where it doesn’t. Names are never translated."},"x-values":"lang","default":"en"},"example":"es"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields With format=csv, fields names the CSV’s columns instead (fields=contest_title,choice_label,endorser_name), in any order; they come back in the usual column order.","schema":{"type":"string","maxLength":2000},"example":"election.slug,contests(title,choices.label)"}],"responses":{"200":{"description":"The election. With format=csv, a CSV file (text/csv) with the columns election_slug, election_date, contest_id, contest_title, contest_kind, vote_method, votes_allowed, ranks_allowed, measure_code, on_ballot, off_ballot_reason, district_id, district_name, district_level, district_ocd_id, state, choice_id, choice_label, measure_answer, candidate_id, candidate_name, party, incumbent, withdrawn, endorsement_id, endorser_id, endorser_slug, endorser_name, endorser_category, endorser_state, rank, statement, source_url, published_on, added_by, choice_votes, choice_vote_pct, choice_winner, result_status, result_source_kind, result_total_votes, result_source_url, result_source_name, first_seen_on, date_source, choice_status, party_lines.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/ElectionExport"}}},"example":{"data":{"election":{"id":3,"slug":"ca-2026-11-03-general","name":"California General Election","short_name":"General Election","date":"2026-11-03","state":"CA","type":"general","primary_system":"top_two","info_url":"https://www.sos.ca.gov/elections/upcoming-elections","details":{"all_mail":true}},"contests":[{"id":4410,"slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8","title":"Member, Board of Supervisors, District 8","short_title":"Supervisor, D8","kind":"candidate","vote_method":"ranked_choice","votes_allowed":1,"ranks_allowed":10,"measure_code":null,"description":null,"ballot_text":null,"full_text_url":null,"unopposed":false,"on_ballot":true,"off_ballot_reason":null,"ballot_order":41,"party":null,"details":{"nonpartisan":true},"source_url":"https://www.sf.gov/departments/department-elections","office":{"type":"county_legislature","level":"local","branch":"legislative"},"seat":{"slug":"ca-san-francisco-board-of-supervisors-8","name":"San Francisco Board of Supervisors, District 8","race_type":"regular","stage":"general","seats_up":1},"race_type":"regular","partisan":false,"topics":[],"district":{"id":77,"ocd_id":"ocd-division/country:us/state:ca/county:san_francisco/council_district:8","name":"San Francisco Supervisorial District 8","level":"county","type":"council","state":"CA","partisanship":{"president_2016":null,"president_2020":null,"president_2024":null},"demographics":null},"result":{"status":"unofficial","source_kind":"official","party_reported":false,"total_votes":52418,"precincts_reporting":41,"precincts_total":41,"source":{"name":"San Francisco Department of Elections","url":"https://www.sf.gov/departments/department-elections/results","contest_name":"Member, Board of Supervisors, District 8","updated_at":"2026-11-12T17:00:00-08:00"},"official_url":null,"more_sources":[],"write_in_votes":212,"blank_votes":null,"over_votes":null,"under_votes":null,"other_choices":[{"label":"Write-in","votes":212,"write_in":true}],"rcv_rounds":[{"round":1,"tallies":{"Jane Doe":24133,"Sam Rivera":21907,"Lee Park":6166},"eliminated":["Lee Park"]},{"round":2,"tallies":{"Jane Doe":27310,"Sam Rivera":23998}}],"notes":"Ranked choice: Jane Doe leads after round 2.","turnout":null,"seat_change":null,"fetched_at":"2026-11-13T06:30:12Z"},"choices":[{"id":20931,"slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8/jane-doe","label":"Jane Doe","measure_answer":null,"option":null,"ballot_designation":"Transit Planner","withdrawn":false,"status":"on_ballot","incumbent":true,"vote_meaning":null,"endorsement_count":14,"candidate":{"id":8811,"full_name":"Jane Doe","name":{"given":"Jane","middle":null,"family":"Doe","suffix":null,"nickname":null},"website_url":"https://example.com/janedoe","photo_url":null,"ids":{"fec":null,"bioguide":null},"contact":{"website":null,"email":"info@example.com","phone":null,"mailing_address":null,"social":{"facebook":"https://www.facebook.com/janedoeforsupervisor","instagram":"https://www.instagram.com/janedoesf"},"sources":[{"url":"https://example.com/janedoe","kind":"campaign_website","read_on":"2026-11-13"}]}},"party":null,"party_label":null,"party_lines":[],"result":{"votes":24133,"vote_pct":46.039,"winner":null}},{"id":20932,"slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8/sam-rivera","label":"Sam Rivera","measure_answer":null,"option":null,"ballot_designation":"Small Business Owner","withdrawn":false,"status":"on_ballot","incumbent":false,"vote_meaning":null,"endorsement_count":9,"candidate":{"id":8812,"full_name":"Sam Rivera","name":{"given":"Sam","middle":null,"family":"Rivera","suffix":null,"nickname":null},"website_url":null,"photo_url":null,"ids":{"fec":null,"bioguide":null},"contact":{"website":null,"email":null,"phone":null,"mailing_address":null,"social":{},"sources":[]}},"party":null,"party_label":null,"party_lines":[],"result":{"votes":21907,"vote_pct":41.793,"winner":null}}],"other_candidates":[{"id":311,"name":"Alex Kim","candidate_id":null,"party":null,"party_label":null,"status":"qualified","write_in":true,"status_date":"2026-10-20","votes":188,"winner":false,"note":null,"source":{"name":"San Francisco Department of Elections","url":"https://www.sf.gov/departments/department-elections/qualified-write-in-candidates","read_on":"2026-10-21"}}],"endorsements":[{"endorser":{"id":512,"slug":"sf-labor-council","name":"San Francisco Labor Council","category":{"slug":"labor","name":"Labor"},"state":"CA"},"picks":[{"endorsement_id":90211,"choice_id":20931,"choice_slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8/jane-doe","label":"Jane Doe","measure_answer":null,"rank":1,"statement":null,"source_url":"https://sflaborcouncil.org/endorsements","published_on":"2026-09-18","first_seen_on":"2026-09-18","date_source":"page","added_by":"data_load","stage":"general"},{"endorsement_id":90212,"choice_id":20932,"choice_slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8/sam-rivera","label":"Sam Rivera","measure_answer":null,"rank":2,"statement":null,"source_url":"https://sflaborcouncil.org/endorsements","published_on":"2026-09-18","first_seen_on":"2026-09-18","date_source":"page","added_by":"data_load","stage":"general"}]},{"endorser":{"id":88,"slug":"sf-chronicle","name":"San Francisco Chronicle","category":{"slug":"editorial","name":"Voter guides & editorial boards"},"state":"CA"},"picks":[{"endorsement_id":90377,"choice_id":20932,"choice_slug":"ca-2026-11-03-general/member-board-of-supervisors-district-8/sam-rivera","label":"Sam Rivera","measure_answer":null,"rank":null,"statement":"Rivera has the clearer plan for the district’s corridors.","source_url":"https://www.sfchronicle.com/opinion/endorsements","published_on":"2026-10-02","first_seen_on":"2026-10-02","date_source":"page","added_by":"automatic","stage":"general"}]}]}],"credits":"https://ballotdata.ai/credits"}}},"text/csv":{"schema":{"type":"string"},"example":"election_slug,election_date,contest_id,contest_title,contest_kind,vote_method,votes_allowed,ranks_allowed,measure_code,district_id,district_name,district_level,district_ocd_id,state,choice_id,choice_label,measure_answer,candidate_id,candidate_name,party,incumbent,withdrawn,endorsement_id,endorser_id,endorser_slug,endorser_name,endorser_category,endorser_state,rank,statement,source_url,published_on,added_by,choice_votes,choice_vote_pct,choice_winner,result_status,result_source_kind,result_total_votes,result_source_url,first_seen_on,date_source\nca-2026-11-03-general,2026-11-03,4410,\"Member, Board of Supervisors, District 8\",candidate,ranked_choice,1,10,,77,San Francisco Supervisorial District 8,county,ocd-division/country:us/state:ca/county:san_francisco/council_district:8,CA,20931,Jane Doe,,8811,Jane Doe,,true,false,90211,512,sf-labor-council,San Francisco Labor Council,labor,CA,1,,https://sflaborcouncil.org/endorsements,2026-09-18,data_load,24133,46.039,,unofficial,official,52418,https://www.sf.gov/departments/department-elections/results,2026-09-18,page\n"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/elections/ca-2026-11-03-general/export?format=csv\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst csv = await client.elections.export('ca-2026-11-03-general', { format: 'csv' });\n\n// Or the JSON, with every contest:\n// const { election, contests } = await client.elections.export('ca-2026-11-03-general');"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\ncsv = client.elections.export(\"ca-2026-11-03-general\", format=\"csv\")\n\n# Or the JSON, with every contest:\n# export = client.elections.export(\"ca-2026-11-03-general\")"}]}},"/v1/officeholders":{"get":{"operationId":"listOfficeholders","tags":["Officeholders"],"summary":"List officeholders","description":"People in office now, with party, term and contact details. Filter by state, office, level or seat (OCD id). Federal and state offices, and the D.C. Council.","parameters":[{"name":"states","in":"query","description":"USPS codes. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}},"style":"form","explode":false,"example":"CA"},{"name":"offices","in":"query","description":"Offices held. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["us_senator","us_representative","governor","lieutenant_governor","attorney_general","secretary_of_state","chief_election_officer","treasurer","auditor","state_senator","state_representative","state_legislator","city_council"],"x-enumDescriptions":{"us_senator":"U.S. Senator.","us_representative":"U.S. Representative, or a non-voting delegate.","governor":"Governor (or D.C.’s mayor).","lieutenant_governor":"Lieutenant governor.","attorney_general":"State attorney general.","secretary_of_state":"Secretary of state.","chief_election_officer":"The state’s chief election officer, where that isn’t the secretary of state.","treasurer":"State treasurer.","auditor":"State auditor or comptroller.","state_senator":"State senator (upper house).","state_representative":"State representative, assemblymember or delegate (lower house).","state_legislator":"A member of a one-house legislature (Nebraska).","city_council":"A member of the Council of the District of Columbia."},"x-values":"officeholder-office"}},"style":"form","explode":false,"example":"us_senator,governor"},{"name":"levels","in":"query","description":"Levels of office: federal, state, or city (the D.C. Council). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["federal","state","city"],"x-enumDescriptions":{"federal":"Congress.","state":"A statewide office or the state legislature.","city":"The Council of the District of Columbia."},"x-values":"officeholder-level"}},"style":"form","explode":false,"example":"federal"},{"name":"districts","in":"query","description":"OCD division ids of the seats. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"ocd-division/country:us/state:ca/sldl:17"},{"name":"q","in":"query","description":"Name contains (case-insensitive, up to 100 characters).","schema":{"type":"string","maxLength":100},"example":"morgan"},{"name":"lang","in":"query","description":"es for Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English otherwise. Names are never translated.","schema":{"type":"string","enum":["en","es"],"x-enumDescriptions":{"en":"English (the default).","es":"Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English where it doesn’t. Names are never translated."},"x-values":"lang","default":"en"},"example":"es"},{"name":"limit","in":"query","description":"Results per page, 1–500.","schema":{"type":"integer","minimum":1,"maximum":500,"default":100},"example":20},{"name":"cursor","in":"query","description":"Where the next page starts: the next_cursor from the previous page. Leave it out for the first page; it is opaque, so pass it back exactly as you got it.","schema":{"type":"string"},"example":"aTo0NDEw"},{"name":"format","in":"query","description":"json (the default) or csv: the same page as CSV, with the next page’s cursor in the X-Next-Cursor header. The data dictionaries list the columns.","schema":{"type":"string","enum":["json","csv"],"x-enumDescriptions":{"json":"The JSON response, { \"data\": [...], \"next_cursor\": \"…\" } (the default).","csv":"The same page as CSV (text/csv), one row per record or per choice, contest, election or endorser compared, as each endpoint says. The columns are listed in the data dictionaries; the next page’s cursor comes in the X-Next-Cursor header and a Link header."},"x-values":"list-format","default":"json"},"example":"csv"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"name,office_title,party,email"}],"responses":{"200":{"description":"A page of officeholders. With format=csv, the same as CSV (text/csv). One row per officeholder and seat.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-Next-Cursor":{"description":"format=csv: the next page’s cursor (absent on the last page).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","description":"This page.","items":{"$ref":"#/components/schemas/Officeholder"}},"next_cursor":{"type":["string","null"],"description":"Pass as cursor= for the next page; null on the last page."}}},"example":{"data":[{"person_id":"4f6a2c1e-8b3d-4e5f-9a7b-1c2d3e4f5a6b","name":"Alex Morgan","given_name":"Alex","family_name":"Morgan","office":"state_representative","office_title":"Assemblymember","level":"state","state":"CA","district":"17","district_ocd_id":"ocd-division/country:us/state:ca/sldl:17","district_id":1203,"party":"Democratic","party_abbreviation":"DEM","term_start":"2024-12-02","term_end":"2026-11-30","email":"assemblymember.morgan@example.gov","phone":"916-555-0117","website_url":"https://example.gov/morgan","image_url":null,"offices":[{"classification":"capitol","address":"1021 O Street, Sacramento, CA 95814","voice":"916-555-0117"}],"social":{"twitter":"AsmMorgan"},"source_urls":["https://www.assembly.ca.gov/assemblymembers"],"updated_at":"2026-10-12T08:00:00Z"}],"next_cursor":"aToxMjA0"}},"text/csv":{"schema":{"type":"string"},"example":"person_id,name,given_name,family_name,office,office_title,level,state,district,district_ocd_id,party,party_abbreviation,term_start,term_end,email,phone,website_url,source_urls,updated_at\r\n4f6a2c1e-8b3d-4e5f-9a7b-1c2d3e4f5a6b,Alex Morgan,Alex,Morgan,state_representative,Assemblymember,state,CA,17,ocd-division/country:us/state:ca/sldl:17,Democratic,DEM,2024-12-02,2026-11-30,assemblymember.morgan@example.gov,916-555-0117,https://example.gov/morgan,https://www.assembly.ca.gov/assemblymembers,2026-10-12T08:00:00Z\r\n"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/Unavailable"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/officeholders?states=CA&offices=state_representative\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst { data: officeholders } = await client.officeholders.list({ states: 'CA', offices: 'state_representative' });"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nofficeholders = client.officeholders.list(states=\"CA\", offices=\"state_representative\").data"}]}},"/v1/officeholders/{id}":{"get":{"operationId":"getOfficeholder","tags":["Officeholders"],"summary":"Get an officeholder","description":"One officeholder by person_id, with every seat they hold.","parameters":[{"name":"id","in":"path","required":true,"description":"The officeholder’s person_id (from GET /v1/officeholders).","schema":{"type":"string","format":"uuid"},"example":"4f6a2c1e-8b3d-4e5f-9a7b-1c2d3e4f5a6b"},{"name":"lang","in":"query","description":"es for Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English otherwise. Names are never translated.","schema":{"type":"string","enum":["en","es"],"x-enumDescriptions":{"en":"English (the default).","es":"Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English where it doesn’t. Names are never translated."},"x-values":"lang","default":"en"},"example":"es"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"name,office_title,party,phone,website_url"}],"responses":{"200":{"description":"The officeholder.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/OfficeholderDetail"}}},"example":{"data":{"person_id":"4f6a2c1e-8b3d-4e5f-9a7b-1c2d3e4f5a6b","name":"Alex Morgan","given_name":"Alex","family_name":"Morgan","office":"state_representative","office_title":"Assemblymember","level":"state","state":"CA","district":"17","district_ocd_id":"ocd-division/country:us/state:ca/sldl:17","district_id":1203,"party":"Democratic","party_abbreviation":"DEM","term_start":"2024-12-02","term_end":"2026-11-30","email":"assemblymember.morgan@example.gov","phone":"916-555-0117","website_url":"https://example.gov/morgan","image_url":null,"offices":[{"classification":"capitol","address":"1021 O Street, Sacramento, CA 95814","voice":"916-555-0117"}],"social":{"twitter":"AsmMorgan"},"source_urls":["https://www.assembly.ca.gov/assemblymembers"],"updated_at":"2026-10-12T08:00:00Z","seats":[{"person_id":"4f6a2c1e-8b3d-4e5f-9a7b-1c2d3e4f5a6b","name":"Alex Morgan","given_name":"Alex","family_name":"Morgan","office":"state_representative","office_title":"Assemblymember","level":"state","state":"CA","district":"17","district_ocd_id":"ocd-division/country:us/state:ca/sldl:17","district_id":1203,"party":"Democratic","party_abbreviation":"DEM","term_start":"2024-12-02","term_end":"2026-11-30","email":"assemblymember.morgan@example.gov","phone":"916-555-0117","website_url":"https://example.gov/morgan","image_url":null,"offices":[{"classification":"capitol","address":"1021 O Street, Sacramento, CA 95814","voice":"916-555-0117"}],"social":{"twitter":"AsmMorgan"},"source_urls":["https://www.assembly.ca.gov/assemblymembers"],"updated_at":"2026-10-12T08:00:00Z"}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/Unavailable"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/officeholders/4f6a2c1e-8b3d-4e5f-9a7b-1c2d3e4f5a6b\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst officeholder = await client.officeholders.get('4f6a2c1e-8b3d-4e5f-9a7b-1c2d3e4f5a6b');"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nofficeholder = client.officeholders.get(\"4f6a2c1e-8b3d-4e5f-9a7b-1c2d3e4f5a6b\")"}]}},"/v1/offices":{"get":{"operationId":"listOffices","tags":["Offices"],"summary":"List offices","description":"Seats that last across elections: the U.S. House seat for California’s 12th district, a governorship, a numbered city council position, an at-large school board. Each lists its district versions across redistricting and who holds it now. Filter by state, level, office type, district (any version) or name.","parameters":[{"name":"states","in":"query","description":"USPS codes. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}},"style":"form","explode":false,"example":"CA"},{"name":"levels","in":"query","description":"federal, state or local. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["federal","state","local"],"x-enumDescriptions":{"federal":"President, U.S. Senate and U.S. House.","state":"Statewide offices, state legislatures and state appellate courts.","local":"Counties, cities, school districts, special districts and trial courts."},"x-values":"office-record-level"}},"style":"form","explode":false,"example":"federal"},{"name":"office_types","in":"query","description":"Office types. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["president","us_senator","us_representative","governor","lieutenant_governor","attorney_general","secretary_of_state","state_treasurer","state_auditor","state_superintendent","insurance_commissioner","agriculture_commissioner","land_commissioner","labor_commissioner","utility_commission","university_board","state_board_of_education","state_senator","state_representative","state_supreme_court","state_appellate_court","trial_court","municipal_court","magistrate","justice_of_the_peace","court_clerk","mayor","local_executive","city_council","county_legislature","neighborhood_council","school_board","school_superintendent","college_board","special_district_board","water_conservation_board","sheriff","prosecutor","coroner","constable","assessor","tax_collector","treasurer","auditor","recorder","clerk","surveyor","public_works","police_fire","other_county_office","other"],"x-enumDescriptions":{"president":"President of the United States (with the vice president on the same ticket).","us_senator":"U.S. Senator.","us_representative":"U.S. Representative, or a non-voting delegate to the House.","governor":"Governor.","lieutenant_governor":"Lieutenant governor.","attorney_general":"State attorney general.","secretary_of_state":"Secretary of state.","state_treasurer":"State treasurer.","state_auditor":"State auditor, comptroller or controller.","state_superintendent":"State superintendent of public instruction (the elected head of state schools).","insurance_commissioner":"State insurance commissioner.","agriculture_commissioner":"State agriculture commissioner.","land_commissioner":"State land commissioner (public lands).","labor_commissioner":"State labor commissioner.","utility_commission":"A state utility, public service or corporation commission seat.","university_board":"A state university board of regents or trustees seat.","state_board_of_education":"A state board of education seat.","state_senator":"State senator (the upper house of the legislature; Nebraska’s one-house Legislature too).","state_representative":"State representative, assemblymember or delegate (the lower house).","state_supreme_court":"A justice of the state’s highest court.","state_appellate_court":"A judge of a state intermediate appeals court.","trial_court":"A judge of a general trial court: superior, district, circuit, county or probate court.","municipal_court":"A city or municipal court judge.","magistrate":"A magistrate.","justice_of_the_peace":"A justice of the peace.","court_clerk":"Clerk of a court.","mayor":"Mayor.","local_executive":"Another elected local chief executive: county executive or judge-executive, borough or parish president, first selectman, town or township supervisor, village president.","city_council":"A city, town, village or borough council, select board or board of aldermen seat.","county_legislature":"A county commission, board of supervisors, county council, quorum or fiscal court, or police jury seat.","neighborhood_council":"A neighborhood body: Washington, D.C.’s Advisory Neighborhood Commissions, for example.","school_board":"A school board or board of education seat.","school_superintendent":"An elected county or district school superintendent.","college_board":"A community college district board seat.","special_district_board":"A board of a special district: hospital, fire, park, library, transit, port, utility and similar.","water_conservation_board":"A soil and water conservation, water, irrigation, drainage or flood control district board.","sheriff":"Sheriff.","prosecutor":"District attorney, state’s attorney, county attorney or solicitor.","coroner":"Coroner or medical examiner.","constable":"Constable (or town sergeant).","assessor":"Assessor, appraiser or property valuation administrator.","tax_collector":"Tax collector or tax commissioner.","treasurer":"A county, city or town treasurer.","auditor":"A county, city or town auditor, comptroller or controller.","recorder":"Recorder or register of deeds, wills or probate.","clerk":"A county, city or town clerk, prothonotary or registrar.","surveyor":"County surveyor or engineer.","public_works":"Highway, road or street commissioner, or a public works office.","police_fire":"An elected police chief, fire chief or marshal.","other_county_office":"Another county office: public defender, public administrator, jailer, election director and similar.","other":"An office that fits none of the types above."},"x-values":"office-type"}},"style":"form","explode":false,"example":"us_representative,governor"},{"name":"districts","in":"query","description":"OCD division ids: seats elected on any of them, under any redistricting plan. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"ocd-division/country:us/state:ca/cd:12"},{"name":"q","in":"query","description":"Name contains (case-insensitive, up to 100 characters).","schema":{"type":"string","maxLength":100},"example":"governor"},{"name":"limit","in":"query","description":"Results per page, 1–500.","schema":{"type":"integer","minimum":1,"maximum":500,"default":100},"example":20},{"name":"cursor","in":"query","description":"Where the next page starts: the next_cursor from the previous page. Leave it out for the first page; it is opaque, so pass it back exactly as you got it.","schema":{"type":"string"},"example":"aTo0NDEw"},{"name":"format","in":"query","description":"json (the default) or csv: the same page as CSV, with the next page’s cursor in the X-Next-Cursor header. The data dictionaries list the columns.","schema":{"type":"string","enum":["json","csv"],"x-enumDescriptions":{"json":"The JSON response, { \"data\": [...], \"next_cursor\": \"…\" } (the default).","csv":"The same page as CSV (text/csv), one row per record or per choice, contest, election or endorser compared, as each endpoint says. The columns are listed in the data dictionaries; the next page’s cursor comes in the X-Next-Cursor header and a Link header."},"x-values":"list-format","default":"json"},"example":"csv"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"slug,name,current_holders.name"}],"responses":{"200":{"description":"A page of offices. With format=csv, the same as CSV (text/csv). One row per office (seat). District versions and current holders are joined with \"; \".","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-Next-Cursor":{"description":"format=csv: the next page’s cursor (absent on the last page).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","description":"This page.","items":{"$ref":"#/components/schemas/OfficeRecord"}},"next_cursor":{"type":["string","null"],"description":"Pass as cursor= for the next page; null on the last page."}}},"example":{"data":[{"slug":"us-house-ca-12","name":"U.S. Representative, California District 12","office_type":"us_representative","level":"federal","branch":"legislative","state":"CA","jurisdiction_ocd_id":"ocd-division/country:us/state:ca/cd:12","seat_label":null,"seats":1,"term_years":2,"partisan":true,"established_on":null,"abolished_on":null,"successor":null,"districts":[{"ocd_id":"ocd-division/country:us/state:ca/cd:12/plan:2020","district_id":388,"plan":"2020","valid_from":"2013-01-03","valid_to":"2023-01-03"},{"ocd_id":"ocd-division/country:us/state:ca/cd:12","district_id":412,"plan":null,"valid_from":"2023-01-03","valid_to":null}],"current_holders":[{"name":"Alex Morgan","person_key":"bioguide:M000001","party":"Democratic","how":"elected","start_date":"2025-01-03","scheduled_end_date":"2027-01-03"}],"updated_at":"2026-11-14T03:00:00Z"}],"next_cursor":"aTo0MTc"}},"text/csv":{"schema":{"type":"string"},"example":"slug,name,office_type,level,branch,state,jurisdiction_ocd_id,seat_label,seats,term_years,partisan,established_on,abolished_on,successor,district_ocd_ids,district_plans,current_holders,current_holder_parties,updated_at\r\nus-house-ca-12,\"U.S. Representative, California District 12\",us_representative,federal,legislative,CA,ocd-division/country:us/state:ca/cd:12,,1,2,true,,,,ocd-division/country:us/state:ca/cd:12/plan:2020; ocd-division/country:us/state:ca/cd:12,2020,Alex Morgan,Democratic,2026-11-14T03:00:00Z\r\n"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/Unavailable"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/offices?states=CA&office_types=us_representative\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst { data: offices } = await client.offices.list({ states: 'CA', office_types: 'us_representative' });"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\noffices = client.offices.list(states=\"CA\", office_types=\"us_representative\").data"}]}},"/v1/offices/{slug}":{"get":{"operationId":"getOffice","tags":["Offices"],"summary":"Get an office","description":"One seat by slug, with every term we have (who held it, from when to when, how they got it and how it ended) and every contest for it, each with whether the seat changed hands.","parameters":[{"name":"slug","in":"path","required":true,"description":"The office’s slug (from GET /v1/offices or a contest’s seat.slug).","schema":{"type":"string"},"example":"us-house-ca-12"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"slug,name,terms(name,party,start_date,end_date)"}],"responses":{"200":{"description":"The office.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/OfficeDetail"}}},"example":{"data":{"slug":"us-house-ca-12","name":"U.S. Representative, California District 12","office_type":"us_representative","level":"federal","branch":"legislative","state":"CA","jurisdiction_ocd_id":"ocd-division/country:us/state:ca/cd:12","seat_label":null,"seats":1,"term_years":2,"partisan":true,"established_on":null,"abolished_on":null,"successor":null,"districts":[{"ocd_id":"ocd-division/country:us/state:ca/cd:12/plan:2020","district_id":388,"plan":"2020","valid_from":"2013-01-03","valid_to":"2023-01-03"},{"ocd_id":"ocd-division/country:us/state:ca/cd:12","district_id":412,"plan":null,"valid_from":"2023-01-03","valid_to":null}],"current_holders":[{"name":"Alex Morgan","person_key":"bioguide:M000001","party":"Democratic","how":"elected","start_date":"2025-01-03","scheduled_end_date":"2027-01-03"}],"updated_at":"2026-11-14T03:00:00Z","terms":[{"id":903,"office":"us-house-ca-12","office_name":"U.S. Representative, California District 12","state":"CA","name":"Alex Morgan","person_key":"bioguide:M000001","candidate_id":7710,"bioguide_id":"M000001","openstates_person_id":null,"party":"Democratic","party_changes":[],"how":"elected","start_date":"2023-01-03","end_date":"2025-01-03","scheduled_end_date":"2025-01-03","end_reason":"term_ended","dates_basis":"statutory","election_date":"2022-11-08","contest_id":61022,"district_ocd_id":"ocd-division/country:us/state:ca/cd:12","district_id":412,"source":{"kind":"results","name":"California Secretary of State","url":"https://www.sos.ca.gov/elections/prior-elections/statewide-election-results","license":null,"retrieved_on":null},"updated_at":"2026-11-14T03:00:00Z"},{"id":904,"office":"us-house-ca-12","office_name":"U.S. Representative, California District 12","state":"CA","name":"Alex Morgan","person_key":"bioguide:M000001","candidate_id":7710,"bioguide_id":"M000001","openstates_person_id":null,"party":"Democratic","party_changes":[],"how":"elected","start_date":"2025-01-03","end_date":null,"scheduled_end_date":"2027-01-03","end_reason":null,"dates_basis":"statutory","election_date":"2024-11-05","contest_id":4120,"district_ocd_id":"ocd-division/country:us/state:ca/cd:12","district_id":412,"source":{"kind":"results","name":"California Secretary of State","url":"https://www.sos.ca.gov/elections/prior-elections/statewide-election-results","license":null,"retrieved_on":null},"updated_at":"2026-11-14T03:00:00Z"}],"contests":[{"id":61022,"title":"United States Representative, District 12","election":"ca-2022-11-08-general","election_date":"2022-11-08","race_type":"regular","stage":"general","seats_up":1,"result_status":"certified","seat_change":{"office":"us-house-ca-12","outcome":"open_seat","partisan":true,"flipped":false,"holders_going_in":[{"name":"Robin Lee","party":"Democratic","how":"elected","start_date":"2021-01-03"}],"parties_going_in":["Democratic"],"winner_parties":["Democratic"],"incumbents_up":1,"incumbents_reelected":0,"incumbents_defeated":0,"open_seats":1,"vacant_since":null}},{"id":4120,"title":"United States Representative, District 12","election":"ca-2024-11-05-general","election_date":"2024-11-05","race_type":"regular","stage":"general","seats_up":1,"result_status":"certified","seat_change":{"office":"us-house-ca-12","outcome":"incumbent_reelected","partisan":true,"flipped":false,"holders_going_in":[{"name":"Alex Morgan","party":"Democratic","how":"elected","start_date":"2023-01-03"}],"parties_going_in":["Democratic"],"winner_parties":["Democratic"],"incumbents_up":1,"incumbents_reelected":1,"incumbents_defeated":0,"open_seats":0,"vacant_since":null}}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/Unavailable"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/offices/us-house-ca-12\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst office = await client.offices.get('us-house-ca-12');"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\noffice = client.offices.get(\"us-house-ca-12\")"}]}},"/v1/office-terms":{"get":{"operationId":"listOfficeTerms","tags":["Offices"],"summary":"List office terms","description":"Terms in office since 2020: who held which seat, from when to when, how they got it (elected, special election, appointed, succeeded) and how it ended. on= lists who held office on one day; person= lists one person’s terms.","parameters":[{"name":"states","in":"query","description":"USPS codes. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}},"style":"form","explode":false,"example":"CA"},{"name":"levels","in":"query","description":"federal, state or local. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["federal","state","local"],"x-enumDescriptions":{"federal":"President, U.S. Senate and U.S. House.","state":"Statewide offices, state legislatures and state appellate courts.","local":"Counties, cities, school districts, special districts and trial courts."},"x-values":"office-record-level"}},"style":"form","explode":false,"example":"state"},{"name":"office_types","in":"query","description":"Office types. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["president","us_senator","us_representative","governor","lieutenant_governor","attorney_general","secretary_of_state","state_treasurer","state_auditor","state_superintendent","insurance_commissioner","agriculture_commissioner","land_commissioner","labor_commissioner","utility_commission","university_board","state_board_of_education","state_senator","state_representative","state_supreme_court","state_appellate_court","trial_court","municipal_court","magistrate","justice_of_the_peace","court_clerk","mayor","local_executive","city_council","county_legislature","neighborhood_council","school_board","school_superintendent","college_board","special_district_board","water_conservation_board","sheriff","prosecutor","coroner","constable","assessor","tax_collector","treasurer","auditor","recorder","clerk","surveyor","public_works","police_fire","other_county_office","other"],"x-enumDescriptions":{"president":"President of the United States (with the vice president on the same ticket).","us_senator":"U.S. Senator.","us_representative":"U.S. Representative, or a non-voting delegate to the House.","governor":"Governor.","lieutenant_governor":"Lieutenant governor.","attorney_general":"State attorney general.","secretary_of_state":"Secretary of state.","state_treasurer":"State treasurer.","state_auditor":"State auditor, comptroller or controller.","state_superintendent":"State superintendent of public instruction (the elected head of state schools).","insurance_commissioner":"State insurance commissioner.","agriculture_commissioner":"State agriculture commissioner.","land_commissioner":"State land commissioner (public lands).","labor_commissioner":"State labor commissioner.","utility_commission":"A state utility, public service or corporation commission seat.","university_board":"A state university board of regents or trustees seat.","state_board_of_education":"A state board of education seat.","state_senator":"State senator (the upper house of the legislature; Nebraska’s one-house Legislature too).","state_representative":"State representative, assemblymember or delegate (the lower house).","state_supreme_court":"A justice of the state’s highest court.","state_appellate_court":"A judge of a state intermediate appeals court.","trial_court":"A judge of a general trial court: superior, district, circuit, county or probate court.","municipal_court":"A city or municipal court judge.","magistrate":"A magistrate.","justice_of_the_peace":"A justice of the peace.","court_clerk":"Clerk of a court.","mayor":"Mayor.","local_executive":"Another elected local chief executive: county executive or judge-executive, borough or parish president, first selectman, town or township supervisor, village president.","city_council":"A city, town, village or borough council, select board or board of aldermen seat.","county_legislature":"A county commission, board of supervisors, county council, quorum or fiscal court, or police jury seat.","neighborhood_council":"A neighborhood body: Washington, D.C.’s Advisory Neighborhood Commissions, for example.","school_board":"A school board or board of education seat.","school_superintendent":"An elected county or district school superintendent.","college_board":"A community college district board seat.","special_district_board":"A board of a special district: hospital, fire, park, library, transit, port, utility and similar.","water_conservation_board":"A soil and water conservation, water, irrigation, drainage or flood control district board.","sheriff":"Sheriff.","prosecutor":"District attorney, state’s attorney, county attorney or solicitor.","coroner":"Coroner or medical examiner.","constable":"Constable (or town sergeant).","assessor":"Assessor, appraiser or property valuation administrator.","tax_collector":"Tax collector or tax commissioner.","treasurer":"A county, city or town treasurer.","auditor":"A county, city or town auditor, comptroller or controller.","recorder":"Recorder or register of deeds, wills or probate.","clerk":"A county, city or town clerk, prothonotary or registrar.","surveyor":"County surveyor or engineer.","public_works":"Highway, road or street commissioner, or a public works office.","police_fire":"An elected police chief, fire chief or marshal.","other_county_office":"Another county office: public defender, public administrator, jailer, election director and similar.","other":"An office that fits none of the types above."},"x-values":"office-type"}},"style":"form","explode":false,"example":"governor"},{"name":"offices","in":"query","description":"Office slugs. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"}},"style":"form","explode":false,"example":"us-house-ca-12"},{"name":"on","in":"query","description":"Only terms in office on this day.","schema":{"type":"string","format":"date"},"example":"2021-06-01"},{"name":"since","in":"query","description":"Only terms that ended on or after this day, or are still going.","schema":{"type":"string","format":"date"},"example":"2020-01-01"},{"name":"person","in":"query","description":"One person’s terms, by person_key.","schema":{"type":"string"},"example":"bioguide:P000197"},{"name":"hows","in":"query","description":"How the terms began. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["elected","special_election","appointed","succeeded","retained","holdover","other"],"x-enumDescriptions":{"elected":"Won a regular election for a full term.","special_election":"Won a special election for the rest of an unexpired term.","appointed":"Appointed to fill a vacancy (by a governor, a board or a council).","succeeded":"Took over by law, such as a lieutenant governor becoming governor.","retained":"A judge who kept the seat in a retention vote.","holdover":"Stayed on past the end of the term until a successor took office.","other":"Any other way; the source explains."},"x-values":"term-how"}},"style":"form","explode":false,"example":"appointed"},{"name":"q","in":"query","description":"Holder’s name contains (case-insensitive, up to 100 characters).","schema":{"type":"string","maxLength":100},"example":"morgan"},{"name":"limit","in":"query","description":"Results per page, 1–500.","schema":{"type":"integer","minimum":1,"maximum":500,"default":100},"example":20},{"name":"cursor","in":"query","description":"Where the next page starts: the next_cursor from the previous page. Leave it out for the first page; it is opaque, so pass it back exactly as you got it.","schema":{"type":"string"},"example":"aTo0NDEw"},{"name":"format","in":"query","description":"json (the default) or csv: the same page as CSV, with the next page’s cursor in the X-Next-Cursor header. The data dictionaries list the columns.","schema":{"type":"string","enum":["json","csv"],"x-enumDescriptions":{"json":"The JSON response, { \"data\": [...], \"next_cursor\": \"…\" } (the default).","csv":"The same page as CSV (text/csv), one row per record or per choice, contest, election or endorser compared, as each endpoint says. The columns are listed in the data dictionaries; the next page’s cursor comes in the X-Next-Cursor header and a Link header."},"x-values":"list-format","default":"json"},"example":"csv"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"name,party,start_date,end_date"}],"responses":{"200":{"description":"A page of terms. With format=csv, the same as CSV (text/csv). One row per term: one person in one seat for one term.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-Next-Cursor":{"description":"format=csv: the next page’s cursor (absent on the last page).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","description":"This page.","items":{"$ref":"#/components/schemas/OfficeTerm"}},"next_cursor":{"type":["string","null"],"description":"Pass as cursor= for the next page; null on the last page."}}},"example":{"data":[{"id":903,"office":"us-house-ca-12","office_name":"U.S. Representative, California District 12","state":"CA","name":"Alex Morgan","person_key":"bioguide:M000001","candidate_id":7710,"bioguide_id":"M000001","openstates_person_id":null,"party":"Democratic","party_changes":[],"how":"elected","start_date":"2023-01-03","end_date":"2025-01-03","scheduled_end_date":"2025-01-03","end_reason":"term_ended","dates_basis":"statutory","election_date":"2022-11-08","contest_id":61022,"district_ocd_id":"ocd-division/country:us/state:ca/cd:12","district_id":412,"source":{"kind":"results","name":"California Secretary of State","url":"https://www.sos.ca.gov/elections/prior-elections/statewide-election-results","license":null,"retrieved_on":null},"updated_at":"2026-11-14T03:00:00Z"},{"id":904,"office":"us-house-ca-12","office_name":"U.S. Representative, California District 12","state":"CA","name":"Alex Morgan","person_key":"bioguide:M000001","candidate_id":7710,"bioguide_id":"M000001","openstates_person_id":null,"party":"Democratic","party_changes":[],"how":"elected","start_date":"2025-01-03","end_date":null,"scheduled_end_date":"2027-01-03","end_reason":null,"dates_basis":"statutory","election_date":"2024-11-05","contest_id":4120,"district_ocd_id":"ocd-division/country:us/state:ca/cd:12","district_id":412,"source":{"kind":"results","name":"California Secretary of State","url":"https://www.sos.ca.gov/elections/prior-elections/statewide-election-results","license":null,"retrieved_on":null},"updated_at":"2026-11-14T03:00:00Z"}],"next_cursor":"aTo5MDQ"}},"text/csv":{"schema":{"type":"string"},"example":"term_id,office,office_name,state,name,person_key,candidate_id,bioguide_id,openstates_person_id,party,how,start_date,end_date,scheduled_end_date,end_reason,dates_basis,election_date,contest_id,district_ocd_id,district_id,source_kind,source_name,source_url,license,updated_at\r\n903,us-house-ca-12,\"U.S. Representative, California District 12\",CA,Alex Morgan,bioguide:M000001,7710,M000001,,Democratic,elected,2023-01-03,2025-01-03,2025-01-03,term_ended,statutory,2022-11-08,61022,ocd-division/country:us/state:ca/cd:12,412,results,California Secretary of State,https://www.sos.ca.gov/elections/prior-elections/statewide-election-results,,2026-11-14T03:00:00Z\r\n904,us-house-ca-12,\"U.S. Representative, California District 12\",CA,Alex Morgan,bioguide:M000001,7710,M000001,,Democratic,elected,2025-01-03,,2027-01-03,,statutory,2024-11-05,4120,ocd-division/country:us/state:ca/cd:12,412,results,California Secretary of State,https://www.sos.ca.gov/elections/prior-elections/statewide-election-results,,2026-11-14T03:00:00Z\r\n"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/Unavailable"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/office-terms?states=CA&on=2021-06-01\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst { data: terms } = await client.officeTerms.list({ states: 'CA', on: '2021-06-01' });"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nterms = client.office_terms.list(states=\"CA\", on=\"2021-06-01\").data"}]}},"/v1/results":{"get":{"operationId":"listResults","tags":["Contests"],"summary":"List results","description":"Who won each contest, by how much, and whether the seat changed hands: one compact row per contest with a result, with its winners, every choice’s votes, the deciding margin, the source and the seat change. Filter by election, year, stage, state, office or seat, by the result’s status or source, by whether it is decided, by margin (close races) and by seat change (flipped seats, seats a party gained or lost, defeated incumbents). GET /v1/contests/{id} has a contest’s full result and endorsements.","parameters":[{"name":"elections","in":"query","description":"Election slugs (GET /v1/elections). A date and type (2026-11-03-general) matches every election of that type that day nationwide, and a bare date (2026-11-03) every election that day. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"ca-2026-11-03-general"},{"name":"years","in":"query","description":"Election years. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"integer","minimum":2000,"maximum":2099}},"style":"form","explode":false,"example":"2024"},{"name":"stages","in":"query","description":"Election stages: general (including specials), primary or runoff. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["general","primary","runoff"],"x-enumDescriptions":{"general":"A general, special or consolidated election: it fills the office or decides the measure.","primary":"A primary or special primary: it nominates, or in top-two states picks who goes on to the general.","runoff":"A runoff between the leading candidates of an earlier round."},"x-values":"election-stage"}},"style":"form","explode":false,"example":"general"},{"name":"states","in":"query","description":"States the contests are voted in (USPS codes). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}},"style":"form","explode":false,"example":"CA"},{"name":"levels","in":"query","description":"Levels of the contest’s district, from federal down to school and special districts. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["federal","state","county","city","school","special"],"x-enumDescriptions":{"federal":"The whole country, or a U.S. House district.","state":"A whole state, or a state legislative, judicial or other state district.","county":"A county (a parish in Louisiana, a borough in Alaska) or a district within one.","city":"A city, town, township, village or borough, or a ward or council district within one.","school":"A school district, community college district, or a trustee area within one.","special":"A special district: water, fire, hospital, park, transit, port, conservation and the like."},"x-values":"district-level"}},"style":"form","explode":false,"example":"county,city"},{"name":"contest_kinds","in":"query","description":"Contest kinds: candidate (an office), measure, or retention (whether to keep a judge). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["candidate","measure","retention"],"x-enumDescriptions":{"candidate":"A race for an office: voters choose among candidates.","measure":"A ballot measure (proposition, amendment, bond, tax, referendum or initiative): voters answer Yes or No.","retention":"A judicial retention question: should this judge stay in office? Voters answer Yes or No."},"x-values":"contest-kind"}},"style":"form","explode":false,"example":"measure"},{"name":"districts","in":"query","description":"OCD division ids of the contests’ districts. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"ocd-division/country:us/state:ca/county:san_francisco"},{"name":"offices","in":"query","description":"Only contests for these offices (Office.type): us_representative, governor, mayor, school_board, … Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["president","us_senator","us_representative","governor","lieutenant_governor","attorney_general","secretary_of_state","state_treasurer","state_auditor","state_superintendent","insurance_commissioner","agriculture_commissioner","land_commissioner","labor_commissioner","utility_commission","university_board","state_board_of_education","state_senator","state_representative","state_supreme_court","state_appellate_court","trial_court","municipal_court","magistrate","justice_of_the_peace","court_clerk","mayor","local_executive","city_council","county_legislature","neighborhood_council","school_board","school_superintendent","college_board","special_district_board","water_conservation_board","sheriff","prosecutor","coroner","constable","assessor","tax_collector","treasurer","auditor","recorder","clerk","surveyor","public_works","police_fire","other_county_office","other"],"x-enumDescriptions":{"president":"President of the United States (with the vice president on the same ticket).","us_senator":"U.S. Senator.","us_representative":"U.S. Representative, or a non-voting delegate to the House.","governor":"Governor.","lieutenant_governor":"Lieutenant governor.","attorney_general":"State attorney general.","secretary_of_state":"Secretary of state.","state_treasurer":"State treasurer.","state_auditor":"State auditor, comptroller or controller.","state_superintendent":"State superintendent of public instruction (the elected head of state schools).","insurance_commissioner":"State insurance commissioner.","agriculture_commissioner":"State agriculture commissioner.","land_commissioner":"State land commissioner (public lands).","labor_commissioner":"State labor commissioner.","utility_commission":"A state utility, public service or corporation commission seat.","university_board":"A state university board of regents or trustees seat.","state_board_of_education":"A state board of education seat.","state_senator":"State senator (the upper house of the legislature; Nebraska’s one-house Legislature too).","state_representative":"State representative, assemblymember or delegate (the lower house).","state_supreme_court":"A justice of the state’s highest court.","state_appellate_court":"A judge of a state intermediate appeals court.","trial_court":"A judge of a general trial court: superior, district, circuit, county or probate court.","municipal_court":"A city or municipal court judge.","magistrate":"A magistrate.","justice_of_the_peace":"A justice of the peace.","court_clerk":"Clerk of a court.","mayor":"Mayor.","local_executive":"Another elected local chief executive: county executive or judge-executive, borough or parish president, first selectman, town or township supervisor, village president.","city_council":"A city, town, village or borough council, select board or board of aldermen seat.","county_legislature":"A county commission, board of supervisors, county council, quorum or fiscal court, or police jury seat.","neighborhood_council":"A neighborhood body: Washington, D.C.’s Advisory Neighborhood Commissions, for example.","school_board":"A school board or board of education seat.","school_superintendent":"An elected county or district school superintendent.","college_board":"A community college district board seat.","special_district_board":"A board of a special district: hospital, fire, park, library, transit, port, utility and similar.","water_conservation_board":"A soil and water conservation, water, irrigation, drainage or flood control district board.","sheriff":"Sheriff.","prosecutor":"District attorney, state’s attorney, county attorney or solicitor.","coroner":"Coroner or medical examiner.","constable":"Constable (or town sergeant).","assessor":"Assessor, appraiser or property valuation administrator.","tax_collector":"Tax collector or tax commissioner.","treasurer":"A county, city or town treasurer.","auditor":"A county, city or town auditor, comptroller or controller.","recorder":"Recorder or register of deeds, wills or probate.","clerk":"A county, city or town clerk, prothonotary or registrar.","surveyor":"County surveyor or engineer.","public_works":"Highway, road or street commissioner, or a public works office.","police_fire":"An elected police chief, fire chief or marshal.","other_county_office":"Another county office: public defender, public administrator, jailer, election director and similar.","other":"An office that fits none of the types above."},"x-values":"office-type"}},"style":"form","explode":false,"example":"us_representative"},{"name":"seats","in":"query","description":"Only contests for these seats (office slugs from GET /v1/offices). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"}},"style":"form","explode":false,"example":"us-house-ca-45"},{"name":"result_statuses","in":"query","description":"Only results with one of these statuses: unofficial (counts still changing) or certified. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["unofficial","certified"],"x-enumDescriptions":{"unofficial":"Election-night and canvass counts: still changing. We read them again every day until they’re certified.","certified":"The canvass is certified: the final official count."},"x-values":"result-status"}},"style":"form","explode":false,"example":"certified"},{"name":"source_kinds","in":"query","description":"Only results from these kinds of source: official, compiled, party or reported. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["official","compiled","party","reported"],"x-enumDescriptions":{"official":"A state, county, city or federal election office.","compiled":"Certified official returns compiled by a research group (the MIT Election Data and Science Lab’s precinct returns), summed to the contest. Used for past elections; official_url links to the state’s own results where we have them.","party":"A state or national party’s announcement of the winner, with no vote counts (party_reported is true). Replaced as soon as an official result appears.","reported":"Read from a page that reports the result: a news story calling the race, a candidate’s concession, a results post. Status is always unofficial; vote counts and shares only as the page printed them, often none. Two independent AI readers must agree on it, or a person must check it, before it is kept. Used only where no official, compiled or party result exists, and replaced as soon as an official result appears."},"x-values":"result-source-kind"}},"style":"form","explode":false,"example":"official,compiled"},{"name":"decided","in":"query","description":"true for only results that name a winner; false for only those that don’t yet. Leave it out for both.","schema":{"type":"boolean"},"example":true},{"name":"max_margin_pct","in":"query","description":"Only results whose deciding margin is at most this many percentage points: close races.","schema":{"type":"number","minimum":0,"maximum":100},"example":2},{"name":"flipped","in":"query","description":"true for only seats that changed party; false for only partisan seats that didn’t. Leave it out for both (and for nonpartisan seats).","schema":{"type":"boolean"},"example":true},{"name":"seat_outcomes","in":"query","description":"Only contests with these seat outcomes. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["incumbent_reelected","incumbent_defeated","open_seat","new_seat","unknown","incumbents_reelected","mixed"],"x-enumDescriptions":{"incumbent_reelected":"The person who held the seat going in won.","incumbent_defeated":"The person who held the seat going in ran and lost.","open_seat":"The person who held the seat going in didn’t run, or the seat was vacant.","new_seat":"The seat didn’t exist before this election.","unknown":"We don’t yet know who held the seat going in.","incumbents_reelected":"A body electing several members: every winner held a seat going in.","mixed":"A body electing several members: some winners are new; the counts say how many."},"x-values":"seat-outcome"}},"style":"form","explode":false,"example":"incumbent_defeated"},{"name":"flipped_to","in":"query","description":"Party slugs: only seats that flipped to any of these parties. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","x-enumDescriptions":{"conservative":"Conservative (CON).","constitution":"Constitution (CON).","dc-statehood-green":"DC Statehood Green (STG).","democratic":"Democratic (DEM).","green":"Green (GRN).","independent-american":"Independent American (IAP).","independent-party":"Independent Party (IP).","independent-party-of-delaware":"Independent Party of Delaware (IPD).","independent-party-of-oregon":"Independent Party of Oregon (IPO).","legal-marijuana-now":"Legal Marijuana NOW (LMN).","libertarian":"Libertarian (LIB).","pacific-green":"Pacific Green (PGP).","progressive":"Progressive (PRO).","progressive-party-of-oregon":"Progressive Party (PRO).","republican":"Republican (REP).","working-families":"Working Families (WFP)."},"x-values":"party"}},"style":"form","explode":false,"example":"democratic"},{"name":"flipped_from","in":"query","description":"Party slugs: only seats that flipped away from any of these parties. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","x-enumDescriptions":{"conservative":"Conservative (CON).","constitution":"Constitution (CON).","dc-statehood-green":"DC Statehood Green (STG).","democratic":"Democratic (DEM).","green":"Green (GRN).","independent-american":"Independent American (IAP).","independent-party":"Independent Party (IP).","independent-party-of-delaware":"Independent Party of Delaware (IPD).","independent-party-of-oregon":"Independent Party of Oregon (IPO).","legal-marijuana-now":"Legal Marijuana NOW (LMN).","libertarian":"Libertarian (LIB).","pacific-green":"Pacific Green (PGP).","progressive":"Progressive (PRO).","progressive-party-of-oregon":"Progressive Party (PRO).","republican":"Republican (REP).","working-families":"Working Families (WFP)."},"x-values":"party"}},"style":"form","explode":false,"example":"republican"},{"name":"q","in":"query","description":"Contest title contains (case-insensitive, up to 100 characters).","schema":{"type":"string","maxLength":100},"example":"District 45"},{"name":"lang","in":"query","description":"es for Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English otherwise. Names are never translated.","schema":{"type":"string","enum":["en","es"],"x-enumDescriptions":{"en":"English (the default).","es":"Spanish ballot text (titles, choices, measure text, statements) where the state publishes it; English where it doesn’t. Names are never translated."},"x-values":"lang","default":"en"},"example":"es"},{"name":"limit","in":"query","description":"Results per page, 1–200.","schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"example":20},{"name":"cursor","in":"query","description":"Where the next page starts: the next_cursor from the previous page. Leave it out for the first page; it is opaque, so pass it back exactly as you got it.","schema":{"type":"string"},"example":"aTo0NDEw"},{"name":"format","in":"query","description":"json (the default) or csv: the same page as CSV, with the next page’s cursor in the X-Next-Cursor header. The data dictionaries list the columns.","schema":{"type":"string","enum":["json","csv"],"x-enumDescriptions":{"json":"The JSON response, { \"data\": [...], \"next_cursor\": \"…\" } (the default).","csv":"The same page as CSV (text/csv), one row per record or per choice, contest, election or endorser compared, as each endpoint says. The columns are listed in the data dictionaries; the next page’s cursor comes in the X-Next-Cursor header and a Link header."},"x-values":"list-format","default":"json"},"example":"csv"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"title,status,winners,choices(label,votes,vote_pct)"}],"responses":{"200":{"description":"A page of results, by contest id. With format=csv, the same as CSV (text/csv). One row per contest with a result. Winners and their parties are joined with \"; \"; the margin is between the last winning place and the next.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"X-Next-Cursor":{"description":"format=csv: the next page’s cursor (absent on the last page).","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","description":"This page.","items":{"$ref":"#/components/schemas/Result"}},"next_cursor":{"type":["string","null"],"description":"Pass as cursor= for the next page; null on the last page."}}},"example":{"data":[{"contest_id":44017,"title":"United States Representative, District 45","kind":"candidate","vote_method":"plurality","votes_allowed":1,"ranks_allowed":null,"measure_code":null,"office":{"type":"us_representative","level":"federal","branch":"legislative"},"seat":{"slug":"us-house-ca-45","name":"U.S. Representative, California District 45","race_type":"regular","stage":"general","seats_up":1},"race_type":"regular","partisan":true,"unopposed":false,"on_ballot":true,"off_ballot_reason":null,"district":{"id":74427,"ocd_id":"ocd-division/country:us/state:ca/cd:45/plan:2024","name":"California Congressional District 45 (2024 lines)","level":"federal","type":"congressional","state":"CA"},"election":{"slug":"ca-2024-11-05-general","name":"California General Election","date":"2024-11-05","type":"general","stage":"general"},"status":"certified","source_kind":"compiled","party_reported":false,"decided":true,"total_votes":315738,"precincts_reporting":null,"precincts_total":null,"winners":[{"choice_id":201553,"label":"Derek Tran","measure_answer":null,"candidate_id":394,"party":"Democratic","votes":158216,"vote_pct":50.11,"winner":true}],"margin":{"votes":694,"pct_points":0.22,"ahead":"Derek Tran","behind":"Michelle Steel","winning_places":1},"choices":[{"choice_id":201553,"label":"Derek Tran","measure_answer":null,"candidate_id":394,"party":"Democratic","votes":158216,"vote_pct":50.11,"winner":true},{"choice_id":201470,"label":"Michelle Steel","measure_answer":null,"candidate_id":73275,"party":"Republican","votes":157522,"vote_pct":49.89,"winner":false}],"source":{"name":"MIT Election Data and Science Lab, from official returns","url":"https://dataverse.harvard.edu/file.xhtml?fileId=13731130","contest_name":"US HOUSE|045","updated_at":null},"official_url":null,"seat_change":{"office":"us-house-ca-45","outcome":"incumbent_defeated","partisan":true,"flipped":true,"holders_going_in":[{"name":"Michelle Steel","party":"Republican","how":"elected","start_date":"2023-01-03"}],"parties_going_in":["Republican"],"winner_parties":["Democratic"],"incumbents_up":1,"incumbents_reelected":0,"incumbents_defeated":1,"open_seats":0,"vacant_since":null},"fetched_at":"2026-11-13T01:03:57.092Z"}],"next_cursor":"aTo0NDAxNw"}},"text/csv":{"schema":{"type":"string"},"example":"contest_id,contest_title,contest_kind,vote_method,votes_allowed,office_type,office_level,seat,race_type,partisan,unopposed,on_ballot,off_ballot_reason,election_slug,election_date,election_stage,state,district_ocd_id,district_name,status,source_kind,decided,total_votes,winners,winner_parties,winner_votes,winner_vote_pcts,margin_votes,margin_pct_points,margin_ahead,margin_behind,seat_outcome,seat_flipped,parties_going_in,source_name,source_url,official_url,fetched_at\r\n44017,\"United States Representative, District 45\",candidate,plurality,1,us_representative,federal,us-house-ca-45,regular,true,false,true,,ca-2024-11-05-general,2024-11-05,general,CA,ocd-division/country:us/state:ca/cd:45/plan:2024,California Congressional District 45 (2024 lines),certified,compiled,true,315738,Derek Tran,Democratic,158216,50.11,694,0.22,Derek Tran,Michelle Steel,incumbent_defeated,true,Republican,\"MIT Election Data and Science Lab, from official returns\",https://dataverse.harvard.edu/file.xhtml?fileId=13731130,,2026-11-13T01:03:57.092Z\r\n"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/Unavailable"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/results?years=2024&offices=us_representative&flipped=true\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst { data: flips } = await client.results.list({ years: '2024', offices: 'us_representative', flipped: true });"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nflips = client.results.list(years=\"2024\", offices=\"us_representative\", flipped=True).data"}]}},"/v1/seat-changes":{"get":{"operationId":"getSeatChanges","tags":["Offices"],"summary":"Count seat changes","description":"How many seats changed hands in a set of decided contests: incumbents re-elected or defeated, open seats, flipped partisan seats, and each party’s seats held going in, won, gained, lost and net. Takes the same filters as GET /v1/results; group_by splits the counts by state, office type, election or stage. GET /v1/results with flipped=true lists the contests behind the counts.","parameters":[{"name":"elections","in":"query","description":"Election slugs (GET /v1/elections). A date and type (2026-11-03-general) matches every election of that type that day nationwide, and a bare date (2026-11-03) every election that day. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"ca-2026-11-03-general"},{"name":"years","in":"query","description":"Election years. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"integer","minimum":2000,"maximum":2099}},"style":"form","explode":false,"example":"2024"},{"name":"stages","in":"query","description":"Election stages: general (including specials), primary or runoff. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["general","primary","runoff"],"x-enumDescriptions":{"general":"A general, special or consolidated election: it fills the office or decides the measure.","primary":"A primary or special primary: it nominates, or in top-two states picks who goes on to the general.","runoff":"A runoff between the leading candidates of an earlier round."},"x-values":"election-stage"}},"style":"form","explode":false,"example":"general"},{"name":"states","in":"query","description":"States the contests are voted in (USPS codes). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}},"style":"form","explode":false,"example":"CA"},{"name":"levels","in":"query","description":"Levels of the contest’s district, from federal down to school and special districts. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["federal","state","county","city","school","special"],"x-enumDescriptions":{"federal":"The whole country, or a U.S. House district.","state":"A whole state, or a state legislative, judicial or other state district.","county":"A county (a parish in Louisiana, a borough in Alaska) or a district within one.","city":"A city, town, township, village or borough, or a ward or council district within one.","school":"A school district, community college district, or a trustee area within one.","special":"A special district: water, fire, hospital, park, transit, port, conservation and the like."},"x-values":"district-level"}},"style":"form","explode":false,"example":"county,city"},{"name":"contest_kinds","in":"query","description":"Contest kinds: candidate (an office), measure, or retention (whether to keep a judge). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["candidate","measure","retention"],"x-enumDescriptions":{"candidate":"A race for an office: voters choose among candidates.","measure":"A ballot measure (proposition, amendment, bond, tax, referendum or initiative): voters answer Yes or No.","retention":"A judicial retention question: should this judge stay in office? Voters answer Yes or No."},"x-values":"contest-kind"}},"style":"form","explode":false,"example":"measure"},{"name":"districts","in":"query","description":"OCD division ids of the contests’ districts. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"ocd-division/country:us/state:ca/county:san_francisco"},{"name":"offices","in":"query","description":"Only contests for these offices (Office.type). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["president","us_senator","us_representative","governor","lieutenant_governor","attorney_general","secretary_of_state","state_treasurer","state_auditor","state_superintendent","insurance_commissioner","agriculture_commissioner","land_commissioner","labor_commissioner","utility_commission","university_board","state_board_of_education","state_senator","state_representative","state_supreme_court","state_appellate_court","trial_court","municipal_court","magistrate","justice_of_the_peace","court_clerk","mayor","local_executive","city_council","county_legislature","neighborhood_council","school_board","school_superintendent","college_board","special_district_board","water_conservation_board","sheriff","prosecutor","coroner","constable","assessor","tax_collector","treasurer","auditor","recorder","clerk","surveyor","public_works","police_fire","other_county_office","other"],"x-enumDescriptions":{"president":"President of the United States (with the vice president on the same ticket).","us_senator":"U.S. Senator.","us_representative":"U.S. Representative, or a non-voting delegate to the House.","governor":"Governor.","lieutenant_governor":"Lieutenant governor.","attorney_general":"State attorney general.","secretary_of_state":"Secretary of state.","state_treasurer":"State treasurer.","state_auditor":"State auditor, comptroller or controller.","state_superintendent":"State superintendent of public instruction (the elected head of state schools).","insurance_commissioner":"State insurance commissioner.","agriculture_commissioner":"State agriculture commissioner.","land_commissioner":"State land commissioner (public lands).","labor_commissioner":"State labor commissioner.","utility_commission":"A state utility, public service or corporation commission seat.","university_board":"A state university board of regents or trustees seat.","state_board_of_education":"A state board of education seat.","state_senator":"State senator (the upper house of the legislature; Nebraska’s one-house Legislature too).","state_representative":"State representative, assemblymember or delegate (the lower house).","state_supreme_court":"A justice of the state’s highest court.","state_appellate_court":"A judge of a state intermediate appeals court.","trial_court":"A judge of a general trial court: superior, district, circuit, county or probate court.","municipal_court":"A city or municipal court judge.","magistrate":"A magistrate.","justice_of_the_peace":"A justice of the peace.","court_clerk":"Clerk of a court.","mayor":"Mayor.","local_executive":"Another elected local chief executive: county executive or judge-executive, borough or parish president, first selectman, town or township supervisor, village president.","city_council":"A city, town, village or borough council, select board or board of aldermen seat.","county_legislature":"A county commission, board of supervisors, county council, quorum or fiscal court, or police jury seat.","neighborhood_council":"A neighborhood body: Washington, D.C.’s Advisory Neighborhood Commissions, for example.","school_board":"A school board or board of education seat.","school_superintendent":"An elected county or district school superintendent.","college_board":"A community college district board seat.","special_district_board":"A board of a special district: hospital, fire, park, library, transit, port, utility and similar.","water_conservation_board":"A soil and water conservation, water, irrigation, drainage or flood control district board.","sheriff":"Sheriff.","prosecutor":"District attorney, state’s attorney, county attorney or solicitor.","coroner":"Coroner or medical examiner.","constable":"Constable (or town sergeant).","assessor":"Assessor, appraiser or property valuation administrator.","tax_collector":"Tax collector or tax commissioner.","treasurer":"A county, city or town treasurer.","auditor":"A county, city or town auditor, comptroller or controller.","recorder":"Recorder or register of deeds, wills or probate.","clerk":"A county, city or town clerk, prothonotary or registrar.","surveyor":"County surveyor or engineer.","public_works":"Highway, road or street commissioner, or a public works office.","police_fire":"An elected police chief, fire chief or marshal.","other_county_office":"Another county office: public defender, public administrator, jailer, election director and similar.","other":"An office that fits none of the types above."},"x-values":"office-type"}},"style":"form","explode":false,"example":"us_representative"},{"name":"seats","in":"query","description":"Only contests for these seats (office slugs). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[a-z0-9]+(-[a-z0-9]+)*$"}},"style":"form","explode":false,"example":"us-house-ca-45"},{"name":"result_statuses","in":"query","description":"Only results with one of these statuses. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["unofficial","certified"],"x-enumDescriptions":{"unofficial":"Election-night and canvass counts: still changing. We read them again every day until they’re certified.","certified":"The canvass is certified: the final official count."},"x-values":"result-status"}},"style":"form","explode":false,"example":"certified"},{"name":"source_kinds","in":"query","description":"Only results from these kinds of source. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["official","compiled","party","reported"],"x-enumDescriptions":{"official":"A state, county, city or federal election office.","compiled":"Certified official returns compiled by a research group (the MIT Election Data and Science Lab’s precinct returns), summed to the contest. Used for past elections; official_url links to the state’s own results where we have them.","party":"A state or national party’s announcement of the winner, with no vote counts (party_reported is true). Replaced as soon as an official result appears.","reported":"Read from a page that reports the result: a news story calling the race, a candidate’s concession, a results post. Status is always unofficial; vote counts and shares only as the page printed them, often none. Two independent AI readers must agree on it, or a person must check it, before it is kept. Used only where no official, compiled or party result exists, and replaced as soon as an official result appears."},"x-values":"result-source-kind"}},"style":"form","explode":false,"example":"official,compiled"},{"name":"flipped","in":"query","description":"true to count only seats that changed party; false for only those that didn’t.","schema":{"type":"boolean"},"example":true},{"name":"seat_outcomes","in":"query","description":"Only contests with these seat outcomes. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["incumbent_reelected","incumbent_defeated","open_seat","new_seat","unknown","incumbents_reelected","mixed"],"x-enumDescriptions":{"incumbent_reelected":"The person who held the seat going in won.","incumbent_defeated":"The person who held the seat going in ran and lost.","open_seat":"The person who held the seat going in didn’t run, or the seat was vacant.","new_seat":"The seat didn’t exist before this election.","unknown":"We don’t yet know who held the seat going in.","incumbents_reelected":"A body electing several members: every winner held a seat going in.","mixed":"A body electing several members: some winners are new; the counts say how many."},"x-values":"seat-outcome"}},"style":"form","explode":false,"example":"incumbent_defeated"},{"name":"flipped_to","in":"query","description":"Party slugs: only seats that flipped to any of these parties. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","x-enumDescriptions":{"conservative":"Conservative (CON).","constitution":"Constitution (CON).","dc-statehood-green":"DC Statehood Green (STG).","democratic":"Democratic (DEM).","green":"Green (GRN).","independent-american":"Independent American (IAP).","independent-party":"Independent Party (IP).","independent-party-of-delaware":"Independent Party of Delaware (IPD).","independent-party-of-oregon":"Independent Party of Oregon (IPO).","legal-marijuana-now":"Legal Marijuana NOW (LMN).","libertarian":"Libertarian (LIB).","pacific-green":"Pacific Green (PGP).","progressive":"Progressive (PRO).","progressive-party-of-oregon":"Progressive Party (PRO).","republican":"Republican (REP).","working-families":"Working Families (WFP)."},"x-values":"party"}},"style":"form","explode":false,"example":"democratic"},{"name":"flipped_from","in":"query","description":"Party slugs: only seats that flipped away from any of these parties. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","x-enumDescriptions":{"conservative":"Conservative (CON).","constitution":"Constitution (CON).","dc-statehood-green":"DC Statehood Green (STG).","democratic":"Democratic (DEM).","green":"Green (GRN).","independent-american":"Independent American (IAP).","independent-party":"Independent Party (IP).","independent-party-of-delaware":"Independent Party of Delaware (IPD).","independent-party-of-oregon":"Independent Party of Oregon (IPO).","legal-marijuana-now":"Legal Marijuana NOW (LMN).","libertarian":"Libertarian (LIB).","pacific-green":"Pacific Green (PGP).","progressive":"Progressive (PRO).","progressive-party-of-oregon":"Progressive Party (PRO).","republican":"Republican (REP).","working-families":"Working Families (WFP)."},"x-values":"party"}},"style":"form","explode":false,"example":"republican"},{"name":"q","in":"query","description":"Contest title contains (case-insensitive, up to 100 characters).","schema":{"type":"string","maxLength":100},"example":"Representative"},{"name":"group_by","in":"query","description":"Also count each group separately: state, office_type, election or stage.","schema":{"type":"string","enum":["state","office_type","election","stage"],"x-enumDescriptions":{"state":"One group per state (USPS code).","office_type":"One group per office type, such as us_representative or state_senator.","election":"One group per election (its slug).","stage":"One group per election stage: general or runoff (primaries don’t fill seats)."},"x-values":"seat-change-group"},"example":"state"},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"totals,groups.group"}],"responses":{"200":{"description":"The counts.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/SeatChangeSummary"}}},"example":{"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}]}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/Unavailable"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/seat-changes?years=2024&offices=us_representative&group_by=state\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst { totals, groups } = await client.seatChanges.get({ years: '2024', offices: 'us_representative', group_by: 'state' });"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nchanges = client.seat_changes.get(years=\"2024\", offices=\"us_representative\", group_by=\"state\")"}]}},"/v1/stream":{"get":{"operationId":"streamEvents","tags":["Stream"],"summary":"Stream endorsement changes (SSE)","description":"Every endorsement change matching a subscription or inline filter, as Server-Sent Events, within seconds of it happening. Events: ready (first, with the subscription name), endorsement (an Event), checkpoint (moves your position past changes your filter skipped), reconnect (we end connections after an hour), and error (cursor_expired). A comment line arrives every 20 seconds.\n\nEach event id is a cursor: reconnect with Last-Event-ID (EventSource does this itself) or ?cursor= to continue. Cursors work on /v1/events too. Without one you start at the newest change (from=latest); from=earliest or since= start further back. A cursor older than the stream keeps (7 days, at most 50,000 changes) ends the stream with an error event, cursor_expired, or gets 410 before it opens. There is no limit on how many streams you hold open.\n\nThe Endorsement Stream ends at the close of December 31, 2027 (Pacific).","parameters":[{"name":"subscription","in":"query","description":"A saved subscription’s id or name (GET /v1/subscriptions). Use it instead of the filter parameters below, not together with them.","schema":{"type":"string","maxLength":100},"example":"CA labor"},{"name":"categories","in":"query","description":"Endorser category slugs (GET /v1/endorser-categories). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","x-enumDescriptions":{"editorial":"Voter guides & editorial boards: each one a voter guide.","labor":"Labor: each one a labor union.","environment":"Environment & transportation: each one a environmental group.","business":"Housing & business: each one a housing or business group.","party":"Political parties: each one a political party.","club":"Political clubs: each one a political club.","community":"Community & advocacy: each one a community group.","officials":"Elected officials: each one a elected official."},"x-values":"endorser-category"}},"style":"form","explode":false,"example":"labor"},{"name":"endorsers","in":"query","description":"Endorser slugs (GET /v1/endorsers). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"sf-labor-council"},{"name":"endorser_states","in":"query","description":"Endorsers’ home states (USPS codes), or national for endorsers with none. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"CA,national"},{"name":"states","in":"query","description":"States the contests are voted in (USPS codes). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}},"style":"form","explode":false,"example":"CA"},{"name":"elections","in":"query","description":"Election slugs (GET /v1/elections). A date and type (2026-11-03-general) matches every election of that type that day nationwide, and a bare date (2026-11-03) every election that day. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"ca-2026-11-03-general"},{"name":"contest_kinds","in":"query","description":"Contest kinds: candidate (an office), measure, or retention (whether to keep a judge). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["candidate","measure","retention"],"x-enumDescriptions":{"candidate":"A race for an office: voters choose among candidates.","measure":"A ballot measure (proposition, amendment, bond, tax, referendum or initiative): voters answer Yes or No.","retention":"A judicial retention question: should this judge stay in office? Voters answer Yes or No."},"x-values":"contest-kind"}},"style":"form","explode":false,"example":"measure"},{"name":"levels","in":"query","description":"Levels of the contest’s district, from federal down to school and special districts. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["federal","state","county","city","school","special"],"x-enumDescriptions":{"federal":"The whole country, or a U.S. House district.","state":"A whole state, or a state legislative, judicial or other state district.","county":"A county (a parish in Louisiana, a borough in Alaska) or a district within one.","city":"A city, town, township, village or borough, or a ward or council district within one.","school":"A school district, community college district, or a trustee area within one.","special":"A special district: water, fire, hospital, park, transit, port, conservation and the like."},"x-values":"district-level"}},"style":"form","explode":false,"example":"county,city"},{"name":"types","in":"query","description":"Kinds of change: created (a new endorsement), updated (one that changed) or deleted (one withdrawn or removed). All three by default. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["created","updated","deleted"],"x-enumDescriptions":{"created":"A new endorsement.","updated":"An existing endorsement changed; changed lists the fields.","deleted":"The endorsement was withdrawn by the endorser or removed by us."},"x-values":"change"}},"style":"form","explode":false,"example":"created,updated"},{"name":"cursor","in":"query","description":"Resume after this position: a next_cursor from /v1/events or an event id from /v1/stream (either works on both). Also read from the Last-Event-ID header. Takes precedence over since and from. Opaque; valid for 7 days.","schema":{"type":"string"},"example":"c1.eyJzIjp7IjAiOiIxODM0MSJ9fQ"},{"name":"from","in":"query","description":"Where to start without a cursor or since: latest (only changes from now on) or earliest (the oldest change the stream still holds, up to 7 days back).","schema":{"type":"string","enum":["latest","earliest"],"x-enumDescriptions":{"latest":"Only changes from now on (the default).","earliest":"The oldest change the stream still holds, up to 7 days back."},"x-values":"stream-from","default":"latest"},"example":"earliest"},{"name":"since","in":"query","description":"Start at the first change at or after this time (ISO 8601). Must be within the last 7 days, or you get 410 cursor_expired. Use instead of cursor.","schema":{"type":"string","format":"date-time"},"example":"2026-10-27T00:00:00Z"}],"responses":{"200":{"description":"An open event stream.","content":{"text/event-stream":{"schema":{"type":"string"},"example":"retry: 5000\n\nid: c1.eyJzIjp7IjAiOiIxODM0MSJ9fQ\nevent: ready\ndata: {\"subscription\":\"CA labor\"}\n\nid: c1.eyJzIjp7IjAiOiIxODM0MiJ9fQ\nevent: endorsement\ndata: {\"id\":\"18342\",\"type\":\"endorsement.created\",\"occurred_at\":\"2026-10-14T21:07:33.512Z\",\"endorsement\":{\"id\":90211,\"rank\":1,\"statement\":null,\"source_url\":\"https://sflaborcouncil.org/endorsements\",\"published_on\":\"2026-09-18\",\"added_by\":\"data_load\"},\"changed\":[],\"previous\":null,\"endorser\":{\"id\":512,\"slug\":\"sf-labor-council\",\"name\":\"San Francisco Labor Council\",\"category\":{\"slug\":\"labor\",\"name\":\"Labor\"},\"state\":\"CA\"},\"contest\":{\"id\":4410,\"title\":\"Member, Board of Supervisors, District 8\",\"short_title\":\"Supervisor, D8\",\"kind\":\"candidate\",\"vote_method\":\"ranked_choice\",\"votes_allowed\":1,\"ranks_allowed\":10,\"measure_code\":null,\"district\":{\"id\":77,\"name\":\"San Francisco Supervisorial District 8\",\"level\":\"county\",\"ocd_id\":\"ocd-division/country:us/state:ca/county:san_francisco/council_district:8\",\"state\":\"CA\"}},\"election\":{\"id\":3,\"slug\":\"ca-2026-11-03-general\",\"name\":\"California General Election\",\"date\":\"2026-11-03\",\"state\":\"CA\",\"type\":\"general\"},\"choice\":{\"id\":20931,\"label\":\"Jane Doe\",\"measure_answer\":null,\"candidate\":{\"id\":8811,\"full_name\":\"Jane Doe\"},\"party\":null,\"withdrawn\":false,\"incumbent\":true}}\n\n: ping\n\nid: c1.eyJzIjp7IjAiOiIxODM1MCJ9fQ\nevent: checkpoint\ndata: {}\n"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"410":{"$ref":"#/components/responses/Gone"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/Unavailable"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl -N \"https://api.ballotdata.ai/v1/stream?subscription=CA%20labor\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\n\n// Reconnects by itself and resumes from the last event. Save the cursor to\n// pick up where you stopped after a restart.\nconst stream = client.stream.connect(\n  { subscription: 'CA labor', cursor: await loadCursor() },\n  { onCursor: (cursor) => saveCursor(cursor) },\n);\nfor await (const message of stream) {\n  if (message.type === 'endorsement') console.log(message.event);\n}"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\n\n# Reconnects by itself and resumes from the last event. Save the cursor to\n# pick up where you stopped after a restart.\nwith client.stream.connect(subscription=\"CA labor\", cursor=load_cursor(), on_cursor=save_cursor) as stream:\n    for message in stream:\n        if message.type == \"endorsement\":\n            print(message.event)"}]}},"/v1/events":{"get":{"operationId":"pollEvents","tags":["Stream"],"summary":"Poll endorsement changes","description":"The same changes as GET /v1/stream, a page at a time, for servers that can’t hold a connection open (cron jobs, serverless functions, strict firewalls). Each response has the changes after your cursor that match your filter, oldest first, and a next_cursor (even when there are none): store it and send it as cursor next time. has_more means more are waiting, so call again right away. wait (up to 25 seconds) holds a request with nothing new open until a matching change arrives (long polling).\n\nWithout a cursor you start at the newest change (from=latest); from=earliest or since= start further back. Cursors work on /v1/stream too. A cursor older than the stream keeps (7 days, at most 50,000 changes) gets 410 cursor_expired: catch up with GET /v1/endorsements, then start again with from=latest.\n\nThe Endorsement Stream ends at the close of December 31, 2027 (Pacific).","parameters":[{"name":"subscription","in":"query","description":"A saved subscription’s id or name (GET /v1/subscriptions). Use it instead of the filter parameters below, not together with them.","schema":{"type":"string","maxLength":100},"example":"CA labor"},{"name":"categories","in":"query","description":"Endorser category slugs (GET /v1/endorser-categories). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","x-enumDescriptions":{"editorial":"Voter guides & editorial boards: each one a voter guide.","labor":"Labor: each one a labor union.","environment":"Environment & transportation: each one a environmental group.","business":"Housing & business: each one a housing or business group.","party":"Political parties: each one a political party.","club":"Political clubs: each one a political club.","community":"Community & advocacy: each one a community group.","officials":"Elected officials: each one a elected official."},"x-values":"endorser-category"}},"style":"form","explode":false,"example":"labor"},{"name":"endorsers","in":"query","description":"Endorser slugs (GET /v1/endorsers). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"sf-labor-council"},{"name":"endorser_states","in":"query","description":"Endorsers’ home states (USPS codes), or national for endorsers with none. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"CA,national"},{"name":"states","in":"query","description":"States the contests are voted in (USPS codes). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","pattern":"^[A-Z]{2}$","description":"USPS state code.","examples":["CA"]}},"style":"form","explode":false,"example":"CA"},{"name":"elections","in":"query","description":"Election slugs (GET /v1/elections). A date and type (2026-11-03-general) matches every election of that type that day nationwide, and a bare date (2026-11-03) every election that day. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string"}},"style":"form","explode":false,"example":"ca-2026-11-03-general"},{"name":"contest_kinds","in":"query","description":"Contest kinds: candidate (an office), measure, or retention (whether to keep a judge). Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["candidate","measure","retention"],"x-enumDescriptions":{"candidate":"A race for an office: voters choose among candidates.","measure":"A ballot measure (proposition, amendment, bond, tax, referendum or initiative): voters answer Yes or No.","retention":"A judicial retention question: should this judge stay in office? Voters answer Yes or No."},"x-values":"contest-kind"}},"style":"form","explode":false,"example":"measure"},{"name":"levels","in":"query","description":"Levels of the contest’s district, from federal down to school and special districts. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["federal","state","county","city","school","special"],"x-enumDescriptions":{"federal":"The whole country, or a U.S. House district.","state":"A whole state, or a state legislative, judicial or other state district.","county":"A county (a parish in Louisiana, a borough in Alaska) or a district within one.","city":"A city, town, township, village or borough, or a ward or council district within one.","school":"A school district, community college district, or a trustee area within one.","special":"A special district: water, fire, hospital, park, transit, port, conservation and the like."},"x-values":"district-level"}},"style":"form","explode":false,"example":"county,city"},{"name":"types","in":"query","description":"Kinds of change: created (a new endorsement), updated (one that changed) or deleted (one withdrawn or removed). All three by default. Comma-separated (up to 200 values); any of them matches.","schema":{"type":"array","items":{"type":"string","enum":["created","updated","deleted"],"x-enumDescriptions":{"created":"A new endorsement.","updated":"An existing endorsement changed; changed lists the fields.","deleted":"The endorsement was withdrawn by the endorser or removed by us."},"x-values":"change"}},"style":"form","explode":false,"example":"created,updated"},{"name":"cursor","in":"query","description":"Resume after this position: a next_cursor from /v1/events or an event id from /v1/stream (either works on both). Also read from the Last-Event-ID header. Takes precedence over since and from. Opaque; valid for 7 days.","schema":{"type":"string"},"example":"c1.eyJzIjp7IjAiOiIxODM0MSJ9fQ"},{"name":"from","in":"query","description":"Where to start without a cursor or since: latest (only changes from now on) or earliest (the oldest change the stream still holds, up to 7 days back).","schema":{"type":"string","enum":["latest","earliest"],"x-enumDescriptions":{"latest":"Only changes from now on (the default).","earliest":"The oldest change the stream still holds, up to 7 days back."},"x-values":"stream-from","default":"latest"},"example":"earliest"},{"name":"since","in":"query","description":"Start at the first change at or after this time (ISO 8601). Must be within the last 7 days, or you get 410 cursor_expired. Use instead of cursor.","schema":{"type":"string","format":"date-time"},"example":"2026-10-27T00:00:00Z"},{"name":"limit","in":"query","description":"Events per page, 1–1000. has_more in the response says more are waiting.","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"example":500},{"name":"wait","in":"query","description":"Seconds to hold the request open when nothing new matches (long polling), 0–25. 0 answers at once.","schema":{"type":"integer","minimum":0,"maximum":25,"default":0},"example":20},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"id,type,occurred_at,endorser.slug,choice.label"}],"responses":{"200":{"description":"Events and the next cursor.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data","next_cursor","has_more"],"properties":{"data":{"type":"array","description":"Changes, oldest first.","items":{"$ref":"#/components/schemas/Event"}},"next_cursor":{"type":"string","description":"Send as cursor= next time."},"has_more":{"type":"boolean","description":"More are waiting: call again now."}}},"example":{"data":[{"id":"18342","type":"endorsement.created","occurred_at":"2026-10-14T21:07:33.512Z","endorsement":{"id":90211,"rank":1,"statement":null,"source_url":"https://sflaborcouncil.org/endorsements","published_on":"2026-09-18","added_by":"data_load"},"changed":[],"previous":null,"endorser":{"id":512,"slug":"sf-labor-council","name":"San Francisco Labor Council","category":{"slug":"labor","name":"Labor"},"state":"CA"},"contest":{"id":4410,"title":"Member, Board of Supervisors, District 8","short_title":"Supervisor, D8","kind":"candidate","vote_method":"ranked_choice","votes_allowed":1,"ranks_allowed":10,"measure_code":null,"district":{"id":77,"name":"San Francisco Supervisorial District 8","level":"county","ocd_id":"ocd-division/country:us/state:ca/county:san_francisco/council_district:8","state":"CA"}},"election":{"id":3,"slug":"ca-2026-11-03-general","name":"California General Election","date":"2026-11-03","state":"CA","type":"general"},"choice":{"id":20931,"label":"Jane Doe","measure_answer":null,"candidate":{"id":8811,"full_name":"Jane Doe"},"party":null,"withdrawn":false,"incumbent":true}}],"next_cursor":"c1.eyJzIjp7IjAiOiIxODM0MiJ9fQ","has_more":false}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"410":{"$ref":"#/components/responses/Gone"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/Unavailable"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/events?subscription=CA+labor&cursor=c1.eyJzIjp7IjAiOiIxODM0MSJ9fQ&wait=20\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst page = await client.events.list({ subscription: 'CA labor', cursor: 'c1.eyJzIjp7IjAiOiIxODM0MSJ9fQ', wait: 20 });\n// page.data, then page.next_cursor next time\n\n// Or follow changes for good, polling as you go:\n// for await (const { event, cursor } of client.events.follow({ subscription: 'CA labor' })) { … }"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\npage = client.events.list(subscription=\"CA labor\", cursor=\"c1.eyJzIjp7IjAiOiIxODM0MSJ9fQ\", wait=20)\n# page[\"data\"], then page[\"next_cursor\"] next time\n\n# Or follow changes for good, polling as you go:\n# for message in client.events.follow(subscription=\"CA labor\"): ..."}]}},"/v1/subscriptions":{"get":{"operationId":"listSubscriptions","tags":["Subscriptions"],"summary":"List subscriptions","description":"Your account’s saved subscriptions, by name.","responses":{"200":{"description":"Every subscription.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"type":"array","description":"Every item.","items":{"$ref":"#/components/schemas/Subscription"}}}},"example":{"data":[{"id":7,"name":"CA labor","filter":{"categories":["labor"],"states":["CA"]},"created_at":"2026-10-15T17:20:04.112Z","updated_at":"2026-10-15T17:20:04.112Z"}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/subscriptions\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst subscriptions = await client.subscriptions.list();"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nsubscriptions = client.subscriptions.list()"}],"parameters":[{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"id,name"}]},"post":{"operationId":"createSubscription","tags":["Subscriptions"],"summary":"Create a subscription","description":"Save a named filter. Use it as subscription=<id or name> on /v1/stream and /v1/events. An account can have up to 50.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionInput"},"example":{"name":"CA labor","filter":{"categories":["labor"],"states":["CA"]}}}}},"responses":{"201":{"description":"Created.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Subscription"}}},"example":{"data":{"id":7,"name":"CA labor","filter":{"categories":["labor"],"states":["CA"]},"created_at":"2026-10-15T17:20:04.112Z","updated_at":"2026-10-15T17:20:04.112Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl -X POST \"https://api.ballotdata.ai/v1/subscriptions\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"CA labor\",\"filter\":{\"categories\":[\"labor\"],\"states\":[\"CA\"]}}'"},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst subscription = await client.subscriptions.create({\n  name: 'CA labor',\n  filter: { categories: ['labor'], states: ['CA'] },\n});"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nsubscription = client.subscriptions.create(\n    name=\"CA labor\",\n    filter={\"categories\": [\"labor\"], \"states\": [\"CA\"]},\n)"}]}},"/v1/subscriptions/{id}":{"get":{"operationId":"getSubscription","tags":["Subscriptions"],"summary":"Get a subscription","description":"One saved subscription.","parameters":[{"name":"id","in":"path","required":true,"description":"Subscription id (from GET /v1/subscriptions).","schema":{"type":"integer"},"example":7},{"name":"fields","in":"query","description":"Only these fields of each record, to keep responses small. Comma-separated field names from the response schema; a dot reaches into a nested object or into every item of a list (choices.label), and parentheses group several under one (choices(label,party) is the same as choices.label,choices.party). A field named alone comes back whole, nested parts and all. Leave it out for every field. Only the records in data are cut down: next_cursor and other paging fields always come back. Fields come back in the record’s usual order, and a field that is null or missing in a record stays that way. An unknown name is a 400 invalid_parameter that lists the fields there. With format=csv, keeps the columns copied from those fields. Up to 200 paths, 8 levels deep, 2,000 characters. Guide: https://api.ballotdata.ai/docs/fields","schema":{"type":"string","maxLength":2000},"example":"id,name"}],"responses":{"200":{"description":"The subscription.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Subscription"}}},"example":{"data":{"id":7,"name":"CA labor","filter":{"categories":["labor"],"states":["CA"]},"created_at":"2026-10-15T17:20:04.112Z","updated_at":"2026-10-15T17:20:04.112Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl \"https://api.ballotdata.ai/v1/subscriptions/7\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst subscription = await client.subscriptions.get(7);"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nsubscription = client.subscriptions.get(7)"}]},"put":{"operationId":"updateSubscription","tags":["Subscriptions"],"summary":"Replace a subscription","description":"Replace a subscription’s name and filter. Open streams using it keep their old filter until they reconnect.","parameters":[{"name":"id","in":"path","required":true,"description":"Subscription id (from GET /v1/subscriptions).","schema":{"type":"integer"},"example":7}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionInput"},"example":{"name":"CA labor","filter":{"categories":["labor"],"states":["CA","NV"]}}}}},"responses":{"200":{"description":"Saved.","headers":{"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"X-Daily-Limit":{"$ref":"#/components/headers/X-Daily-Limit"},"X-Daily-Remaining":{"$ref":"#/components/headers/X-Daily-Remaining"},"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Subscription"}}},"example":{"data":{"id":7,"name":"CA labor","filter":{"categories":["labor"],"states":["CA","NV"]},"created_at":"2026-10-15T17:20:04.112Z","updated_at":"2026-10-21T09:12:40.006Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl -X PUT \"https://api.ballotdata.ai/v1/subscriptions/7\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"CA labor\",\"filter\":{\"categories\":[\"labor\"],\"states\":[\"CA\",\"NV\"]}}'"},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nconst subscription = await client.subscriptions.update(7, {\n  name: 'CA labor',\n  filter: { categories: ['labor'], states: ['CA', 'NV'] },\n});"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nsubscription = client.subscriptions.update(\n    7,\n    name=\"CA labor\",\n    filter={\"categories\": [\"labor\"], \"states\": [\"CA\", \"NV\"]},\n)"}]},"delete":{"operationId":"deleteSubscription","tags":["Subscriptions"],"summary":"Delete a subscription","description":"Delete a subscription.","parameters":[{"name":"id","in":"path","required":true,"description":"Subscription id (from GET /v1/subscriptions).","schema":{"type":"integer"},"example":7}],"responses":{"204":{"description":"Deleted. No body."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"x-codeSamples":[{"lang":"Shell","label":"curl","source":"curl -X DELETE \"https://api.ballotdata.ai/v1/subscriptions/7\" \\\n  -H \"Authorization: Bearer $BALLOTDATA_API_KEY\""},{"lang":"JavaScript","label":"JavaScript","source":"import { BallotData } from 'ballotdata';\n\nconst client = new BallotData(); // reads BALLOTDATA_API_KEY\nawait client.subscriptions.delete(7);"},{"lang":"Python","label":"Python","source":"from ballotdata import BallotData\n\nclient = BallotData()  # reads BALLOTDATA_API_KEY\nclient.subscriptions.delete(7)"}]}}}}