API Documentation

All endpoints are free, read-only, and return JSON. Base URL: https://easyzipcodes.com

ZIP Code Lookup

GET /api/v1/zip/<zipcode>

Returns data for a single 5-digit ZIP code.

Example

curl https://easyzipcodes.com/api/v1/zip/90210

Response fields

FieldTypeDescription
zipstring5-digit ZIP code
citystringPrimary city name
statestring2-letter state abbreviation
state_namestringFull state name
countystring|nullCounty name
latnumberCentroid latitude
lngnumberCentroid longitude
bboxobject|nullBounding box (north/south/east/west)
poiobjectPOI category counts (coffee, grocery, gas, etc.)
brandsobjectNational-chain counts (up to 25), properly cased and variant-merged — e.g. {"Starbucks": 7, "McDonald's": 3}. Local one-offs are omitted. For the full raw dataset, use the CSV download.
key_placesarrayUp to 10 notable named places (parks, museums, historic sites, …) in and around the ZIP, from OpenStreetMap. Each entry has name, category, lat, lng, wikidata, wikipedia_url. Each entry also has in_zip (true when confirmed inside the ZIP; false for nearby places).
aboutobject|nullWikipedia lead extract for the ZIP’s city: title, extract, source_url, license, attribution.

Licensing: everything except about is unencumbered (ODbL facts / public domain / CC0 Wikidata ids). The about object’s text comes from Wikipedia and is licensed CC BY-SA 4.0 — consumers redistributing it must attribute Wikipedia contributors.

Nearby ZIP Codes

GET /api/v1/near?lat=<lat>&lng=<lng>&radius_km=<km>

Returns ZIP codes whose centroid lies within radius_km of the point, nearest first. Distance is the great-circle (haversine) distance in kilometers; for miles, multiply by 0.621371.

Example

curl "https://easyzipcodes.com/api/v1/near?lat=34.09&lng=-118.41&radius_km=10"

Parameters

ParamTypeDescription
latnumberRequired. Latitude, -90 to 90.
lngnumberRequired. Longitude, -180 to 180.
radius_kmnumberRequired. Search radius in km (> 0, capped at 100).
limitnumberOptional. Max results, 1–100 (default 20).

Response

Array of objects with zip, city, state, and distance_km (rounded to 2 decimals), sorted nearest-first. Returns [] when nothing is in range, and 400 with {"error", "code": "invalid_params"} for missing / out-of-range params.

Rate Limits

60 requests per minute per IP. The X-RateLimit-* headers are present on rate-limited responses.