Loading
Loading
Calculate distances from a base point to a list of ZIP or postal codes. The base point can be a ZIP code + country or raw latitude/longitude coordinates. Supports up to 100 comparison codes per request.
Six distance units are supported: km (default), mi, yd, m, ft, and in. Each result includes the postal code and its calculated distance from the base point.
Pass your API key as the apiKey parameter in every request.
This is version v1.0 of the API.
Provide a postal code in code with country, or use lat/long as the base point. The compare array is required.
comparerequiredarrayList of ZIP or postal codes to calculate distance from the base point. All codes must exist in the same 'country'. Max 100.
codeoptionalstringBase ZIP or postal code from which distances are calculated. Must be provided together with 'country'.
countryoptionalstringCountry of the ZIP/postal codes in ISO 3166-1 alpha-2 format. Required when using 'code' as base.
latoptionalfloatBase latitude coordinate (-90 to 90). Must be provided together with 'long'.
longoptionalfloatBase longitude coordinate (-180 to 180). Must be provided together with 'lat'.
unitoptionalstringdefault: kmDistance measuring unit. Allowed: 'km', 'mi', 'yd', 'm', 'ft', 'in'. Default: km.
The request body must be a JSON object with a base location (via code + country or lat/long) and a required compare array of postal codes.
{
"compare": [
"90210",
"10001"
],
"code": "33101",
"country": "US",
"unit": "km"
}Returns 200 OK with result_count and a results array containing each compared code and its distance.
result_countNumber of ZIP code distance results returned.
resultsArray of ZIP code distance result objects.
results[].codeThe postal code from the compare list.
results[].distanceDistance from the base point to this code in the requested unit.
The API uses standard HTTP status codes to indicate the success or failure of requests. For common status codes like 429 (Too Many Requests), refer to the general API documentation.
The provided unit symbol is invalid. Please refer to the documentation for supported units.
Only ISO 3166-1 alpha-2 codes country codes are supported.
A maximum of 100 postal/zip codes can be processed per request.
None of the provided postal/zip codes were found in our database.