An API for geolocating zip codes


  "lat": 40.0218407798957, 
  "lng": -105.285698075852, 
  "zip": "80302"

Always free, never rate-limited

It's possible because the data is relatively small, and fits nicely in 512Mb of memory. Bandwidth usage is minimal and all API calls are heavily cached. Costs are roughly $5/month to run the service (compared to $499/year for commercial offerings).

Still don't trust the API to be around tomorrow? Host it yourself. Source code and data import scripts available on Github:

But, zip codes aren't points!

True, but for a useful approximation, the API uses the centroid of the zip code polygon weighted by the population density of the area.

I'd rather self-host the API

More power to you! Clone the entire app from Github and you'll be up and running in minutes:

Where is the data from?

Data is pulled from ZCTAs, since zip codes are "proprietary business information" of the USPS. Not all zip codes are available and the location may be inaccuarte or out-dated.