Downloading bulk data via API

Ballotpedia’s bulk data clients can access their data on-demand with our client portal at https://clients.ballotpedia.org/. The data is refreshed every 24 hours. You may access your data through two methods, as described below:

  1. Login with provided password and click to download latest file (for non-technical users)

  2. Access latest data file via API (for technical users, see next page)

API instructions

Contact Ballotpedia’s data sales staff to request such a key.

The API can be called directly by interacting with two endpoints. Please note that these endpoints can only be accessed from a non-CORS context.

GET https://api.ballotpedia.org/getQueryList

This endpoint will return an array of objects, each object represents a data set and contains the ID, Title and Description.

The endpoint requires your API Key passed in as a header:

x-api-key: [your api key]

Examples

Example call using Postman

Example response with a single file:

This endpoint will return a URL to the requested file:

The endpoint requires your API Key passed in the header as described above, the content type of application/json, and the ID (obtained from the getQueryList endpoint) of the data set and the format passed via the body in the POST request.

Headers

Body

To get the data to return in csv format, make the same call as for json data but change the format parameter from json to csv.

Example call using Postman

Example Response:

Last updated