Legislative Lookup: Updated with 113th Congress for 2013!

Address

API Documentation

Mobile Commons Legislative Lookup matches a latitude and longitude with the congressional and state legislative districts for that location. It is provided free of charge with no warranty. If you use this service please cache your responses and behave responsibly. If you plan to send more than a few thousand queries per day, let us know via the list before you start.

The API returns valid districts for the current date, however, you can pass in a ?date= param and the API will find any valid districts for your target date. We have virtually all districting changes that have or will occur from 2003 to 2016. Texas is the notable exception, with a trial set for July 2014 to review their redistricting process. Advanced users may want to view state maps here.

Join our low volume mailing list for advance notice of API changes or to ask a question.

Source code is available under an MIT License at http://github.com/mcommons/legislative-lookup.

A query for a latitude and longitude:

http://congress.mcommons.com/districts/lookup.xml?lat=40.7145248&lng=-74.007073

  <?xml version="1.0" encoding="UTF-8"?>
  <response>
    <lat>40.7145248</lat>
    <lng>-74.007073</lng>
    <date>2014-04-16 15:16:09</date>
    <federal>
      <state>NY</state>
      <district>10</district>
      <display_name>NY 10th</display_name>
      <date_source>
        <organization>U.S. Census</organization>
        <url>http://www.census.gov/geo/maps-data/data/tiger-line.html#tab_2013</url>
      </date_source>
    </federal>
    <state_upper>
      <state>NY</state>
      <district>26</district>
      <display_name>NY 26th</display_name>
      <date_source>
        <organization>U.S. Census</organization>
        <url>http://www.census.gov/geo/maps-data/data/tiger-line.html#tab_2013</url>
      </date_source>
    </state_upper>
    <state_lower>
      <state>NY</state>
      <district>66</district>
      <display_name>NY 66th</display_name>
      <date_source>
        <organization>U.S. Census</organization>
        <url>http://www.census.gov/geo/maps-data/data/tiger-line.html#tab_2013</url>
      </date_source>
    </state_lower>
  </response>
  

If no latitude and longitude is supplied:

http://congress.mcommons.com/districts/lookup.xml

  <?xml version="1.0" encoding="UTF-8"?>
  <response>
    <lat/>
    <lng/>
    <date>2014-04-16 15:16:10</date>
    <message>That lat/lng is not inside a congressional district</message>
    <error>Must supply lat and lng parameters</error>
  </response>
  

If the latitude and longitude is outside of the United States, and does not match any legislative district geographies:

http://congress.mcommons.com/districts/lookup.xml?lat=64.835054&lng=147.646528

  <?xml version="1.0" encoding="UTF-8"?>
  <response>
    <lat>64.835054</lat>
    <lng>147.646528</lng>
    <date>2014-04-16 15:18:01</date>
    <message>That lat/lng is not inside a congressional district</message>
    <error>No districts found</error>
  </response>