What is an address API?
An address API is an application programmatic interface (API) that processes postal addresses.
There are different kinds of address APIs. Address correction APIs (also referred to as validation or verification APIs) will look up addresses in official address databases and verify, standardize, or normalize the address data. ZIP Code APIs will append ZIP codes to other address data.
Address enrichment APIs start with address data and append additional metadata points such as latitude and longitude coordinates, congressional districts, FIPS codes, vacancy status and more.
Smarty (formerly SmartyStreets) has a collection of address APIs that are pretty handy. They fall into four main categories. US Address APIs, International Address APIs, Autocomplete APIs and Geocoding APIs.
|US Validation APIs -
Verifies, standardizes and gets ZIP Codes for US Addresses.
|International APIs -
Verifies and standardizes addresses in 240+ countries.
|Autocomplete APIs -
Suggests addresses based on each keystroke of user entry.
|Geocoding APIs -
Turns addresses into lat / long or lat / long into addresses.
In this article we'll discuss the following:
- Address Correction APIs
- Address Standardization APIs
- ZIP Code APIs
- Address Autocomplete APIs
- Geocoding APIs
Address Correction APIs
Address correction is the process of taking improperly formatted addresses or addresses with typographical errors and matching them with the standardized, validated version.
An address correction (or validation) API will programmatically fix any errors and see if an address is contained in an official address database. If the address that is being checked is found to exist in the official database, then that address is "valid". The nice thing about using an API to verify addresses is that you can validate a lot of addresses very quickly. In fact, Smarty can validate up to 100,000 addresses per second.
Many countries have official address databases. For example, Canada has Canada Post, the UK has Royal Mail, France has La Poste, Germany has Deutsche Post, etc. Each of these official databases contain all of the officially recognized postal addresses in the respective country. And, many of these countries provide access to their databases via an API.
For addresses in the United States, the USPS manages the official address database for the country. And, they make all of the information in that database accessible by using an API. But, their own API leaves a lot to be desired.
Fortunately, they do allow third-party suppliers to create their own APIs using the official USPS data. And thankfully, they often provide that same data in a much more efficient and robust manner than the USPS does.
It is also worthwhile to note that although the USPS processes mail going to international addresses, it does not offer an international address validation api.
Google Address Validation API
Another big name in addresses is of course, Google. Most people have heard of Google Maps. And naturally, if Google does addresses on maps, they must do address validation too. Right?
Actually, No. Not really.
Many people think that you can do address validation using Google Maps API. But, Google doesn't actually validate addresses that you submit to them; meaning, Google does not check the address against the official address database of the country that the address is located in.
What they actually do is provide you their best approximation of where an address might be IF it existed.
Another thing most people don't realize is that using Google Maps API comes with a condition. You can use their API for free in most cases, but you must:
That's right. If you use the Google Maps API you must:
- "Ensure that the logo and copyright notices are visible."
- "Display 'Powered by Google' logo if you're using data without a map"
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. It can help you choose the best address validation api for your needs.
Address Standardization APIs
Address standardization is "the process of changing addresses to adhere to USPS standards." Or, in countries outside of the United States, it is the process of modifying addresses to adhere to the official postal format of the country in which the address is located.
For address standardization, Google really can't help you.
Not only does Google not check an address against an official address database of a country, they do not modify that address to conform to the official postal format of the country. So, if you want to standardize an address, you either need to use the official address APIs of various countries (i.e. USPS, La Poste, etc), or you need to use a third-party address validation service. Most address validation services also standardize addresses as well.
ZIP Code APIs
USPS ZIP Code APIs can perform a multitude of functions. They can verify that an address has the proper ZIP Code affixed to it. They can append a ZIP Code to an incomplete address. They can augment an address's ZIP Code by adding ZIP +4 data to the address, and much more.
Because ZIP Codes are only used in the United States, a true ZIP Code API will only provide ZIP Code data for addresses located in the US. However, many people mistakenly use the term "ZIP Code" to refer to "postal codes" in countries outside the United States. Consequently, many address validation services also provide postal code data for addresses outside of the United States, just like they provide ZIP Code data for US addresses.
USPS ZIP Code lookup API
Among the various address APIs it offers, the USPS also offers a ZIP Code lookup API. This API will return the ZIP Code and ZIP Code +4 that corresponds to a given address. It will also provide this data for a given city and state combo.
The benefit of using this API is that it's free! The downside to using it is that it suffers from the same downfalls that almost all of the USPS APIs struggle with.
It is poorly documented, which can make implementation difficult. Also, it is not really supported. So, when you encounter a problem that is not covered in the inadequate documentation, you're going to have a hard time actually speaking with someone at the USPS who can actually help you fix the problem. And that's if the problem is on YOUR end. Because guess what? Just like all of the USPS APIs, the ZIP Code API struggles with frequent downtimes.
And, on top of all this, it can only process up to 5 lookups per request. When it's working of course.
Google ZIP Code API
While Google's Geocoding API can be used to look up ZIP Code info, it still comes with the same problematic terms of service that we mentioned in the address validation section of this article.
Unless your needs for a ZIP Code API also allow you to display a map, and give full logo and copyright notices, you're better off using a different ZIP Code API provider.
Address Autocomplete APIs
Just as the name suggests, an address autocomplete API automatically suggests addresses as a user is typing. The most common use case for this application is when someone is completing an order form of some kind.
An address autocomplete API can be useful for a number of reasons. One of those reasons is quality control. If a user sees their address being suggested as they type it in, they are more likely to click on their own, correct address.
Because the address that is being suggested has already been properly formatted and validated, when the user clicks on it, that data enters the company's database correctly, the first time. This can save a lot of time and money by avoiding shipping and/or mailing things to the wrong address.
Another benefit of using an autocomplete API is that it saves time. And, if a user spends less time typing things into an order form, the risk of shopping cart abandonment is also lowered. Learn more about address autocomplete
Google autocomplete API
But remember, Google does not validate addresses
So, one of the problems with using their API is that it doesn't do what most people think it does. Since Google doesn't validate addresses, the addresses that are suggested via its autocomplete API are not necessarily valid.
Why is that a problem?
Well, if you're using the autocomplete feature to help reduce the number of invalid addresses that users enter into your system, and Google doesn't validate addresses, you could still be getting invalid data put into your system, even if you're using Google's autocomplete API.
Another problem with Google's address autocomplete API is that it has the same restrictions as mentioned previously in this article, namely:
"Customer will display all attribution that (i) Google provides through the Services (including branding, logos, and copyright and trademark notices); or (ii) is specified in the Maps Service Specific Terms."
So, if you're looking for a subtle autosuggest experience for your users, Google will not provide that for you.
Smarty US Autocomplete API
The Smarty US Autocomplete API also suggests addresses for users as they are typing. So what are the main differences between the Google autocomplete API and the Smarty US Autocomplete API?
First of all, Smarty DOES validate addresses, Google does not. Secondly, Smarty DOES offer suggestions down to the apartment number, Google does not. Thirdly, Smarty DOES provide PO Boxes, APOs, and FPOs in the autocomplete suggestions, Google does not. Fourthly, Smarty does not have oppressive attribution requirements, Google DOES.Smarty's US Autocomplete Pro API will also autocomplete non-postal addresses. That means that the millions and millions of real and valid addresses in the US where the postal service doesn't offer delivery (yes, millions) will still appear in the autocomplete suggestions. They will also appear in a standardized format. That is something many autocomplete providers (including Google) can't do.
So, if you're wanting a better UX for your customers or data entry employees, you might want to give Smarty US Autocomplete API a try.
Geocoding (not to be confused with reverse geocoding) is the process of identifying the real-world geographic coordinates of a specific location. Therefore, a Geocoding API would allow its users to programmatically identify the geocodes of a specific location, depending upon the input it receives.
One of the more common uses of a geocoding API is to convert postal addresses into lat long coordinates, also known as 'geocodes'.
For example, here is the postal address:
543 S State St Salt Lake City UT 84111-3521
By entering that address into the Smarty address validation demo, we see that the corresponding geocodes are:
Latitude: 40.75745 Longitude: -111.88767
By using a geocode API to convert addresses into geocodes, we can quickly identify the lat long coordinates of thousands of addresses. This can be useful for a number of applications.
Using Google Maps API to convert addresses into lat long coordinates
Google Maps API can be used to find the geocodes of addresses.
One thing that Google is known for, of course, is Google Maps. And Google Maps has pretty much become the default way of finding your way around places. How many of us have used Google Maps to give us driving or walking directions to some place?
Google Map's ability to find a specific location is based on their use of geocodes. In fact, when you enter an address into Google Maps, it will automatically convert that address into the address's corresponding lat long coordinates, or geocodes. Those coordinates are then used to navigate you to your desired destination.
And, if you want to convert LOTS of addresses into geocodes, Google Maps API can help you do that quickly.
Just keep in mind that when you're using their API, you have the same usage limitations and citation requirements that we discussed previously in this article.
So, if you can accomplish your project while giving full citation and displaying a map with your results, then the Google Maps API may be a good geocoding solution for you to consider.
Smarty Geocoding API
The Smarty Address Validation API can also be used to find the lat long coordinates of an address, as shown in the previous example.
In fact, the Smarty Address APIs can be a great option for you to consider as well.
So what are the benefits of using the Smarty APIs for geocoding vs the Google Maps API?
- The Smarty APIs can process over 100,000 addresses per second
- There are no citation or map display requirements like Google has
- Geocodes are available for over 240+ countries and territories around the world
- Smarty provides fanatical customer support should you have any questions
- All of the APIs are fully documented and supported
- Free testing accounts are available for you to try the APIs and see if they're right for you.