VoteAmerica+ Civic Data API V1
These docs cover a deprecated version of the VoteAmerica+ Civic Data API. Find information on the latest version here.
If you’ve ever wanted to build your own Election Center of state-specific data, this is the API for you. There are 51 different sets of laws governing elections in the United States because we like to make things as complicated as possible. We’ve navigated this mess so you don’t have to.
The data in this API powers the VoteAmerica site, and is surfaced throughout the VoteAmerica tools.
Civic Data API fields and descriptions are here.
Using the API
The API base URL is https://api.voteamerica.org/v1/
. For example, you can try running curl https://api.voteamerica.org/v1/election/field/
.
GET /election/field/
Authentication: none
Returns: An array of state information field objects. Each contains a slug, a longer description, and a field format type.
Notes: Slugs can be matched to the results in /data/state/{state}
.
Response structure:
[
{
"slug": string,
"long_name": string,
"field_format": string
}
]
GET /election/data/state/{state}/
Authentication: basic auth, API key ID as the username and API key secret as the password
Parameters: {state}
should be a 2-letter postal abbreviation, in upper case.
Returns: All elections information fields for a single state.
Notes: Each field_type
in the response will match a slug from the GET /election/field/
query.
Response structure:
{
"code": string,
"name": string,
"state_information": [
{
"text": string,
"field_type": string,
"modified_at": datetime
}
]
}