8 ms·
Ziptastic: Isn't a zipcode enough?
- tedyoung 14y agoI just love it when people create projects to solve problems that have already been solved before. 5 minutes of web searching would have told you: * 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.
- draebek 14y agoThe USPS already has this information 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.
- drivebyacct2 14y agoWhat a poor attitude.
- gm 14y ago* Who cares if the USPS already has it? The app developer is the one seeking it. * And USPS does not give the DB away for free. * Your attitude sucks. And your 5 minutes of searching were not enough.
- rmc 14y agoLess space than a Nomad. No wireless. Lame.
- bengl 14y agoThe whole world has postal codes. Some are simpler than others. It would be nice to see an API like this one that supported more than just one country.
- goatforce5 14y agoNot everyone does. "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." http://en.wikipedia.org/wiki/Postal_code http://en.wikipedia.org/wiki/Postal_code
- rmc 14y agoThe whole world has postal codes Nope. e.g. Ireland
- systemtrigger 14y agoVery useful. Saves the user 2 to 3 steps. In rare instances where it returns the wrong city, they can modify the returned values. Probably want to skip ziptastic for non U.S. IP addresses.
- alttag 14y agoExcept then the zip would need to come before the city/state visually, which sounds awkward for most uses.
- philfreo 14y agoWhere's the data from?
- asnyder 14y agoUnfortunately in some cases a zipcode is in fact not enough, as it's possible for a zipcode to spread across multiple towns. However, if you have a full 9 digit zipcode then you can in fact always determine. However, even if you can't always determine this information exactly, a zipcode should be enough to pre-populate these fields for you most of the time, and in those rare cases which they don't a choice can be presented of only those qualifying choices. The USPS has a pretty decent API that should allow this relatively easily.
- lisper 14y agoFor example: 94062 can be either Woodside or Redwood City or Emerald Hills.
- csmeder 14y agoYup, here the USPS response to 94062 https://tools.usps.com/go/ZipLookupResultsAction!input.action?resultMode=2&companyName=&address1=&address2=&city=&state=Select&urbanCode=&postalCode=94062&zip= https://tools.usps.com/go/ZipLookupResultsAction!input.actio...
- draebek 14y agoNote that it says "the actual city in 94062 is REDWOOD CITY." The others are merely "acceptable." For mailing purposes, at least, I understand this to mean that the USPS would prefer you to address mail items to Redwood City, regardless of what administrative entity the recipient is in (e.g. Woodside). 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.
- rblatz 14y agoI plugged in 45440, and it returns Dayton as the actual city, but Dayton is miles away. 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.
- mikhaill 14y agoJust as a note, I know that for e-commerce shopping cart forms, we specifically force users to enter their address information and zip code. 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.
- daspecster 14y agoTotally agree! The jQuery plugin that I started working on will actually just populate those fields in the form so they can be changed after the fact. Feel free to contribute! https://github.com/daspecster/ziptastic-jquery-plugin https://github.com/daspecster/ziptastic-jquery-plugin
- nodesocket 14y agoIf you are using jQuery, then why `var client = new XMLHttpRequest();` for the love of god, embrace `$.ajax()`
- k33n 14y agoThe problem with this service and smaller services like it is that they are very likely to go offline with no warning.
- daspecster 14y agoWell, one nice thing is that you can fork it on github and setup your own API server. My main goal is to change how forms on the internet are filled out and to reduce the barrier of entry for people trying to give company/people money or information.
- k33n 14y agoAh, good point, I suppose an organization could just run this internally.
- RandallBrown 14y agowhile that's true, at least in this case the fallback would just be that the user has to enter in their city and state.
- Yarnage 14y agoI'm actually impressed it came back with my correct information. On major websites including Target.com, they do not see my zip code as valid even though it's close to a decade old. Sure, it's knew in the grand scheme of things but that's crazy... 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.
- ry0ohki 14y agoMy understanding is the whole point of a zipcode is that city and state on a mailer don't matter at all. Doesn't zipcode go to a specific post office?
- Yarnage 14y agoThat is my understanding as well. The person at our local post office recommended putting the township but wasn't aware of exactly why. My suspicion is that it doesn't matter one bit but I don't know anything about the USPS system.
- daspecster 14y agoI believe to a point it matters. In high density areas there might be a few distribution centers for mail. So the 9 digit zipcode is important. Also, the address lines are still very important. i.e. 1234 mystreet st. apt #2
- DannyBee 14y agoDepends on if you mean ZIP or ZIP + 4 or ZIP + 4 + delivery point. 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)
- uptown 14y agoTheir donate page isn't using SSL.
- joshaidan 14y agoI was just about to say the same thing. I also noticed it doesn't ask you for the name on card. I'd suggest using PayPal or Google Checkout with the whole trust issue.
- nodesocket 14y agoReally bad. Use PayPal for donations.
- Klinky 14y agoNo don't, unless you're a real charitable organization. Would be better to offer a premium tier.
- elliottcarlson 14y agoDon't ever label anything as a donation via PayPal unless you have the actual documentation to back this up. Depending on your situation, your account can be locked when failing to provide the information, and worse, to be able to unlock it you have to refund the monies received and then ask for it again via a different method - if you can get it unlocked.
- rmc 14y agoTo avoid the PayPal/Donation problem, why not sell something, e.g. API docs. You pay €X and the author will send you a HTML file of the API docs. One-time, once-only price. Then you have something you sold and you can use the money for hosting, avoiding 'donation' entirely.
- hax0r2112 14y agoIf you view-source, you will notice that they are using stripe.com. This is actually a clever trick in that the form is intercepted by javascript, securely transmitted to stripe for processing, then a token is returned to the calling web site with success codes, etc needed for future billing questions, refunds, etc. The issue is that we have (rightfully so) trained people to look for the lock icon, look for https, look for the green location bar, ... Stripe goes a long way in protecting the transaction and reduce the merchant's PCI-DSS scope (really important for small merchants and large alike...), but merchants must still convince their customers that the site the customer is interacting with is safe to deal with.
- aforty 14y agoI love Twitter bootstrap but can people take a few minutes to customize the colors just a bit? Is that too much to ask for?
- ceejayoz 14y agoDoes it really matter in this sort of case? It's a single parameter, single use JSON API. The documentation is essentially a single line of text. If it was a GitHub `README.txt` file you wouldn't be complaining that it looks like every other GitHub readme.
- jack83 14y agoI think you should also add the zip boundary
- jellicle 14y agoIf you're going to do this, do the whole enchilada: zip code + person's name ought to give you their whole address for 99% of the population (hint: voter records). Well, 95%, considering such records are often out of date. The problem is this will likely spook many people - "how does this website know my street address?"
- elliottcarlson 14y agoBesides spooking people out, they may not be using their residential address in the case of a shipping address and at times billing addresses. We regularly have a customers shipping address be their office and (surprisingly) it's not uncommon to see P.O. Boxes for billing addresses.
- ben1040 14y ago>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.
- brigade 14y agoMore sites need make good use of every publicly available record, as well as everything that can be inferred from them. 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.
- rscale 14y agoAre you aware of a voter registration database that's reasonably complete and up to date, and doesn't cost a ton of money to access? I'd love one for a current project, but my initial research seemed to indicate the only solutions were priced out of our budget (either in straight dollars, or in the man-hours to cobble together multiple sources).
- jellicle 14y ago
- lubujackson 14y agoMy big pet peeve is when they ask you what type of credit card you're using, when that is easily determined by the first four digits of the CC number. Thankfully, more and more web sites are figuring this out.
- Domenic_S 14y agoEven less than that -- if the card # starts with "4", it's Visa; 36|37 is Amex; 5[1-5] is MC and so forth. Totally with you, why do I have to choose from a dropdown -- you already have my number!
- toomuchtodo 14y ago6 is Discover
- talmand 14y agoI've never understood why that information is required at all in the first place. I can see the usefulness of showing which credit cards the site accepts but to force the visitor to choose one seems wasteful.
- alttag 14y agoI think it's a round-about way of saying "We don't take (American Express|Discover|Diner's Card|whatever)" without actually saying it. Modern processors accept just about everything nowadays, but this was less common even a few years ago.
- bostonvaulter2 14y agoI think there is a very good reason to do that — sites that don't accept all credit cards. I don't want to sit there typing in my American Express card number only to find out that it is not supported afterward. Now the sites that have a nice little pop-up showing me the detected card type are really nice and give me a nice warm and fuzzy feeling after giving them my card number.
- krobertson 14y agoI love APIs. One recommendation though would be to change the server response slightly for the API call. In Chrome, it had me download a file instead of showing the response in the browser. I think it might be because the response has a Content-Type "text/json" instead of "application/json". http://stackoverflow.com/questions/477816/the-right-json-content-type http://stackoverflow.com/questions/477816/the-right-json-con...
- daspecster 14y agoThanks! Change made. https://github.com/daspecster/ziptastic/commit/de2cf83274b81dcefe4c15b5747c2b1c5ed95b01 https://github.com/daspecster/ziptastic/commit/de2cf83274b81...
- Splines 14y agoThere's a neat interactive version of the same thing here (Java required): http://benfry.com/zipdecode/ http://benfry.com/zipdecode/
- joshstrange 14y agoI went ahead and setup http://ZiptasticAPI.com/ http://ZiptasticAPI.com/ instead of using GET you just add the Zip code to the url ex: http://ZiptasticAPI.com/40504 http://ZiptasticAPI.com/40504 all the code is on github https://github.com/joshstrange/Ziptastic https://github.com/joshstrange/Ziptastic I just wanted something a little cleaner and without using GET.
- daspecster 14y agoFeel free to fork it on github!
- oellegaard 14y agoWould love to see a cross-country solution here. Data should be available for free in every contry that actually use postal codes.
- daspecster 14y agoI agree, it's in the plans and on my trello board.
- rmc 14y agoI'm not sure if this is supposed to be USA-only or not. It seems to ask for 'country', so I assume it's aimed at the whole world. 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.
- wmboy 14y agoYeah this doesn't work at all if you live outside USA. The post code for Auckland CBD (in New Zealand) is 1010. So if I try http://zip.elevenbasetwo.com/?zip=1010 http://zip.elevenbasetwo.com/?zip=1010 It gives: {"country": "US", "state": "MA", "city": "BRIMFIELD"}
- jwn 14y agoI'm guessing it's a leading zero problem, since all US Zipcodes are 5 digits (or nine). Going to http://zip.elevenbasetwo.com/?zip=01010 http://zip.elevenbasetwo.com/?zip=01010 gives the same response noted above.
- damian2000 14y agoSame for Australian zip codes e.g. 2000 (Sydney) returns a 404 (doesn't exist)
- BryanB55 14y agoDespite the mentioned problems with this method I still think it is a great start and should be implemented more often. The U.S. GDP is three times larger than any other economy, there is no doubt that for a lot of sites, US addresses are the norm. Even if it is not 100% accurate it would still be nice to pre-populate fields and let the city be changed if it is incorrect.
- geuis 14y agoI fucking love this. I know that it doesn't work for a lot of people outside of the US, but with some modification it can definitely work for certain countries and communities. Fork and individualize to your needs. 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.
- rscale 14y agoI tried this many years ago, and it decreased conversion. 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.
- gbaygon 14y agoWhen you query for an inexistent postal code (i.e. http://zip.elevenbasetwo.com/?zip=101 http://zip.elevenbasetwo.com/?zip=101) 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/7284cb2e4f8631616aa5bd79f6f3804e6c7a176c https://github.com/gbaygon/ziptastic/commit/7284cb2e4f863161...
- mgkimsal 14y agoI know it's been xerox-ed beyond original usage, but ZIP is an acronym - http://en.wikipedia.org/wiki/ZIP_code http://en.wikipedia.org/wiki/ZIP_code - "Zone Improvement Plan". Bugs the heck out of me that people don't treat it as an acronym. I have spoken. That is all.
- stan_rogers 14y agoIf we're going to be unnecessarily pedantic, the canonical phrase is: "Ah has spoken!" ( http://en.wikipedia.org/wiki/Lil_Abner http://en.wikipedia.org/wiki/Lil_Abner )
- icodeforlove 14y agodoesn't google do this too? http://maps.googleapis.com/maps/api/geocode/json?address=48867&sensor=false http://maps.googleapis.com/maps/api/geocode/json?address=488...
- deleted 14y ago[deleted]
- icodeforlove 14y agogot it, so all you need to do is provide a little map next to the form to avoid breaking their TOS
- jarek 14y agoAs a super-fancy bonus, that also works for non-U.S. codes. Though yes, TOS will definitely be a concern for commercial use.
- adeelk 14y agoI got 404 for my German code.
- pbreit 14y agoIs the fact that so few sites actually implement this behavior evidence that it's not as beneficial as it seems? Would be nice to see a complete, "best-practice" implementation.
- runjake 14y agoFull ZIP codes are actually 9 digits: a 5 digit prefix, which is what people are used to -- and a 4 digit "block" extension. Each city will typically have many block extensions, and probably multiple prefixes associated to it.
- gergles 14y agoFull ZIP codes are actually 11 digits: a 5 digit prefix, a 4 digit delivery-route-location code, and a 2 digit delivery point number. This 11 digit number uniquely identifies every single place the USPS can deliver mail.
- sureshv 14y agoPlus it's not cheap to implement a proper address coding system that conforms to USPS let alone the rest of the world. The USPS data alone is around $4k per year to license (it gets updated every couple months.
- mbell 14y agoI use this database in my apps to solve exactly this problem (US only): http://federalgovernmentzipcodes.us/ http://federalgovernmentzipcodes.us/ 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.
- gregable 14y agoYes, it seems like the dataset is so small that one should just download the whole thing and periodically request diffs. Less total bandwidth for everyone, more reliable, and a nice user latency win as well.
- deleted 14y ago[deleted]
- smiler 14y agoAlso zip (postal code) information is not in the public domain in the UK. It is a commercial database which you can licence from the RoyalMail or probably a reseller.
- za 14y agoYes. You can get a coordinate - postcode list though: http://www.ordnancesurvey.co.uk/oswebsite/products/code-point-open/index.html http://www.ordnancesurvey.co.uk/oswebsite/products/code-poin...
- dap 14y agoI'd prefer the opposite. I don't find the OP's "problem" that annoying, but I frequently send stuff to family and friends whose addresses I remember but whose ZIPs I can never keep straight, and it would be great if forms auto-filled that part.
- latch 14y agoHong Kong has no zip or postal code. It's frustrating whenever a system requires these fields (which a lot do, though "HK" generally works).
- overworkedasian 14y agough. how about you put some HTTPS on your credit card donation page?
- justanother 14y agoConsider 33042, "Summerland Key." This ZIP code covers several other Lower Florida Keys, including Cudjoe Key and Upper Sugarloaf Key. "Summerland Key" is technically correct, since the post office is on that island, but people on the other islands will _never_ write "Summerland Key" as their address, preferring instead to use the ("acceptable") name of their island instead. I'm sure this situation is not unique to the Florida Keys, and I therefore doubt the usefulness of resolving city and state from ZIP code outside of them there fancy big cities.
- Jarred 14y agoDo most webapps and startups ask for a zipcode as part of the signup process?
- mapster 14y agoWouldn't a one to many look-up table suffice? X County, Y State = N1, N2, N3... zipcodes