|
|
|
|
AP Elections API (ELAPI) allows you to retrieve AP elections data using your own tools.
An API key is the access key required for making API calls. If you have not received your API key, please contact AP Customer Support.
You can authorize your API request by specifying your API key in the x-api-key HTTP request header.
The Elections API landing page at https://api.ap.org/v3/elections provides:
Links to the API documentation and resources.
A list of currently available elections data by date.
|
|
|
|
Available data may change daily. |
|
A link to the Query Explorer, an interactive tool for creating API requests that helps you get familiar with the API parameters and allows you to view available elections data.
Integrate your election systems with AP Elections API. Your election results delivery application (for example, a results loader that powers your election websites) retrieves election race information from AP Elections API.
Request election race information, including vote updates and race calls.
Throughout the election, your application polls the API at regular intervals to retrieve election race information and updates in the races of interest; for example, all races in your state or Top-of-the-Ticket races in all states.
Make an initial request for the election race information for all the races you are interested in. The response includes:
Reference information about each race and each candidate.
Vote counts and if applicable, delegate or electoral counts.
Race calls (races that have been called are the races where a winner has been declared and the races that are advancing to a runoff).
The link to use in the next request.
Use the returned link to make the next request (for more information, see Best Practices). The response includes the races for which the vote, delegate or electoral count, race call and/or candidate information have been updated since your previous request and the link to use in the next request. You can now repeat this step during the election to get updates.
For more information, see Elections.
HTTPS with TLS 1.2 or 1.3 is supported for all API calls.
In request syntax, variable names are shown in braces { }. Optional parameters are shown in brackets [ ]. Do not type the braces and brackets in the request.
In response descriptions, attributes are indicated by an at sign (@).
In response examples, an ellipsis (…) indicates information that is omitted for brevity.
|
|
|
||||
|
|
|||||
|