Welcome to Tris's US Legislative District Matching Emporium
Have you ever had a (latitude, longitude) coordinate and needed to know what United States legislative districts represented the folks living at that coordinate? You may
be entitled to financial compensation benefit from this API!
How to use
Best explained as an example, with
$ curl -A "mycoolsoftware/1.1 firstname.lastname@example.org" \
Please note the following from this example:
The response will contain a list of OCD Identifiers.
- The district number prefixes mean the following:
cd is a Congressional District
sldl is a State Legislative District (Lower house, like a General Assembly or State House of Representatives)
sldu is a State Legislative District (Upper house, like a State Senate)
- There are a few oddities in the OCD Identifier set that you should be aware of:
- DC is a
district:dc, not a
state:dc. It has
sldu districts which correspond to DC Council wards.
- States that only have at-large congressional districts use
cd:at-large instead of a numbered district (Alaska, Delaware, North Dakota, South Dakota, Vermont, Wyoming).
- Massachusetts, Vermont, and New Hampshire
sldu identifiers are based on the towns the districts consist of.
- Vermont does the same with their
- Nebraska has a unicameral legislature, so they only have
- You must send a User-Agent header (the
-A option to
curl) that includes your contact email. Otherwise you might be blocked from using the API based on someone else's abuse.
- All values in the
perf section are subject to change at any time, with no warning. All other keys should be ~stable.
- The only permitted uses of this service are the following. If your use doesn't fall under one of these categories, email the address listed below.
- Providing support to progressive political campaigns (issue campaigns count) in the US.
- Understanding and counteracting partisan gerrymandering in the US.
- Nonpartisan personal or research use.
- You should be reasonable with your request rates (try to keep it at less than 60 requests per minute, if you need more please send me an email).
- If you hit a state that isn't in cache it'll be slow. Cache lasts for a while though, and matching should be very fast (100/s or greater)
- US territories aren't properly supported right now.
- No data on representatives is provided currently, just the districts. I'd recommend the Open States People dataset (and maybe I'll add support for this dataset in the future)!
- District borders and OCD-IDs are correct to the best of my knowledge and ability. Districts should be current for the 118th Congress / 2022 redistricting cycle, except for states that are (or have been, in 2022/2023) in litigation over their maps.
- Only congressional districts and state legislative districts are provided. I'd love to talk about adding city council and county commission districts! Just send me an email.
You can email
email@example.com for best-effort support, bug reports, data quality issues, and so on.