Ask HN: What to use for world zip codes?

21 points by goldham ↗ HN
I'm developing a website and need postal codes for as many countries as possible. All I need is City, State, and zip/postal code. I found zipcodeworld.com but, they're products are a lot more than I need. Wondering if anyone knows of a low cost solution?

16 comments

[ 2.9 ms ] story [ 66.4 ms ] thread
Also, keep in mind, don't make the Zip Code required. Some countries (Ireland being the most prominent) don't have them.
Also, don't make state required, most countries don't have them.
Generally don't make too many assumptions about the address format if you're dealing with international customers.

Many of the address forms on US-sites are a bit challenging to europeans because even after selecting "Other" in the State-dropdown we're still left with a bunch of input fields that don't quite fit our local address format.

Most people (including myself) are probably used to that by now and just duplicate stuff as needed (City/State) and leave others blank. But I wonder what the bounce rate amongst less savvy users is for these forms.

Address formats are different all over the world. Lots of places call them "postcodes" not zip codes (e.g. the UK). Some places have no postcodes (e.g. Ireland). Lots of places don't have 'states'. And the US has lots of 'cities' whereas lots of places would have local towns or counties.

You usually need addresses to send someone something. I'd suggest just putting in a text field and letting the user just type it in freeform.

And you can check that the address is sane using a geocoder. Both Google Maps and Yahoo! Maps have freely-accessible APIs for that.
I asked the same question several weeks ago. Google's reverse geocoding api is a great solution. Instead of inserting hundreds of thousands of records into a database and juggling different tedious validation techniques it's a much better idea to only use latitudes and longitudes for locating people geographically. However, the project's details may require other routes but still thought I would share:

http://code.google.com/apis/maps/documentation/examples/geoc...

Users just click on their location on the map and Google hands off the nearest address info.

Upvoted for the "sensible" solution of freeform, but I'd like to hear from folks who need each piece broken out, and why.

I imagine zip codes are useful for auto-filling/formatting city information.

Shipping account software?

I'd say freeform is a pretty good way to go if you don't need automated systems looking at the data. We've had issues with having specific fields for all the reasons mentioned in the comments (certain places don't have states/zips, etc.). However, we offer estimated shipping, so we have to be able to easily parse the address to send data to shipping carriers' web services (UPS, DHL), and that would be a total nightmare with freeform text. I would say making a nice interface that changes depending on the selected country would be ideal (google checkout seems to handle this pretty well).
This has been a pet peeve of mine for a very long time.

Creating a free-form address parser might be a fun project. Validating the addresses might get expensive though. Are there any low cost/free alternatives to a service like Experian's QAS?

What do you need the postal codes for? How are you going to use them?
The best resource that I know of is addressdoctor.com.

See their demo here: http://www.addressdoctor.com/lookup/default.aspx?lang=en

Via a web service, they enable you to produce the right address form fields on a country-by-country basis. I've met with their CEO in person and kicked the tires and would highly recommend them.