|
||||||||||||||||||||||||||||||||
Elections Response Examples
State-Level ResultsThis example shows state-level results of primary races for Governor in Vermont. Both contested and uncontested races are returned by default. Since the level parameter is not specified in the request, the response does not include the details for each of the reporting units.
Results by Reporting UnitThis example (in XML and JSON) shows results by reporting unit for the primary races for Governor in Vermont. Since the level=ru parameter is specified in the request, the response includes results for both the specified state (Vermont) and each of the reporting units within this state (cities and towns in this example since Vermont is a New England state). Note that in addition to the reporting unit ID, the county FIPS code is also reported for each New England city or town, so that you can aggregate results to the county level. Results by FIPS CodeThis example (in XML and JSON) shows results by FIPS code for the primary races for Governor in Vermont. Since the level=fipscode parameter is specified in the request, the response includes results for both the specified state (Vermont) and each of the county FIPS codes (city/town results aggregated to the county level in this example since Vermont is a New England state). Results by District During Presidential PrimariesThis example (in XML and JSON) shows results by district (including the delegate count for each candidate if applicable) for the Democrat and Republican presidential primary races in West Virginia. Presidential Results and Electoral Counts - National and State-by-StateThis example shows presidential popular votes and electoral counts for the state of New Jersey and U.S. national rolled-up summary popular vote and electoral count results at the default level=state. "ElectTotal" indicates the state or U.S. national electoral count, and "ElectWon" shows the candidate’s electoral votes. Only four candidates are shown at the U.S. national level for illustration purposes; however, the actual response will include every presidential candidate across the country, even if they are on the ballot in one state.
Presidential Results and Electoral Counts by District2020 GE and PriorThis example shows presidential popular votes and electoral counts by district for the presidential election in Maine, a state that awards presidential electoral votes using the district-based method instead of the “Winner-Take-All” method. The district-based method is currently used in Maine and Nebraska. In the response, "ElectTotal" shows the district or state electoral count, and "ElectWon" shows the candidate’s electoral votes. This example shows the 2012 test data for illustration purposes only. Effective 2024 GEFor information and an example, see Presidential Results and Electoral Counts by District. A-Report VotesIf the avotes=true parameter is specified in the request, the A-report votes are returned for each candidate, if available, in the "AVotes" attribute in XML or the "avotes" property in JSON. A-reports represent advance voting data as provided to the AP on election night, which may include absentee votes, early poll votes, or a combination of these.
Certified ResultsIf the resultsType=c parameter is specified in the request, certified results are returned in the vote count field if available. Certified results represent the final, official vote totals provided by each state or, in some cases, individual counties. They may be made available to the AP anywhere between a few days to over a month after the election. Certified results are indicated by ResultsType="c" in XML and "resultsType": "certified" in JSON. |