Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get state and city information from a US zip code through an online web service? [closed]

I want to be able to give a best guess for what city and state a zip code is in via a web application. Is there some web service I can use to figure this out?

like image 907
MikeN Avatar asked Jan 29 '09 19:01

MikeN


People also ask

What is a ZIP code centroid?

The ZIP Code Population Weighted Centroids allows researchers and analysts to estimate the center of population in a given geography rather than the geometric center. Data to estimate ZIP code centroids is extracted from administrative USPS address data.

Do states share ZIP Codes?

ZIP codes can and do cross state lines (rarely, but just enough to cause some problems and confusion), county lines (about 10% of ZIPs are in more than one county), political jurisdictions (cities, congressional districts), metro areas, etc.

Can two cities share the same ZIP code?

When looking at postal codes around the world, there are cases where two different cities are served by the same postal code. For example, the zip code 94608 in California is used for both Emeryville and parts of Oakland. One postal code, two cities.


2 Answers

Hate to do this to you, but look here...

I believe the USPS has an API for some queries, you should look into that.

However, here are a few from the above resource:

  • http://www.cedar.buffalo.edu/AdServ/zip-search.html - Includes the database so you can host one yourself
  • http://www.zipinfo.com/search/zipcode.htm - commercial site, but they have a simple search
  • http://zip4.usps.com/zip4/citytown_zip.jsp - USPS interface, probably has an API
  • http://www.webservicex.net/uszip.asmx?op=GetInfoByZIP - SOAP interface

-Adam

like image 108
Adam Davis Avatar answered Oct 21 '22 11:10

Adam Davis


The USPS has an API for this, but you have to register:

USPS Web Tools

like image 29
Jeff Avatar answered Oct 21 '22 11:10

Jeff