Integrate your election systems with AP Elections API

Retrieve AP elections data using your own tools.

Quick Links

Overview
Get a quick introduction to the API (PDF).

Developer's Guide
Review the complete documentation of API methods.

Election Race Calls on the Blockchain
Use the smart contracts on either Ethereum or EOS.io.

AP Customer Zone
View election calendar, advisories and testing schedule.

API Explorer
Interact with the API: submit requests and explore available data (requires API key).


Talk to us

Contact us at elections_api_info@ap.org

Access the API

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.

1. Request election race information, including vote updates and race calls.

During 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. Election race information includes:

  • Reference information about each race and each candidate
  • Vote counts and if applicable, delegate 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)

2. Request election reports.

Throughout the election, your application polls the API at regular intervals to retrieve election reports; for example, delegate reports for presidential primaries.

3. Request advance turnout data for presidential and midterm general elections.

Throughout the election, your application polls the API at regular intervals to retrieve state-by-state data on advance voting, including how many absentee ballots have been requested, sent and returned, demographic data, in-person voting data and historical data comparisons.

4. Request delegate allocation data for presidential primaries.

During the presidential primaries, your application polls the API to retrieve the delegate allocation data for Democrats, Republicans or both.

To learn more, refer to the Developer's Guide.


Getting Started - Query Explorer

AP Elections API Query Explorer, an interactive tool for creating API requests, helps you get familiar with the API parameters and allows you to view available elections data. Please note that available data may change daily.

An API key is required for accessing the Query Explorer and making API calls:
https://api.ap.org/v3/elections/xplor


Election Race Calls on the Blockchain

The Associated Press uses IQ.wiki's OraQle software to publish U.S. election race calls. As a developer, you can use the smart contracts on either Ethereum or EOS.io.

The AP uses this Ethereum Public Key for U.S. Presidential race calls: 0x436ee8cb3a351893b77f8b57c9772daec3a96445.

The Ethereum Oracle Smart Contract for U.S. Presidential race calls can be found at 0x0792724900B551d200D954a5Ed709d9514d73A9F.

The Kovan Testnet Oracle Smart Contract for test U.S. Presidential race calls can be found at 0x12B7B8Dea45AF31b6303E00C735332A8b6752856.

The EOS Account for U.S. Presidential, Senate, House and Governor race calls: associapress.

For more information, please refer to IQ.wiki's technical documentation.