Google Maps -> Validate Address
Readonly
Action summary
Google Maps -> Validate Address
Google Maps → Validate Address
Overview
This Xano action validates a physical address using the Google Maps Address Validation API. It checks the accuracy, format, and existence of an address, returning structured validation results to help ensure reliable address data in your application.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
google_api_key |
text | Yes | Your Google Maps API key (from settings registry). |
region_code |
text | No | (Optional) Region code to bias validation (e.g., "us", "in"). |
address_lines |
text | Yes | The address to validate (single or multi-line string). |
language_code |
text | No | (Optional) Language code for the response (e.g., "en", "fr"). |
session_token |
text | No | (Optional) Unique token to group validation requests. |
Function Stack
1. Google Maps API Request
- API Request:
Sends a POST request to
https://addressvalidation.googleapis.com/v1:validateAddresswith the providedaddress_lines, optionalregion_code,language_code,session_token, andgoogle_api_key.
2. Precondition
- Ensures the API response status is
200(success).
3. Response
- Returns the validation result from the Google Maps API response.
Example Usage
Request
{
"region_code": "us",
"address_lines": "1600 Amphitheatre Parkway, Mountain View, CA",
"language_code": "en",
"session_token": "123e4567-e89b-12d3-a456-426614174000"
}
Response
{
"result": {
"verdict": {
"inputGranularity": "PREMISE",
"validationGranularity": "PREMISE",
"geocodeGranularity": "PREMISE",
"hasUnconfirmedComponents": false,
"hasInferredComponents": false,
"hasReplacedComponents": false
},
"address": {
"formattedAddress": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",
// ...additional address fields
},
"geocode": {
"location": {
"latitude": 37.4224764,
"longitude": -122.0842499
},
// ...additional geocode data
}
// ...other validation fields
}
}
Notes
- The
google_api_keymust be valid and have Address Validation API access enabled. - Use
region_codeto bias validation for addresses in a specific country. - The response includes verdicts on address accuracy, granularity, and standardized formatting.
Troubleshooting
REQUEST_DENIED: Check if your API key is correct and has Address Validation API access enabled.INVALID_ARGUMENT: Ensure all required address fields are provided and correctly formatted.ZERO_RESULTS: The address could not be validated; verify the address input.- Other Errors: Refer to the Google Maps Address Validation API documentation for detailed error handling.
References
Version notes
2025-07-14 16:32:05
Current