Back to Docs

districts.getDistrictFromLatLong

districts.getDistrictFromLatLong gets the district that a provided latitude/longitude pair falls within.

Parameters

There are two required parameters for getDistrictFromLatLong:

Return Value

Districts are returned either in XML or JSON in the format shown below.

Errors

Errors are indicated by setting the HTTP status code to 400 and returning a text string describing the error. The following errors may be encountered in districts.getZipsFromDistrict:

Examples

districts.getDistrictFromLatLong.xml?latitude=35.778788&longitude=-78.787805

<response>
  <districts>
    <district>
      <state>NC</state>
      <number>4</number>
    </district>
  </districts>
</response>

districts.getDistrictFromLatLong.json?latitude=35.778788&longitude=-78.787805

{"response": 
    {"districts": 
        [{"district": {"state": "NC", "number": "4"}}]
    }
}