API to Get Congressional Districts

Quickly add Congressional districts and legislator contact information via API. Works with addresses and coordinates.

Need to add Congressional districts or Senator and Representative contact information to addresses or latitude/longitude coordinates in bulk? You're in the right place.

This article shows you how to add Congressional districts using Geocodio. The Congressional district data returned includes Congressional district number, Congress number, and Congress years, with the option to append legislator data. You can use our API to integrate it into a website, or upload Excel, CSV, and TSV files.

Test it first: Find the Congressional district information for a single address

If you just need the Congressional districts and Senator/Representative contact information for one address, you can use the tool below. Just check the box next to ‘Congressional Districts’, then click ‘show results.’

Find the Congressional district for a single address

Please enter an address in the US or Canada

Do you want to append additional data?

Show results

Add Congressional Districts to Addresses via API

1. Organize the addresses you want to add Congressional district info to

Addresses do not need to be complete in order for you to be able to add Congressional districts.

The following address combinations are acceptable:

  • Street + City + State (ex, 960 Orange Avenue, Coronado, CA)
  • Street + ZIP (ex., 5020 E Sprague Ave 99212)
  • ZIP only (ex 01983)

2. Create an API Key to add Congressional Districts to addresses

Next, create an API key. Creating an account and an API key is free. You can create an API key here.

Results are billed as geocode + Congressional district info (i.e., two lookups). For example, if you have 100 addresses that you want school districts for, that would count as 200 lookups. You can calculate how much this will cost you here.

3. Select a library to use for our API to add Congressional districts

There are official libraries for node.JS and PHP (including Laravel features). There are also community-created libraries for R, Python, Ruby, Clojure, Perl, Go, and C#.

4. Integrate the API to add Congressional Districts and contact information

Adding Congressional districts works for both forward geocoding (address to coordinates) and reverse geocoding (coordinates to addresses) endpoints. You just add fields=cd to your request. You can see more about integrating the API here.

Congressional Districts

Congressional District Number

For example, Congressional District 8

Congress Number

For example, 117th

Congress Years

For example, 2021-2023

In elections, we can’t have even a 5% tolerance for error. Geocodio gives us the accuracy we need to give people the correct information about the election and remind them to vote.
Debra Cleaver, Founder

Address or Coordinates to Senator and Representative Info

Senator and Representative Names

Senator and Representative Emails

Senator and Representative DC Office Addresses

Senator and Representative Phone Numbers

Senator and Representative Websites

Senator and Representative Parties

Senator and Representative Social Media Links

Senator and Representative IDs

Upload a spreadsheet now. No credit card required.

Upload SpreadsheetGet an API Key

ZIP Codes to Congressional Districts

If you only have ZIP codes, we can return all of the possible Congressional districts ranked by likelihood in our API. (Most likely result is returned for spreadsheets.)
Learn more

Historical Congressional Districts

Use our API to get Congressional districts back to the 113th Congress.

Full Data Dictionary

Download an example result and see the full data dictionary.

Find Senator and Representative Phone Numbers in Bulk

Need to help people contact Congress? Geocodio can help.

Add State Legislative Districts

If you also need state-level districts, you can add them at the same time as Congressional districts.


Congressional districts count as an additional lookup. Use our pricing calculator to see how much it might cost you.

Canadian Ridings

Working with data in Canada? Geocodio can also help you add federal and provincial/territorial ridings (Canadian electoral districts).
Copyright © 2014-2024 Dotsquare LLC, Norfolk, Virginia. All rights reserved.