

Plenty Of Zip Codes For Form Auto-Completion - gulbrandr
http://www.zippopotam.us/

======
caoimhin
Not everywhere has postal codes, please do not require them.

Love,

People-in-Ireland-tired-of-typing-fake-postal-codes

~~~
duck
In theory, with an api like this you could easily figure that out and then
customize the fields as needed.

------
jgv
I wrote a gem for postal/area codes in the US that does mostly the same thing
w/o the web request <http://github.com/jgv/area>

------
ComputerGuru
Looks good. Just like ziptastic and all the others, but with international
support. That's a real advantage.

I've always wanted to use such a library for my checkout forms and whatnot,
but unfortunately it doesn't fit the typical UI paradigm.

If you _need_ the address info, you'll (almost) never ask for the zip code
before the city and state, so the information has already been filled in
before the user gets that far... and the country comes last.

Users are used to entering the address info in that natural order: street,
city, state, zip, country (usually pre-set to your biggest userbase). I think
the cognitive overhead of mixing that order up actually exceeds the effort of
having them fill in all 3 fields.

The only place I could see you using something like this is if your are
tailoring your services to a US-only userbase (so you can guarantee that a zip
code is there and that the other info will not need to be manually entered).
For example, we use ziptastic (at the server side for cross-domain reasons) at
<http://gastomorrow.com/> which is a US-only service to guess the price of gas
tomorrow in your area.

~~~
fnordfnordfnord
At least one user, me, is tired of your "typical UI paradigm" and tired of
entering redundant information. 1\. Ask for country (if not known) allow user
to override if it was automatically detected. 2\. Ask for zip, or other
country specific postal code. 3\. Look up zip. Fill form in with details.

------
manuelflara
I find this very interesting, just being now into internationalizing a site of
my own which requires specially this. One question for UK residents: is lack
of "out codes" a problem?

Also, to the author(s) of zippopotam.us, if they're reading: \- How can we
trust you're not going away any time soon? I don't see any pricing, so I
assume this is all free? \- Related to the first point, I assume you don't
want to be used by any high traffic site, since you probably don't have a lot
of server power behind this. What's the plan?

~~~
thisone
What are you trying to do with the UK postal codes?

Address lookup or just validation?

For validation, there's an official regex (archived, but still useful)
[http://www.cabinetoffice.gov.uk/govtalk/schemasstandards/e-g...](http://www.cabinetoffice.gov.uk/govtalk/schemasstandards/e-gif/datastandards/address/postcode.aspx).

For address lookup there are a couple of ways to go about it.

1\. You can buy the rights to the Royal Mail's database. You get to parse the
sucker yourself. <http://www.poweredbypaf.com/end-user/products/paf-raw-data/>

2\. You can use a third party system, either over the web, or choose a
solution you can host internally. Depending on the type of system you buy you
pay by the lookup or by the user (mostly internally hosted systems).

~~~
michaelt
You can get postcode/easting/northing for free using Ordnance Survey's Code-
Point Open product [1]. That'll let you check a postcode exists, but it
doesn't help with address auto-completion, as it doesn't give you a street
name.

[1] [http://www.ordnancesurvey.co.uk/oswebsite/products/code-
poin...](http://www.ordnancesurvey.co.uk/oswebsite/products/code-point-open/)

------
rplnt
For Slovakia, the db doesn't seem to be complete. When I was looking for some
source, I've found one one that has almost the same number of rows and also
misses the ones I tried to find. There was also packed a db that is more
complete and it might be a great idea to process and use that one. Both can be
found here: <http://www.posta.sk/subory/322/psc-obci-a-ulic.zip> (zip contains
2 xml files)

~~~
samirahmed
In case your intention is to contribute zip codes, please go through the
github repository <https://github.com/crowell/zippopotamus>

------
lvh
I currently use Geonames to map ZIP codes to locality names, and find nearby
ZIP codes/localities given a ZIP code. Can you explain why your service is
preferable for me?

~~~
samirahmed
Not every website wants to go through the effort of collecting zip codes. We
used geonames as our primary seed and its a great source but it isn't free.

------
fnordfnordfnord
Thank you to whomever did this. I'm always annoyed by any form that wants my
zip and city and state. Why? Once you have the zip, then you have the city and
state.

~~~
ceejayoz
Some zip codes have more than one municipality within them.

For example:
[https://tools.usps.com/go/ZipLookupResultsAction!input.actio...](https://tools.usps.com/go/ZipLookupResultsAction!input.action?resultMode=2&companyName=&address1=&address2=&city=&state=Select&urbanCode=&postalCode=21702&zip=)

~~~
svachalek
The Cupertino zip code (95014) also brings up Monta Vista and Permanente, but
I've never seen these two "cities" on a map nor met anyone who claims to be
from there. I don't know if this is some artifact in the USPS database or they
know something I don't.

------
127001brewer
If anyone is interested in developing a similar service, then you can use the
(free) zip code information provided by the US Census Bureau:

<http://www.census.gov/geo/www/tiger/zip1999.html>

However, please note that some information may be outdated. The US Postal
Service now maintains the zip code data sources, but I'm not sure if you must
pay for it.

------
advisedwang
UK post codes are two part, something like A1 1AA. A1 identifies a geographic
area, 1AA identifies a set of postal address in that area (its designed so
each post code gets roughly the same amount of mail, so big organisations have
an address to themselves).

Zippopotam.us only seems to deal with the first part, which is only of
marginal utility.

------
yahelc
The JavaScript example uses CORS, which doesn't have universal browser
support. (Older Opera, Old IE: <http://caniuse.com/cors>)

Any reason there isn't JSONP support?

------
namdnay
Spelling mistake in the header of the country-specific pages: Zippoptamus
(e.g. <http://www.zippopotam.us/static/sample_us.html>)

------
vijayr
best name ever :)

------
richardofyork
Thanks, Mate.

