79

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.

Brad Mace
  • 27,194
  • 17
  • 102
  • 148
Paul
  • 1,815
  • 5
  • 27
  • 44

10 Answers10

43

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.

AndreiM
  • 4,558
  • 4
  • 36
  • 50
31

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.
fgregg
  • 3,173
  • 30
  • 37
  • @fgregg: slightly off topic, but do you think saving the driving distance between 2 points is against the ToS? provided that clicking a nearby link will actually show a google map? – mpen Mar 15 '10 at 06:26
  • 1
    This now appears to be 10.1.1(g). –  Apr 04 '14 at 17:03
  • 2
    This now appears to be 10.4(d) – dhavald Sep 03 '15 at 19:13
  • I am not a lawyer but the ToS on section 10.4(d) says "For example, you may display Street View imagery without a corresponding Google map because the Maps APIs Documentation expressly permits this use.". I interpret that because the Maps API Documentation allows you to call it without a map, then you can use it without one. – void Mar 26 '18 at 14:38
  • 1
    They have restructured the Terms quite a bit, and now it seems that as long as you're not using a non-Google map, you can use it for other purposes without problems: https://cloud.google.com/maps-platform/terms/maps-service-terms/#3-geocoding-api – xeruf Mar 12 '19 at 12:10
27

I am both a web developer and a former employee of one of the companies you mentioned. I completely understand where you're coming from. Verifying addresses seems like a simple problem to tackle, but it's very much an iceberg. I suppose one workaround to the legal constraints of the Google or Yahoo! Maps APIs is to request your users verify their addresses on a map. If I were in your shoes, though, I wouldn't go that route.

The reason address verification services are so expensive is that they require licenses and ongoing relationships with grumpy, bureaucratic postal authorities (including the Royal Mail). Unfortunately, postal authorities are the best (and often the only) sources of data against which to verify addresses, so there really isn't any other way to go about it. The bottom line is you need to weigh the cost of bad addresses (usually a question of mail volume) against the cost of the software to verify them. Irish postal data is even more rubbish than Irish postal formats (which frequently omit building numbers), so there's little you can do about those addresses.

Adam
  • 696
  • 6
  • 16
  • 1
    Also, for small businesses interested in US-only validation, you can use some of the USPS' web services for free (https://www.usps.com/business/webtools.htm). – Adam Sep 30 '11 at 22:23
  • 5
    Note that the USPS API terms effectively restrict the service to businesses that ship via USPS: "User agrees to use the USPS Web site, APIs and USPS data to facilitate USPS shipping transactions only." If you want to ship via UPS or Fedex, or your company dispatches its own trucks/drivers - as does mine - you have to use an expensive third party. – HiredMind Dec 02 '11 at 17:45
  • of course you could ship one document a year with USPS, then you're a customer! – Dawesi Dec 28 '16 at 09:05
14

The answer depends upon the degree of confidence you place in the data and how your data is being used. For example, if you're using it for mailing or shipping, you'll want to be be confident that the data is correct. If you're just using it as another fraud-prevention mechanism then you could potentially allow a degree of error to creep into the data.

If you want any degree of real accuracy, you're need to go with a service that does real address verification and you're going to have to pay for it. As has been mentioned by Adam, address verification and validation at first seems simple and easy, but it's a black hole fraught with challenges and, unless you've some underlying data to work with, virtually impossible to do by yourself. Trust me, you're actually saving money by using a service. You're welcome to go down this road yourself to experience what I mean, but I can guarantee you'll see the light, so to speak, after even a few hours (or days) of spinning your wheels.

I should mention that I'm the founder of SmartyStreets. We do address validation and verification addresses and we offer this for the USA and international as well. I'm more than happy to personally answer any questions you have on the topic of address cleansing, standardization, and validation.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Jonathan Oliver
  • 5,207
  • 32
  • 31
  • 2
    To OP and anyone else reading this, now that it's some years after this Q was posted. I've been testing out the service from smartystreets. It seems very decent, for both US and Intl address verification. I can't vouch for the accuracy of their data (how would I confirm that?), but I have no reason to think it might be an issue. They area a commercial operating that I assume would take every measure they can to provide accurate data, since that's what their business depends on. – inspirednz Sep 07 '16 at 20:11
4

Another option is YADDRESS.

Christian Specht
  • 35,843
  • 15
  • 128
  • 182
Usarian
  • 148
  • 1
  • 5
2

Validate it against FedEx's api. They have an API to generate labels from XML code. The process involves a step to validate the address.

Anon21
  • 2,961
  • 6
  • 37
  • 46
  • 12
    Unless you plan on shipping via FedEx, you'd violate [their terms of service](http://www.fedex.com/cgi-bin/global_legal.cgi?cc=us&sc=/legal/). – Matt Feb 09 '12 at 19:54
  • 1
    ...and their address validation database sucks. – ColinM Jul 31 '14 at 21:42
0

Google basis (free) does not provide address verification (Geocoding) as there is no UK postcode license.

This means postcode searches are very in-accurate. The proximity search is very poor, even for town searches, often not recognising locations.

This is why Google have a premier and a enterprise solution which still is more expensive and not as good as business mapping specialists like bIng and Via Michelin who also have API's.

As a free lance developer, so serious business would use Google as the system is weak and really provides a watered down solution.

0

I know that this post is a bit old but incase anyone finds it still relevant you might want to check out the free geocoding services offered by USC College. This does included address validation via ajax and static calls. The only catch is that they request a link back and only offer allotments of 2500 calls. More than fair. https://webgis.usc.edu/Services/AddressValidation/Default.aspx

timeless
  • 9
  • 1
0

A great blog describing 14 address finders: https://www.conversion-uplift.co.uk/free-address-lookup-tools/

Many address autocomplete services, including Google's Places API, appears to offer international address support but it has limited accuracy.

For example, New Zealand address and geolocation data are free to download from Land Information New Zealand (LINZ). When a user search for an address such as 76 Francis St Hauraki from Google or Address Doctor, a positive match is returned. The land parcel was matched but not the postal/delivery address, which is either 76A or 76B. The problem is amplified with apartments and units on a single land parcel.

For 100% accuracy, use a country-specific address finder instead such as https://www.addy.co.nz for NZ address autocomplete.

Strydom
  • 850
  • 7
  • 6
0

You could consider using CDYNE's PAV-I API that validates international addresses. international-address-verification They cover over 240 countries, so it should cover all of the countries that you are looking to validate for.

Rahul Baradia
  • 11,802
  • 17
  • 73
  • 121