I was a computer science major in college. I realize it would be trivially easy for someone to write a script to automatically enter someone’s state after they type in their ZIP code. In fact, a few sites do have this feature. My WAG is that this feature is patented, and the owner does not want to license it at all.
It is not that it is patented but the lookup does require the full Zip Code table and can be more cumbersome than it is worth. There are some free javascripts out there to do the code part of the job and free zip code tables. Many site just don’t seem to think it is worth the bother. This includes a company I use to work for.
While it might be trivial to write the software to access a database of zip codes, it is the overhead that’s involved that would delay things. There are 30K-40K zip codes in the US, and from a website that uses JavaScript it would need to download all of that to make it resident client side. There are also new zip codes so the database would need to be updated. Most websites that use third-party software for forms would require custom programming to add the Zip code look-up. The inconvenience to the user filling out the form is very small. It isn’t like they are being asked for information they don’t know the answer to or would have to look it up themselves.
I’ve filled out several where the state automatically popped up after I filled in the ZIP code.
Since the data is free from the Post Office, and the data is often the most expensive part of this sort of thing, I’d think it would be fairly cheap to do.
Ahhh, but the data is NOT free from the post office. The post office will be happy to sell you the data, but they don’t give away the data. (You can look up an individual zip code for free, but the full file is not downloadable.)
I used to work at Blockbuster, and if I remember correctly ZIP code lookup happened automatically when one typed in one on the customer edit screen. It was astonishingly high-tech for what was otherwise a very antiquated, DOS-based system.
It is available free though from many sources. I know, I looked into it and used it for sales commissions at one point.
It helps to have both as a check for an incorrect ZIP code. It’s not a great check, but it’s something.
Looking up the ZIP code, could be used to fill in the city as well as the state. ISTM I’ve seen this sometimes.
Only the first two digits are needed to lock onto the state, of which there are only 100 combinations… A few rare instances where three digits are required, like 71*** can be in LA or AR…
Wouldn’t work where I live. My zip code encompasses 3 different city names.
It works everywhere, because the city name is determined by the zip code. There are no zip codes divided into different city names. Some zip codes have alternate city names in addition to the primary city, but they’re all correct for the entire zip code.
And thus we see the issues behind the OP:
It adds complexity (which equals cost) to the website or app.
There are always special cases in any data that maps to the real world that make the complexity greater than a naive businessperson will expect. 90% of the programming (and bugs) come from handling the special cases.
It provides some small measure of redundancy which reduces expensive shipping errors.
It makes internationalization more difficult.
And the real kicker: You’re asking the company to bear cost for zero benefit to itself. The benefit, if any, is tiny and accrues *only *to the user.
True, but if I tell you I live in zip code 66220, your software had better not insist that I live in Lenexa, Kansas (the ‘default’ city) when I really live in Shawnee, Kansas (also a recognized city name for this zip code). The mail will get to me under either city name, but these are legally distinct cities, and not tiny hamlets either (they both have populations over 50,000). The geography of the area is such that many carrier routes wander back and forth between several towns, and I think every zip in the area has multiple acceptable city names. However, people tend to get snarly with companies that insist on using a different city name, and that’s not good public relations.
If you want up-to-date data, you have to pay for it one way or another. None of the free sources are both free for commercial use and regularly updated. (USPS changes at least a few zip codes pretty much every month; most of the free zip code databases are several years old, and some date back more than a decade.)
It would also be nice if such sites recognized that not all humans have a ZIP code. Some of us Americans, even (living abroad). Sometimes you can enter 00000, but often you have to either a lie. I’ve gotten mail where I stuffed the province and post code on line 2 of the address, and but in the ZIP code for Blaine, WA (on the border, where presumably the postal workers are aware of BC).
No, actually the main post office name is determined by the first few digits of the zip code *. If you address my mail to “myaddress post office name, NY myzipcode” , I will eventually get it. Even though that is not the standard way to address something to me. But it may very possibly take a detour to a similar address in the area that the main post office is named for. And none of them are the actually the “city name” as Queens is a part of NYC, but only Manhattan mail is addressed New York , NY. People who don’t live in Jamaica or Flushing tend to get annoyed when their mail is addressed that way.
*For example, Queens, NY has
114XX Jamaica
113XX Flushing
111XX Long Island City ( Includes Rikers Island , a piece of the Bronx that gets mail service from Queens.
110XX Floral Park (includes parts of Nassau)
116XX Rockaway
Quick background info: ZIP codes are not regions, they are carrier routes. They can cross political boundaries, including state lines, and be non-contiguous. ZIP Code Tabulation Areas (ZCTAs) are conversions of ZIPs into actual boundaries.
I believe the real question is not why a script cannot (or will not) look up the city, state from a given ZIP. The real question is why the post office requires city and state in the first place, given a ZIP.
I dont know many that cross state lines.
But entering the state is also useful if you mistyped the Zip.
Can you list a source for a complete, up to date database that doesn’t bloat your page to include and doesn’t make your money-making page reliant on a third party website staying up? Looking up zip codes actually requires a good bit of storage and computing effort, plus some way to keep it up to date automatically, or requires relying on someone else’s free website, neither of which are really completely ‘for free’.
Because if you don’t have city and state, then a single mistyped, distorted, badly printed, marked over, or otherwise not correct digit in the zip code means the letter can’t get to its destination, but with city and state it’s pretty much guaranteed that someone can figure out where the letter is supposed to go.