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?
views:
140answers:
4
+3
A:
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 Davis
2009-01-29 19:09:14
I may be receiving an API key from the USPS within 24 hours.
MikeN
2009-01-29 19:12:45
A:
You can get a database that maps zip code to longitude/latitude, and another database that provides longitude/latitude for all US cities. Then you could just do that on your side, without having to send out to a web service.
I've seen both these databases, but I can't remember where to find them right now. I'll poke around and try to remember to add a comment.
Jay Kominek
2009-01-29 19:09:23