Guide · Politics

Add congressional districts to a spreadsheet

Append the 119th Congress district, and optionally state senate and house districts, to every address in a CSV or Excel file.

Why from the address, not the ZIP

ZIP codes are postal routes, not political boundaries, and thousands of them straddle district lines. Assigning districts by ZIP gets a measurable share of a voter file wrong. Geocoding each address to a point and testing the point against the boundary is the only way to be right near a line.

In the spreadsheet tool

  1. Open the spreadsheet geocoder with a free key.
  2. Drop the file and confirm the address columns.
  3. Tick Congressional district and, if you want them, State legislative districts.
  4. Geocode and download. New columns: cd_district and cd_name, plus sld_upper and sld_lower if you ticked the state chambers, next to geo_lat, geo_lng and geo_accuracy_type.

Districts are the vintage in TIGER/Line 2025 for the 119th Congress.

With the API

curl -X POST https://api.geocode.net/v1/geocode/batch -H "X-API-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"addresses": ["1 Loockerman Plz, Dover, DE", "1600 Pennsylvania Ave NW, Washington DC"], "fields": "cd,stateleg"}'
{ "fields": { "congressional_district": { "congress": 119, "district": "00",
              "name": "Congressional District (at Large)", "geoid": "1000" } } }

Check the accuracy column near boundaries

Filter to rows whose accuracy_type is place, zip, county or state. Those rows were placed at an area centroid, so their district is a guess when the area crosses a line. Fix the address (usually a missing city or a typo in the street) and run those rows again.

Related: the free congressional district lookup for one address at a time.

Ready to geocode for real?

10,000 free lookups a month, every append included, no card.