Legislative Lookup: Updated with 113th Congress for 2013!

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.

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>
      <state_lower>
        <iddd>3601</iddd>
        <state>NY</state>
        <district>66</district>
        <display_name>NY 66th</display_name>
      </state_lower>
      <federal>
        <iddd>271</iddd>
        <state>NY</state>
        <district>10</district>
        <display_name>NY 10th</display_name>
      </federal>
      <state_upper>
        <iddd>6784</iddd>
        <state>NY</state>
        <district>26</district>
        <display_name>NY 26th</display_name>
      </state_upper>
    </response>
  

If no latitude and longitude is supplied:

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

    <?xml version="1.0" encoding="UTF-8"?>
    <response>
      <lat></lat>
      <lng></lng>
      <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>
      <error>No district found</error>
    </response>