BlogDataUpdated

One code, three routes

The county code from a coordinate or postal lookup can be used directly to retrieve the county record.

If you start with coordinates, you shouldn't need a different county identifier than someone who starts with a ZIP code. Both lookups need to lead to the same county record.

For example, a point in Greensboro returns Guilford County's code. These are the relevant fields:

GET /point?lat=36.0726&lon=-79.792
X-API-Version: 2.2.0
{
  "country": "US",
  "state": "NC",
  "county": "37081",
  "county_name": "Guilford"
}

Pass that county value to /county/37081?country=US and you get the Guilford County record, including its full name. API 2.2.0 paid profiles also include available statistics.

A postal lookup uses the same field. These excerpts show a ZIP code in Miami-Dade and the county lookup it leads to:

GET /postal/33139?country=US
X-API-Version: 2.2.0
{ "county": "12086", "county_name": "Miami-Dade" }
GET /county/12086?country=US
X-API-Version: 2.2.0
{ "county": "12086", "name": "Miami-Dade County", "type": "county" }

The labels can differ because one response uses a short county name and another uses the full name. The code is what connects them.

If your app caches county records by country and code, it can reuse a record whether /point or /postal supplied the code first. There is no translation table to maintain between those endpoints. Keep the codes as strings, including any leading zeroes.