Google Maps -> Geocoding API
Readonly
Action summary
Google Maps -> Geocoding API
Google Maps → Geocoding API
Overview
This Xano action enables you to convert a physical address into geographic coordinates (latitude and longitude) using the Google Maps Geocoding API. It takes an address (and optionally a region) as input, calls the Google Geocoding API, and returns the geocoded location data.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
google_api_key |
text | Yes | Your Google Maps API key (from settings registry). |
address |
text | Yes | The address you want to geocode. |
region |
text | No | (Optional) Region code to bias results (e.g., "us", "in"). |
Function Stack
1. Google Maps API Request
- API Request: Makes a GET request to
https://maps.googleapis.com/maps/api/geocode/jsonwith the providedaddress, optionalregion, andgoogle_api_key. - Precondition: Ensures the response status is
200(success).
2. Response
- Returns the geocoding result from the Google Maps API response.
Example Usage
Request
{
"address": "1600 Amphitheatre Parkway, Mountain View, CA",
"region": "us"
}
Response
{
"results": [
{
"formatted_address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",
"geometry": {
"location": {
"lat": 37.4224764,
"lng": -122.0842499
}
},
// ... other fields
}
],
"status": "OK"
}
Notes
- The
google_api_keymust be valid and enabled for the Geocoding API. - The
regionparameter is optional but can help bias results toward a specific country. - The response includes formatted address, latitude, longitude, and additional location details.
Troubleshooting
REQUEST_DENIED: Check if your API key is correct and has Geocoding API access enabled.ZERO_RESULTS: The address could not be geocoded; verify the address input.OVER_QUERY_LIMIT: You have exceeded your API quota; review your usage in the Google Cloud Console.- Other Errors: Refer to Google Maps Geocoding API documentation for error details.
References
Version notes
Initial version
Current