I'm guessing that there is a freebie zip code to city/state database out there somewhere. Anybody know where?
Michael Morris
Ranch Hand
Joined: Jan 30, 2002
Posts: 3451
posted
0
Hi Paul, Here's a possibility at the home of good ol' snail mail: USPS Webtools The page indicates that all services use XML. Michael Morris
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Hmmmm, This could do the trick. The algorithm could take a zip code and see if we have looked that zip code up in the past. If we have, we just use the local stuff. Otherwise, we go get the information from the post office. Not bad!
And now my requirements seem to be calling for county information too. This is some pretty static information. Maybe there is a document somewhere that contains a zip code to county mapping. In fact, maybe there's a huge text file somewhere that contains zip code, city, state and county mapping. Anybody know of such a beast?
Michael Morris
Ranch Hand
Joined: Jan 30, 2002
Posts: 3451
posted
0
Hey Paul, What'd ya mean by freebie? If you're willing to write a little code, you can extract the beast yourself. Here's a URL where you could get everything you want (assuming this site has completely accurate info) : County/Zip Lookup The first page presents you with a form with a dropdown of all US States and Possessions. That uses a GET when you push SUBMIT to fetch the next page, which presents you with another page with a dropdown of all the counties in the state you chose. Pushing SUMBIT there gives you a table of all the zipcodes in that county. This also uses GET. So all you have to do is loop thru constructing the encoded URLs and create your database by extacting the info in the tables. Heres a sample URL to list all the zipcodes in my home county: <blockquote>code:<pre> <a href="http://www.melissadata.com/lookups/CountyZip.asp?statename=Texas&county=48459UPSHUR&B1=Submit</pre rel="nofollow"><hr></blockquote>" target="_blank">http://www.melissadata.com/lookups/CountyZip.asp?statename=Texas&county=48459UPSHUR&B1=Submit[/CODE] Good luck, Michael Morris