Ziptastic: Isn't a zipcode enough?
daspecster.github.com
daspecster.github.com
And here's where reality disagrees with your simple organisation.
* First "zip code" is mostly an American term, "post code" is used in other anglosphere countries.
* Not all countries have "everyone is in a city" model, this seems to happen in the USA, where 'city' is often an administrative division, and you can have a city of 1,000 people. "County" would be used in Ireland & UK.
* In some places Country = State, e.g. Ireland. The law & Consitution there consistantly refers to 'Irish State'. Likewise the European Union has 27 member states. Each State is a Country. (Some States (e.g. UK) are made up of several countries).
* Some places don't have post codes (or zip codes) at all. (e.g. Ireland).
Addresses are hard.
So if I try http://zip.elevenbasetwo.com/?zip=1010
It gives: {"country": "US", "state": "MA", "city": "BRIMFIELD"}
Eh? The GDP of the European Union is larger than the USA.
(A lot of this now hinges on how you defined 'country' or 'economy'. I'll point out that most law comes from european level and EU passports say "European Union" on the front :P )
The same is true in some European countries; for example, Austria is a member state of the EU, but its subnational entities (Länder in German) are conventionally called states in English also.
Fun fact, Ireland has provinces (4 of them). However they aren't used for addresses, only for sports or cultural reasons. So Dublin (the city) is in the State of Ireland, and the Province of Lenister. Sometimes the web forms will have a field saying "State/Province", and I wonder which to put in.
(And no, Ziptastic doesn't work for French postal codes.)
The reason for this is that the USPS can change the zip codes without warning (and furthermore, leaves some areas undefined), whereas the Census needs reliable boundaries and fixed geographic areas.
The USPS has a pretty decent API that should allow this relatively easily.
This is completely non-useful if you are trying to get residence addresses. Among other things: 1. There are plenty of places in the US where the zipcode serves an area many miles (IE 20+) away from the "city" associated with the zip code.
2. Postal boundaries do not match a lot of boundaries, and aren't updated as often. There are times when, for example, zip codes for towns in maryland were served from DC. So if you did reverse lookup on zip code, it would give you the wrong state and city.
This still happens near boundaries of states.
3. ZIP+4 does not solve these issues with enough accuracy (It's only about 95% accurate). ZIP+9 is still wrong about the city in plenty of cases.
https://tools.usps.com/go/ZipLookupResultsAction!input.actio...
Of course, if you're using the information from this API for purposes other than mailing, such as providing an address for verification along with credit card processing, I suppose your processor won't like seeing Redwood City if the cardholder has Woodside on file.
It returns a bunch of other cities as acceptable, but those are the ones that are actually located in that zip code. I'm curious as to what all of this returned data actually means.
Totally with you, why do I have to choose from a dropdown -- you already have my number!
Modern processors accept just about everything nowadays, but this was less common even a few years ago.
No idea who runs it but its updated regularly and has never caused issue (so far). It includes both the USPS preferred city and all possible cities so you can either default to preferred or provide at least auto complete. Its also has all the military addresses and as well as lat/long, which is a bonus.
I can see the ziptastic concept being interesting if it was fully international but for just the US it takes about 15 minutes to download the linked csv, toss it in a DB table, and write the 3 queries you need. I don't understand the need for a service to handle such a simple task.
* The USPS already has this information
* ZIP codes are not precise enough to provide a single city/town result (in fact, many web sites already get this wrong).
* ZIP+4 codes will give you block-level detail, but I doubt more than a few percent of people know what their +4 digits are.
The USPS does have this information, but when I checked a year or two ago, you either have to (1) agree to use the information only for purposes of mailing packages, per their TOS; or (2) pay them, e.g. something like $500 for a list of all five digit ZIP codes plus associated cities and states (the "City State File").
Corrections very welcome!
Edit to add: As philfreo asked, I'm also very interested in knowing where the data in zipcodes.db comes from.
* And USPS does not give the DB away for free.
* Your attitude sucks. And your 5 minutes of searching were not enough.
No matter what you think, users aren't paying attention to what they enter in the forms. Forcing them to enter their address and zipcode allows you to do a cross check to make sure they entered everything correctly.
You may find it annoying, but when it prevents people from ordering items to the wrong address, it's a pretty useful extra field.
Feel free to contribute! https://github.com/daspecster/ziptastic-jquery-plugin
http://stackoverflow.com/questions/477816/the-right-json-con...
I have spoken.
That is all.
the page returns "404" as content but the response header is "200 OK".
That is inconvenient, and RESTfully wrong.
UPDATE: added pull request https://github.com/gbaygon/ziptastic/commit/7284cb2e4f863161...
REST != HTTP
The problem is this will likely spook many people - "how does this website know my street address?"
I requested a car insurance quote from Progressive, and the first form in the process asked for my name and street address. After that, it gave me a list of the vehicles I owned and asked which one was I inquiring about.
I know that these are public records, but it still seemed a little creepy to me.
Maybe if more people get creeped out, they'd understand how scary the modern age is and we'd get finally get some decent privacy laws.
http://www.politicalforce.com/ods_tutorial
Of course the same data (better!) is available from the big consumer database vendors as well.
Present a blank form with the usual fields: Name, Address, Birthdate, and so on. The user fills in whatever information they want, and the software uses multiple data sources to infer the missing information and fill in the missing boxes as the user types. Each character or field might be colour coded according the conditional probability of its being correct, or a drop down menu may appear once the number of alternatives is manageable.
Bonus points if the software can solve the inverse problem: Given an identity and partial information, what is the minimal required set of publicly available information required to establish a unique identity.
Edit: fix grammar
Aren't most of the electoral register lists only legally allowed to be used for certain purposes? You might run into legal trouble if you were to use them like this.
Then you have something you sold and you can use the money for hosting, avoiding 'donation' entirely.
Anyway, I agree with the others that while this is nifty it won't always be accurate for everyone. For instance my township is contained within a very, very large county so typically mail is addressed to the specific township rather than the county. I do not know how or if that could even make a difference but our local post office has suggested it.
Overall pretty interesting idea. I think using this plus a way for users to validate the information found it could be useful. The only thing I would be wary of is the website is technically sending a third party the user's information. Your service could then build up information regarding a website's typical customer. Probably not something to worry about but I know most of the places I've worked at they WOULD NOT allow this; they downloaded their own offline zipcode lookups.
EDIT: Perhaps a way to download and get offline updates would be helpful especially if your website went down.
My suspicion is that it doesn't matter one bit but I don't know anything about the USPS system.
ZIP alone will route to a post office, but here are a significant number of areas where city is needed to further disambiguate due to duplicate street addresses in a delivery zone. Now, they obviously try to avoid this, but it still happens.
ZIP+4 would obviate the need for city, state.
ZIP + 4 + delivery point would obviate the need for everything :)
(The need for delivery point is because even a single address may have multiple mailboxes, etc)
"In February 2005, 117 of the 190 member countries of the Universal Postal Union had postal code systems. Countries that do not have national systems include Ireland and Panama."
Nope. e.g. Ireland
Each city will typically have many block extensions, and probably multiple prefixes associated to it.
My partner and I are currently working on a startup where location is everything, and we're very much on top of trying to make it as fucking simple as possible to do the basic tasks. Don't annoy the people that might give you money, as it were.
This will be a very useful tool in our belt.
Would be nice to see a complete, "best-practice" implementation.
http://maps.googleapis.com/maps/api/geocode/json?address=488...
I'm not sure if this is still true, but apparently the surprise of a slightly unconventional form threw some people off, as it increased cart abandonment compared to a typical form.
If you're going to use this, please check to see if it actually provides a benefit to your users.
If it was a GitHub `README.txt` file you wouldn't be complaining that it looks like every other GitHub readme.