Blog·Craft·

One code, three routes

District, point, and postal all hand back the same FIPS-style code for the same county.

/district/37081 resolves to Guilford County, North Carolina.

{ "country": "US", "country_name": "United States", "state": "NC", "state_name": "North Carolina", "district": "37081", "name": "Guilford County", "type": "county" }

Land on the same county from a coordinate and /point hands back the identical code.

GET /point?lat=36.0726&lon=-79.792
{ "country": "US", "state": "NC", "district": "37081", "district_name": "Guilford" }

A postal code in Miami-Dade ships the same pattern for its own county.

GET /postal/33139?country=US
{ "district": "12086", "district_name": "Miami-Dade" }

GET /district/12086
{ "country": "US", "country_name": "United States", "state": "FL", "state_name": "Florida", "district": "12086", "name": "Miami-Dade County", "type": "county" }

Same district field, same code, three entry points. Resolve it once at /district/{code} for the full name and stats, then reuse it anywhere else that code turns up.

One code, cached once

An app pulling a coordinate through /point and a ZIP through /postal in the same request does not need two different county lookups. Cache the district code once and the full record from /district/{code} works for both, no matter which route handed it to you first.

Try it

Call /point over any US county and cross-check the code at /district/{code}. It will match. It always matches.