Why use the Address Validation API
With the Address Validation API, you can improve delivery predictability and reduce delivery failures, thereby providing improved customer experience. You do this by catching bad addresses and obtaining better awareness of address characteristics.
The Geocoding API might be a better match for your needs if you don't need to validate the individual address components. The Geocoding API converts addresses into latitude and longitude coordinates. The Address Validation API validates addresses for correctness. See Building location validation capability using Google Maps Platform in the Architecture Center for a detailed comparison.
What you can do with the Address Validation API
With the Address Validation API, you can determine if an address refers to a real place. If the address does not refer to a real place, the API can identify possibly wrong components that you can present to your customers to correct. Here is a sample workflow using the API:
Customer enters an address – The following image shows a basic form that allows a customer to enter an address, possibly as part of a checkout flow.
App sends the address to the API – The application passes this address as the input to the Address Validation API.
API validates and standardizes the address – In its response, the Address Validation API returns the complete address as determined by the API, or indicates where information is missing.
Customer corrects or confirms the recommended address – Depending on what the API returns, you can provide the following prompts to the customer:
Present a recommended address for the customer to confirm:
Prompt the customer to add missing information:
Prompt the user to fix the address if the API is unable to validate the input address due to missing or incorrect information:
How the Address Validation API works
The address validation accepts a POST request with the address in the form of a JSON body. It separates the address into its individual components, and then does the following checks and corrections:
- Correct—Provides component-level validation checks, including sub-premises where available.
- Complete—Attempts to infer missing or incorrect address components.
- Well-formatted—Cleans up and standardizes the format for address components.
Try the demo to see the Address Validation API in action.
Resources
The following table summarizes the resources available through the Address Validation API along with the data it returns. For specific details, see the Address Validation API reference.
Data resources | Data returned |
---|---|
Address components in JSON format. See Validate an address. |
Complete, validated address (if possible). Validation status of each address component. Where available for an address:
|
How to use the Address Validation API
1 | Try the demo | Explore the demo with a variety of address forms, both correct and incorrect. The demo provides a useful way to explore both the return values from the service, as well as the JSON formatted API response. |
2 | Check coverage | Review coverage details to see which countries and regions the Address Validation API supports. |
3 | Get set up | Start with Set up your Google Cloud project and complete the instructions that follow. |
4 | Request an address validation | Start with a basic address and then, for additional accuracy, you can enable CASS (for US and PR addresses only). See Request an address validation. |
5 | Process a response | The Address Validation API response provides two properties, each of which you use in different ways. See Understand a basic response. |
6 | Improve validation accuracy | You can help improve address accuracy by providing feedback on Address Validation API responses. See Handle updated addresses. |
Available client libraries
For a list of the available client libraries for Address Validation API, see Client libraries.
About CASS™
The United States Postal Service® (USPS®)1 maintains the Coding Accuracy Support System (CASS™) to support and certify address validation providers. A CASS Certified™ service, such as the Address Validation API, has been confirmed for its ability to fill in information missing from an address, standardize it, and update it to give you the most current and most accurate address.
CASS is not enabled by default and is only supported for the "US" and "PR"
regions. To enable CASS, set enableUspsCass
to true
as part of a validation
request. For more information, see
Validate an address.
As part of our use of USPS services, USPS evaluates requests for artificially created addresses. If USPS identifies an input address as being artificially created, Google is required to stop validating addresses for the customer and must report the customer's contact information (name and address), the relevant input address, and aggregated usage data to USPS. By using the API you consent to these Service Specific Terms.
What's next
- Review the FAQ: Go to FAQ
- Review coverage areas: Go to Country and region coverage details
- Process addresses at high volume: Go to Use Address Validation API to process addresses at high volume
-
Google Maps Platform is a non-exclusive Licensee of the United States Postal Service®. The following trademark(s) are owned by the United States Postal Service® and used with permission: United States Postal Service®, CASS™, CASS Certified™. ↩