Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Address validation using Google Maps API

I have a task to validate addresses entered into a system I am currently creating. The system requires that address entered are validated against a valid data source. In the UK the dataset comes from the Royal Mail and is expensive to access.

The data needed is post code info for the whole of europe to start with accessed by an API into the web application.

There are a number of companies that offer this service,

  1. QAS
  2. Capscan
  3. Postcode anywhere

These all offer the service I require. However this is expensive and in some cases not a complete data set. e.g. not Ireland

I was also wondering if there would be a way to utilize the Google Maps API to validate this data via postal code and country.

Would the google maps method be possible or do I have to go down the line of one of these expensive companies? Any thoughts on what line I should take.

like image 814
Paul Avatar asked Mar 25 '09 15:03

Paul


People also ask

Does Google Maps validate address?

While Google does a great many things, it may surprise you to learn that Google does NOT parse and/or standardize addresses. In fact, Google Maps doesn't even validate the addresses they show you. Google's mapping API suite is impressive, but isn't perfect, and there are a lot of things it doesn't do.

How do I create an autocomplete address field in Google Maps API?

First, enable Google Places API Web Service. Get the API key. You will have to use it in the script tag in html file. Use script file to load the autocomplete class.

Is Google address lookup API free?

Even though the Google Maps API is free, it does not actually validate addresses, AND it comes with some pretty restrictive terms of service. So, if real address validation is what you need, you may want to read our review on how to choose an address validation provider.


2 Answers

The answer probably depends how critical it is for you to receive support and possible customization for this service.

Google can certainly do this. Look into their XML and Geocoding API's. You should be able to craft an XML message asking Google to return Map coordinates for a given address. If the address is not found (invalid), you will receive an appropriate response. Here's a useful page: http://code.google.com/apis/maps/documentation/services.html#XML_Requests

Note that Google's aim in providing the Maps API is to plot addresses on actual maps. While you can certainly use the data for other purposes, you are at the mercy of Google should one of their maps not exactly correspond to your legal or commercial address validation needs. If you paid for one of the services you mentioned, you would likely be able to receive support should certain addresses not resolve the way you expect them to.

In other words, you get what you pay for ;) . If you have the time, though, why not try implementing a Google-based solution then going from there? The API looks pretty slick, and it's free, after all.

like image 58
AndreiM Avatar answered Oct 09 '22 06:10

AndreiM


Google's geocoding api does what want you want. As Xerus points out, as long as you are not using the geocoded points on a non-google Map, you should be good (terms of service). Specifically,

3.1 Use without a Google Map. Customer may use Google Maps Content from the Geocoding API in Customer Applications without a corresponding Google Map.   3.3 No use with a non-Google map.  Customer must not use Google Maps Content from the Geocoding API in conjunction with a non-Google map. 
like image 38
fgregg Avatar answered Oct 09 '22 08:10

fgregg