Civic and Political APIs, Data Sets, and Websites

Will Friedman
NDP Annotations
Published in
8 min readJun 25, 2018

Your guide to finding reliable data to help you build great civic and political tools

ProPublica’s Congress API in action on fivethirtyeight.com.

The New Data Project is building the free relational organizing app VoteWithMe, which helps people identify their friends who can vote in key elections and enables them to reach out to them with voting reminders.

In the course of building VoteWithMe, our team has come across an impressive variety of useful civic data APIs and data sets. We’ve also come across a number of websites that provide election information and other civic data in an easy-to-use format.

We’ve spent many months sorting through what’s out there. So I am sharing the highlights of what we learned here with you in order to save you some time and help provide a resource to other progressive organizations who are building civically-oriented apps and websites.

In this post, I share reliable data sources about key topics including: upcoming elections, candidates, elected officials, and election results. And, in each section, I indicate three different ways to get this data:

  1. APIs can be used by a programmer to write an application (these are almost always REST services that return JSON).
  2. Data sets are typically lists, CSV files, or Google spreadsheets with information that is arranged into columns.
  3. Websites are end-user applications. Most of them involve filling out a form and getting specific information in response. All the websites listed here work on computers as well as mobile devices.

I’m primarily featuring free services, though I mention a couple paid sources and I identify them as such. I haven’t covered apps for iOS and Android, but I may do so in another post.

Please write me at data@newdataproject.us and tell me which sources you find most useful and let me know about any that I’ve missed that you love. I’d love to hear about what you’re working on. And if you find this post useful, please link to it to help others find it.

Upcoming elections

APIs

One of the two primary endpoints of the Google Civic Information API returns data about elections (the other returns elected representatives). Elections information is in two parts. The elections query returns a list of all upcoming elections and optionally takes an address as a parameter to narrow the results. And during certain elections, the voter info query lets you look up polling places, early vote and drop off locations, data on candidates and referendums, and other election information.

Democracy Works, the folks behind TurboVote, have an API that includes registration deadlines, absentee ballot information, and more, but it is not free.

Data sets

The Ballotpedia guides include a variety of election calendars, including statewide primaries, congressional elections, ballot measures, local elections, recall elections, and more.

Reddit has a robust crowd-sourced election calendar which purports to have all the elections in the United States.

The DNC election calendar on GitHub is a particularly rich source of data, with state by state data on congressional and gubernatorial elections — primary, special, and general — including 1) whether there is an election in 2018; 2) which party is incumbent; 3) what forms of early voting are available, if any; 4) the time zone of the state; 5) links to state-wide election calendars; 6) poll open and close times; 7) early voting dates; and 8) voter registration dates.

Vote.org has helpfully coalesced some of the election calendars into a single Google spreadsheet.

Websites

Vote.org also has websites where users can register to vote and request an absentee ballot.

In a nice twist, Run for Office from NationBuilder lets you see which elections you could run in as a candidate, as well as filing deadlines.

The U.S. Vote Foundation Election Dates & Deadlines site provides voter registration and absentee ballot request and return dates for a given address for both primaries and general elections. You can also use their site to register to vote and request an absentee ballot.

Candidates

The upcoming elections guides in the previous section don’t always include detail about which candidates are running, so you may need to obtain that from one of the sources below. Because of the nature of the candidate selection process, this data is often available later than other types.

APIs

As mentioned above, the Google Civic Information API contains certain information about candidates.

In addition, Ballot Ready consolidates information on candidates, which they collect from candidates’ websites and other sources, and licenses this data out — for a fee.

Data sets

Daily Kos Elections maintains all kinds of useful civic data. One of their offerings is a Google spreadsheet of candidates in the 2018 congressional elections, which includes a pronunciation guide as well as demographic information on the candidates.

Ballotpedia also has a website with a list of 2018 congressional candidates.

If you’re looking for historical information, ProPublica has a data set of candidates in the 2016 elections, and so does Ballotpedia.

Websites

Starting in early October, Ballot Ready will provide sample ballots customized to a given address. They will provide information on candidates drawn from candidate websites and summarized, including endorsements and issue positions. Unlike their API, their user-facing website should be free.

In Washington State, Fuse publishes the Progressive Voters Guide, an indispensable resource for left-leaning voters. It includes recommendations and endorsements on candidates and ballot measures from progressive groups and publications.

Elected Officials

There are several compelling and useful APIs that return data about elected officials.

APIs

The Representatives endpoint of the Google Civic Information API will return the current elected officials and their contact details at a number of levels of government. You can pass it an address or an Open Civic Data Identifier.

The Vote Smart API returns voting records, biographical information, issue positions, public statements, interest group ratings, and campaign finance information for “every candidate and elected official.” Wrappers are available for Java, Python, Ruby, and R. The data is also available to end-users on their website, though it won’t win any awards for user interface design.

The ProPublica Congress API returns roll call votes, biographical data on members of Congress, members’ roles, and their “Personal Explanations” of votes, as well as a great deal of data related to votes on bills and other legislative floor actions.

The Open States API provides state legislative information, including legislators with contact details, bills, committee memberships, and more.

Data sets

The DNC Elected Officials Roster repository on Github includes CSV files with state and federal current elected officials including state representatives, state senators, governors, lieutenant governors, attorneys general, auditors, secretaries of state, and U.S. representatives and senators.

Daily Kos Elections offers a 115th Congress Members Guide with elected officials, including a pronunciation guide and demographic data by district. It also includes past presidential vote percentages for those districts.

Lists of the current members of the House and Senate are available from the federal government as XML files.

Websites

It’s not hard to find a website to look up your elected officials, so I won’t list them all here. A leading site is GovTrack, which also gives you the ability to look up legislation by subject matter.

Some services let you not only look up, but also contact your representatives in novel ways. One that I worked on before I joined The New Data Project is Stamps Licked, which in conjunction with Herd on the Hill will hand-deliver your letter on a variety of topics to your senator’s DC office. They will also have a conversation about your letters with congressional staff when they do so.

Election results

APIs

For current elections, the Associated Press Elections API provides vote counts and delegate counts (when applicable) as well as their race calls, which are used by a number of other media organizations.

Data sets

For past elections, Daily Kos Elections has presidential election results by congressional district for 2008, 2012, and 2016. They also provide recent statewide election results by congressional and legislative district.

Websites

You can obtain election results on any number of websites. I like The New York Times election site, but you probably already have your favorite.

Census and other government data

APIs

The U.S. Census provides a significant amount of data by API. Of particular note is the American Community Survey (ACS), which is updated every year, unlike the census, which is decennial. The ACS “covers a broad range of topics about social, economic, demographic, and housing characteristics of the U.S. population.”

Another option is Socrata. According to their website: “The Socrata data platform hosts tens of thousands of government data sets. Governments large and small publish data on crime, permits, finance, healthcare, research, performance, and more for citizens to use… The Discovery API from Socrata opens up the Socrata corpus of government data for automated searching, research, and exploration.” I have not evaluated their offering, so I’d love to hear from any readers who have.

Data sets

In addition to API access, the Census Bureau provides their raw data in a browsable file system.

Daily Kos Elections has summarized certain census information, including the 2016 Educational Attainment and Median Household Income by state and by congressional district. They also provide religious affiliation by congressional district based on data from the Association of Religious Data Archives.

Websites

Socrata’s Open Data Network allows you to look up census-type data on income, population, education, and more.

Contributions and Financial Disclosures

APIs, data sets, and websites

Entities in this category all provide APIs, data sets, and websites.

The Federal Election Commission (FEC) has an API that returns political contributions, including data on individuals’ giving as well as per candidate information. In addition to their API, bulk data is available for download. The FEC runs two different websites which appear to provide access to the same data: an older, non-mobile friendly page, and a newer, responsive website that is limited to two years of results at once.

The Center for Responsive Politics has an API that returns data on “money in politics.” It includes a breakdown of candidates’ donations by industry, by individual donor, and more. This is a useful tool for discovering who is backing a PAC with a generic name, for example. Bulk data is also available, and their end-user website is at opensecrets.org.

MapLight’s tagline is “revealing money’s influence on politics.” They offer APIs and bulk data on donations and representatives’ positions on issues, attempting to tie the two together. MapLight also runs the Dark Money Watch site.

Boundaries and Geocoding

APIs

The Census Geocoding API is an address lookup tool that determines approximate latitude/longitude coordinates and returns census geography information about the area around an address.

Data sets

Daily Kos offers downloadable congressional district boundary shapefiles in a variety of formats with GIS data covering the boundaries in 2018, 2016, and 2014.

Websites

Daily Kos also provides Google Maps overlays of congressional boundaries for each state. This is helpful for field organizer work, for example.

Conclusion

We hope that you find this post useful in identifying APIs and data sets for your own projects. Please let us know about the civic data APIs and data sets you find most helpful by writing us at data@newdataproject.us or commenting below. And if you find this post useful, please give it some claps and link to it so others can find it.

Good luck with your work to make America a better place!

In the current climate, causes and campaigns too often lack the time, expertise, and flexibility to work beyond immediate deadlines. The New Data Project (NDP) is a new 501(c)(4) organization built to address this gap by testing new approaches, looking beyond the current cycle, and serving as an advanced technology research lab for progressives.

--

--

Will Friedman
NDP Annotations

Working on relational organizing: find your friends who can vote in key elections and help them turn out. Past president of Cozi–the maker of apps for families.