9 ms·
Ask HN: What to use for world zip codes?
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?
- lsc 16y agoI use what came with freeside, my billing system. http://www.freeside.biz/freeside/ http://www.freeside.biz/freeside/ but it's not complete, so a better solution, if someone has one, would be great.
- po 16y agoWhat language are you using? I don't know of a datasource for it but I'm familiar with the Django project's localflavor contrib app: http://docs.djangoproject.com/en/dev/ref/contrib/localflavor/ http://docs.djangoproject.com/en/dev/ref/contrib/localflavor... You can also try searching through programmable web: http://www.programmableweb.com/apis/directory http://www.programmableweb.com/apis/directory
- niklas 16y agoHere's a few http://www.geonames.org/postal-codes/ http://www.geonames.org/postal-codes/
- sigil 16y agoGeonames is great. It doesn't get any freer than this (in both senses of the word).
- leftnode 16y agoAlso, keep in mind, don't make the Zip Code required. Some countries (Ireland being the most prominent) don't have them.
- henrikschroder 16y agoAlso, don't make state required, most countries don't have them.
- moe 16y agoGenerally 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.
- paulgerhardt 16y agohttp://en.wikipedia.org/wiki/List_of_postal_codes http://en.wikipedia.org/wiki/List_of_postal_codes
- rmc 16y agoAddress 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.
- pierrefar 16y agoAnd you can check that the address is sane using a geocoder. Both Google Maps and Yahoo! Maps have freely-accessible APIs for that.
- cianestro 16y agoI 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/geocoding-reverse.html 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.
- nfnaaron 16y agoUpvoted 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?
- Davertron 16y agoI'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).
- henrikschroder 16y agoWhat do you need the postal codes for? How are you going to use them?
- yarone 16y agoThe best resource that I know of is addressdoctor.com. See their demo here: http://www.addressdoctor.com/lookup/default.aspx?lang=en 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.