ACTIONS
  • Home
  • My Actions
  • My Projects
  • My Packages
Google Maps -> Reverse Geocode
Readonly
Google Maps → Reverse Geocode

Action summary

Google Maps -> Reverse Geocode

Xano / Google Maps

Google Maps → Reverse Geocode

Overview

This action performs reverse geocoding using the Google Maps Geocoding API. It converts geographic coordinates (latitude and longitude) into a human-readable address and structured location information.

Inputs

Name Type Required Description
google_api_key text Yes Your Google Maps API key (from settings registry).
latitude text Yes The latitude coordinate to be geocoded.
longitude text Yes The longitude coordinate to be geocoded.

Function Stack

  1. API Request
    • Sends a GET request to https://maps.googleapis.com/maps/api/geocode/json with parameters:
      • latlng = {latitude},{longitude}
      • key = {google_api_key}
    • The response is stored as gmaps_api.
  2. Precondition
    • Confirms:
      • The response status is 200.
      • gmaps_api.response.result is not null.
  3. Response
    • Returns:
      • The value of gmaps_api.response.result.

Example Usage

Request

{
  "google_api_key": "AIzaSyD...",
  "latitude": "37.423021",
  "longitude": "-122.083739"
}

Response

{
  "results": [
    {
      "formatted_address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",
      "geometry": {
        "location": {
          "lat": 37.423021,
          "lng": -122.083739
        }
      },
      // ...other fields
    }
  ],
  "status": "OK"
}

Notes

  • The Google API key must have Geocoding API enabled.
  • The action returns all geocoding results from the API response.
  • If the latitude or longitude are invalid, or no result is found, an empty or error response will be returned.

Troubleshooting

  • REQUEST_DENIED: Ensure your API key is correct and has Geocoding API enabled.
  • ZERO_RESULTS: No address found for the specified coordinates.
  • INVALID_REQUEST: Latitude and/or longitude are missing or invalid.
  • Other errors: Consult the Geocoding API Documentation for error details.

References

  • Google Maps Geocoding API: Reverse Geocoding
  • Geocoding API Error Messages

Version notes

2025-05-28 16:38:07
Current
2025-06-30T11:08:44.000+00:00