GET http://ziplocate.us/api/v1/80302
{
"lat": 40.0218407798957,
"lng": -105.285698075852,
"zip": "80302"
}
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:
github.com/nathancahill/ziplocate
True, but for a useful approximation, the API uses the centroid of the zip code polygon weighted by the population density of the area.
More power to you! Clone the entire app from Github and you'll be up and running in minutes: github.com/nathancahill/ziplocate
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.