Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieving a fully qualified street address from ZIP / postal code

I have a form in which my users need to enter the following location data:

  1. Full address line (street address, apartment, suite, unit, building, floor)
  2. House number
  3. City
  4. State / province / region
  5. ZIP / Postal code
  6. Country

To simplify the completion of this form, I would like to automatically fill in the fully qualified address (addrses line, city, state province etc) by letting the user only enter his country, zip code and house number.

Is it correct that these 3 items are sufficient to lookup the address in the United States? Or is less or more information necessary? And is the answer to this question different for every country? Moreover, is there a service, API, or library that can be utilized for this purpose (e.g. Google Maps or OpenStreetMap)?

like image 763
Tom Avatar asked Apr 10 '14 15:04

Tom


People also ask

Is postalcode the same as zip code?

Zip code refers to a type of postal code and is used primarily in the United States and the Philippines. The postal code, however, is typically utilized by the rest of the countries scattered throughout the world.

Can two different towns have the same zip code?

When looking at postal codes around the world, there are cases where two different cities are served by the same postal code. For example, the zip code 94608 in California is used for both Emeryville and parts of Oakland.

How do I find a postcode?

USPS.com. To find a zip code with USPS.com, you need to fill in the fields with your USA street address, city, and state. Then click Find and you'll get your postal code. There is also a tab to get zip code for a company.

What happens to mail if the zip code is wrong?

ZIP Code™ or ZIP+4® does not match City/State. If undeliverable there, it is forwarded to the Post Office as stated by city and state.


1 Answers

Great questions!

Is it correct that these 3 items are sufficient to look up the address in the United States?

No. Unfortunately these three will get you down to ~hundreds of possible addresses in the US.

Is the answer to this question different for every country?

Yes! The postal systems from country to country vary greatly and you're users in them will have different expectations about what they expect to supply - Brits don't expect to have to enter a full address for example.

With the UK, Canada and Australia you can usually get to a single address from the house number and postcode. BUT, you can not guarantee this. There may be sub-premise information or business information which requires a bit of interaction with the user to check you have right address.

Some countries, such as France, do not have complete premise number coverage. With these you can take the premise number & postcode but depending upon the town you have to alter your behavior to either trust and accept the input or prompt them for a correction.

Another important consideration when planning your workflow is the need to allow for people who perhaps do not know their postcode / zip. It does not happen often but sometimes people have just moved, or occasionally a properties postcode/zip changes so it is important to be flexible in the information you need.

Is there a service, API, or library that can be utilized for this purpose?

Yes - there are several solutions around that offer the ability to capture global addresses. Experian Data Quality (my company) offer a hosted or on premise solution that allows for this.

Try it out here - on the right hand side under the "Do you want to know more?" you can switch countries, the prompt updates and the interaction occurs if needed.

like image 141
Al Mills Avatar answered Sep 20 '22 14:09

Al Mills