Address validation using Google Maps API

206,553

Solution 1

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.

Solution 2

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.

Solution 3

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.

Solution 4

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.

Solution 5

Another option is YADDRESS.

Share:
206,553

Related videos on Youtube

Paul
Author by

Paul

@PaulKinrossGray

Updated on July 05, 2022

Comments

  • Paul
    Paul almost 2 years

    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.

  • mpen
    mpen about 14 years
    @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?
  • Adam
    Adam over 12 years
    Also, for small businesses interested in US-only validation, you can use some of the USPS' web services for free (usps.com/business/webtools.htm).
  • Jonathan Oliver
    Jonathan Oliver over 12 years
    I've attempted to use that and the data is extremely old. The AJAX version has also been broken for quite sometime.
  • HiredMind
    HiredMind over 12 years
    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.
  • Matt
    Matt over 12 years
    Unless you plan on shipping via FedEx, you'd violate their terms of service.
  • Martin T.
    Martin T. almost 11 years
    Note that this service has been discontinued since March 2013.
  • Admin
    Admin about 10 years
    This now appears to be 10.1.1(g).
  • ColinM
    ColinM almost 10 years
    ...and their address validation database sucks.
  • simon.watts
    simon.watts over 9 years
    USA only? Failed on my business address (UK), and does not include a Country field in the decomposed address.
  • dhavald
    dhavald over 8 years
    This now appears to be 10.4(d)
  • inspirednz
    inspirednz over 7 years
    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.
  • Dawesi
    Dawesi over 7 years
    of course you could ship one document a year with USPS, then you're a customer!
  • void
    void about 6 years
    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.
  • Josh Mc
    Josh Mc almost 6 years
    Unfortunately very much not free these days, and may not be suited well to huge datasets (price may become steep fast).
  • xeruf
    xeruf about 5 years
    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: cloud.google.com/maps-platform/terms/maps-service-terms/…
  • Sandip Subedi
    Sandip Subedi about 4 years
    Yeah looks like it's not free anymore.