About civicAPI
civicAPI is a free election API and database that aims to provide comprehensive information about all elections - current and historic - in a universal, easily consumable manner. We aim to provide up-to-date results in a timely fashion for all elections across the world - including snap elections, referendums, and more!
civicAPI is a free detailed alternative to other election APIs such as Decision Desk HQ, the Associated Press, and others.
Data Usage Policy
Our data may be used freely for personal, non-commercial, and commercial purposes. You may use our data for research, publication, teaching, publishing live election results, or anything else. If used for a non-commercial or commercial purpose, proper attribution to us must be made. Please include a link to https://civicapi.org.
API Usage
Our API may be used by anyone without an account or key. The data is provided in a JSON format. However, please note that to prevent abuse, API calls are ratelimited (5 calls per every 2 seconds). If you need this restriction lifted, please contact us and we will be happy to work with you!
Q&A
Why was civicAPI created?
In 2020, I created a Discord bot named Civics so I could track the 2020 United States elections with my Discord server. One thing that struck me was how difficult it actually was to get this data. From what I could find, there wasn’t a single public API I could just access to fetch the results of each state, at least not without paying a ton of money. I ended up having to scrape a webpage for the data!
Later, I once again set up the bot so I could track the 2022 midterm elections in the US. And, once again, the API I was searching for just didn’t exist, and I again had to resort to scraping a webpage.
Finally, in 2024, I wanted to track elections in the United Kingdom and later, the United States… and there was still no easy to use API that gave me the results! It was clear that if I wanted a magic API that did what I wanted, I was gonna have to build it myself. So, that’s what I did, and civicAPI was born.
Where does your data come from?
We try to list our sources under each page. Typically, our data comes from official results reported and posted by the Secretary of State (or equivalent) of each country and state. In certain countries, we may rely on state media to provide results, as the data is not publicly accessible. Regardless, all of the data you see on this website is what a government has officially reported.
For historic results, we typically use historic government archives or books with the referenced data.
Do you make your own calls?
Yes, for ongoing elections, we make all of the election calls you see here on our own. Our Decision Desk tries to make calls as quickly as possible, based on the following criteria:
- the percentage of expected vote left
- where outstanding votes remain
- polling data (if available)
- whether a candidate is under/over-performing their expected result
Elections with no opponent will typically be called upon poll closing.
Countries which report all of their votes at once will also typically be called when the data is released.
For live updates on our election calls, you may follow us on Twitter or BlueSky.