Developing address validation for the application

I am planning to develop address validation for users logging into my application. Checking by zipcode and status is possible.

Any idea how to handle addresses from all over the world?

Do I need to insert all zipcodes into the database and then check the address. Any possible suggestion for implementation?

Thanks and cheers :) Krisp

+1


source to share


6 answers


Since there is no international standard for postal codes and the list of all postcodes in the world will be out of date before you finish it, I suggest using a smaller approach:

Identify the countries that you will need to process the most and develop separate validation rules for each one. Make sure you handle the vast majority of your users with this (eg 95% or 98%). For all other countries, just accept what they enter without further verification.



There are so many different address formats in the world that it is simply not worth the effort (if at all possible) to handle all of them.

+3


source


There is a MASSIVE variance between address and postcode formats, so there is no "standard" way to do this. See " Frank Compulsive Guide to Postal Addresses " ...



How much / what kind of validation do you really need? For example, if a user enters their delivery address, they are more likely than you know what specific format they need from their local postal / delivery provider. Just give them a multi-line text area to enter it. If you need parts of it to calculate shipping costs, only ask for the information you need (e.g. city / country)

+2


source


Postal codes can really be a headache because they can represent very small areas in some places, unlike the US, where they often represent relatively large areas (except in a large city, where they can represent multiple blocks).

Look at Canada, their postal codes can indeed represent very very small areas. Two shops on opposite sides of the street often have different Canadian postal codes. Also in the list of Canadian companies, when the list is merged, it is not uncommon to see the same address with a slightly different postal code. It just indicates that many people are wrong. On a client basis, I don't know how realistic it is that they actually get their exact zip code.

http://www.columbia.edu/kermit/postal-ca.html

Basically, it seems like every apartment or business residence can get its own zip code, which would make sense depending on what I've seen with Canadian business addresses.

Another thing is that this is only Canada. Each European country will have its own address / post code, as will Australia, Russia, etc. If you really want to do address verification, this is a big project.

To check the address you need to check the postcode, city and street. In the United States, the census releases TIGER database files, which often have a list of streets. But for other countries, I don't know how you can get the list of streets. Your best bet is to look into a commercial package (perhaps one of the GIS packages, although many only offer detailed addresses for the US / Canada and sometimes several European countries).

0


source


A perfect address check cannot be accurately put into an already developed application, however, a zip / postal code check can be performed according to the country name.

Please check regex from addalData.xml file from xml-files source . By parsing the xml you can find the corresponding postal code regex for the country code passed at runtime, where you can check if it matches the country.

0


source


Found another answer to this: please go to the wiki link: http://en.wikipedia.org/wiki/List_of_postal_codes .

You can find most of the zip code patterns of most countries here from which you can write regex and maintain in the database, which will help you check the zip code easily, and also an optimized approach!

0


source


As mentioned earlier by many users, verification of international addresses is basically impossible because there are no standards in different countries and in many countries there are no resources for their postal system. Technically speaking, even in the United States, the USPS is struggling.

At a minimum, you can offer address verification in each country. One of the simplest countries where you get a lot of attention is in the USA. To do this, you need to connect to the address verification web service. There are several companies that have web services for this. One thing to be careful about is to ensure that each provider has their API geo-mapped to ensure that any failures from their end don't come back to you and kill your application. Other than that, just make sure the results are CASS certified.

In the interest of full disclosure, I am the founder of SmartyStreets. We have an address validation web service API called LiveAddress. You can contact me personally if you have any questions.

0


source







All Articles