ZIP code radius API
GET /v1/radius returns every ZIP code within a radius of a ZIP code, or of any latitude and longitude, sorted nearest first, each with its distance in miles and its city, county, time zone and population. One request, up to 500 miles.
Get a free API key
1,000 requests a day, free · no card · the key appears on the next page
GET /v1/radius
Every ZIP code whose centre point is within the radius, nearest first, each with its distance in miles. Measure from a ZIP code or from any coordinate.
curl "https://zipcodes.pro/v1/radius?zip=60601&miles=3" \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch("https://zipcodes.pro/v1/radius?zip=60601&miles=3", {
headers: { Authorization: "Bearer YOUR_API_KEY" },
});
if (!res.ok) throw new Error((await res.json()).message);
const data = await res.json();import requests
r = requests.get(
"https://zipcodes.pro/v1/radius",
params={"zip": "60601", "miles": "3"},
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=10,
)
r.raise_for_status()
data = r.json() Response 200
{
"origin": {
"zip": "60601",
"lat": 41.885155,
"lng": -87.621512
},
"miles": 3,
"count": 21,
"zips": [
{
"zip": "60601",
"type": "standard",
"usps_city": "Chicago",
"state": "IL",
"county_fips": "17031",
"timezone": "America/Chicago",
"lat": 41.885155,
"lng": -87.621512,
"population": 15235,
"median_household_income": 121458,
"median_home_value": 526200,
"land_sqmi": 0.389,
"density_per_sqmi": 39164.5,
"miles": 0
},
{
"zip": "60602",
"type": "standard",
"usps_city": "Chicago",
"state": "IL",
"county_fips": "17031",
"timezone": "America/Chicago",
"lat": 41.883041,
"lng": -87.629079,
"population": 1480,
"median_household_income": 126202,
"median_home_value": 391800,
"land_sqmi": 0.082,
"density_per_sqmi": 18048.8,
"miles": 0.416
},
{
"zip": "60603",
"type": "standard",
"usps_city": "Chicago",
"state": "IL",
"county_fips": "17031",
"timezone": "America/Chicago",
"lat": 41.880262,
"lng": -87.627396,
"population": 1298,
"median_household_income": 133545,
"median_home_value": 633900,
"land_sqmi": 0.119,
"density_per_sqmi": 10907.6,
"miles": 0.454
},
{
"zip": "60695",
"type": "unknown",
"usps_city": "Chicago",
"state": "IL",
"county_fips": "17031",
"timezone": "America/Chicago",
"lat": 41.8839,
"lng": -87.6317,
"population": null,
"median_household_income": null,
"median_home_value": null,
"land_sqmi": null,
"density_per_sqmi": null,
"miles": 0.531
},
"… 17 more"
]
} | Parameter | Meaning |
|---|---|
zipquery, optional | Centre ZIP code. Either this, or lat and lng. |
latquery, optional | Centre latitude, −90 to 90. |
lngquery, optional | Centre longitude, −180 to 180. |
milesquery, optional | Radius in miles, above 0 and up to 500. Default 10. |
What you get
- Centre on a ZIP code (zip=95014) or a coordinate (lat=37.3&lng=-122.08).
- Radius from just above 0 up to 500 miles; distance is great-circle, between published centre points.
- Each result carries USPS city, state, county FIPS, time zone, coordinates, population, median household income and home value.
- Use it for store locators, delivery zones, sales territories and "near me" search.
Distance between two ZIP codes: GET /v1/distance
Great-circle distance in miles and kilometres between the two ZIP codes' published centre points, with each end's city, state and coordinates.
curl "https://zipcodes.pro/v1/distance?from=95014&to=10001" \
-H "Authorization: Bearer YOUR_API_KEY"const res = await fetch("https://zipcodes.pro/v1/distance?from=95014&to=10001", {
headers: { Authorization: "Bearer YOUR_API_KEY" },
});
if (!res.ok) throw new Error((await res.json()).message);
const data = await res.json();import requests
r = requests.get(
"https://zipcodes.pro/v1/distance",
params={"from": "95014", "to": "10001"},
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=10,
)
r.raise_for_status()
data = r.json() Response 200
{
"from": {
"zip": "95014",
"city": "Cupertino",
"state": "CA",
"lat": 37.308354,
"lng": -122.081882
},
"to": {
"zip": "10001",
"city": "New York",
"state": "NY",
"lat": 40.750649,
"lng": -73.997298
},
"miles": 2559.524,
"kilometers": 4119.155,
"method": "great-circle distance between the ZIP codes' published centre points"
} Limits
The free plan includes 1,000 requests a day, reset at 00:00 UTC, and 60 a minute. Every response says where you stand:
| Header | Meaning |
|---|---|
X-RateLimit-Limit | Requests your plan includes in the current window (1,000 a day on Free). |
X-RateLimit-Remaining | Requests left in the window, after this one. |
X-RateLimit-Reset | When the window resets, ISO 8601 in UTC. Free resets at 00:00 UTC. |
Retry-After | Seconds to wait, on a 429 for the per-minute limit only. |
Over the limit, the API answers 429 with the reset time; nothing is
billed. Paid plans for higher volume (Starter 100,000 a month, Pro 500,000 a month, Business 3,000,000 a month)
are listed on the pricing page and are not on sale yet.
Questions
How is the distance measured?
As the great-circle (haversine) distance between ZIP code centre points: the Census internal point for ZIP codes with a delivery area, and the GeoNames coordinate for the rest. It is a straight line, not a driving distance.
Can I search from an address instead of a ZIP code?
Pass lat and lng instead of zip. Any geocoder will turn an address into a coordinate; the radius is then measured from that point.
Does the radius include the centre ZIP code?
Yes, at 0 miles, as the first result.
What is the largest radius?
500 miles. For a whole state or region, the free ZIP code database download is usually the better tool.
Do PO box ZIP codes appear?
Yes, where they have a published coordinate. Each result has a type field: standard for ZIP codes with a delivery area, military, and unknown for the rest (mostly PO box and single-organisation ZIP codes), so you can filter them out.
More
- Full API reference: every endpoint, error and header.
- No code needed? ZIP code radius tool.
- ZIP code API
- Free ZIP code API
- ZIP to county API
- ZIP code distance API