ACTIONS
  • Home
  • My Actions
  • My Projects
  • My Packages
Google Maps -> Places Details
Readonly
Google Maps → Places Details

Action summary

Google Maps -> Places Details

Xano / Google Maps

Google Maps → Places Details

Overview

This action retrieves detailed information about a place using the Google Maps Places Details API. It allows you to specify which fields to return, localize results by language, and optionally provide a session token for grouping related requests.

Inputs

Name Type Required Description
google_api_key text Yes Your Google Maps API key (from settings registry).
place_id text Yes The unique identifier of the place to look up.
field_mask text No Comma-separated list of fields to return (default: displayName,formattedAddress).
language_code text No Language code for the result (e.g., "en", "fr").
session_token text No Optional token to group multiple requests into a single session.

Function Stack

  1. Prepare Field Mask Parameter
    • If field_mask is not provided, defaults to displayName,formattedAddress.
    • Otherwise, uses the provided field_mask.
  2. Google Maps API Request
    • Sends a GET request to https://places.googleapis.com/v1/places/{place_id} with the fields specified in field_mask, and optional parameters (language_code, session_token, google_api_key).
  3. Precondition
    • Checks that the API response status is 200 (success).
  4. Response
    • Returns the API response result.

Example Usage

Request

{
  "google_api_key": "AIzaSyD...",
  "place_id": "ChIJN1t_tDeuEmsRUsoyG83frY4",
  "field_mask": "displayName,formattedAddress,internationalPhoneNumber,website",
  "language_code": "en",
  "session_token": "adf1234bc-5678-91de-0000-abc123456def"
}

Response

{
  "displayName": "Google Sydney",
  "formattedAddress": "48 Pirrama Rd, Pyrmont NSW 2009, Australia",
  "internationalPhoneNumber": "+61 2 9374 4000",
  "website": "https://www.google.com.au/about/careers/locations/sydney/"
  // ... other requested fields
}

Notes

  • The default returned fields are displayName and formattedAddress if field_mask is left blank.
  • The place_id must be a valid Google Place ID.
  • Using a session token links multiple related requests for the same user, which is useful for billing and performance optimization.
  • Always ensure your API key has access to the Google Places API.

Troubleshooting

  • REQUEST_DENIED: Verify your API key and its permissions.
  • INVALID_REQUEST: Ensure all required parameters (e.g., place_id) are provided and valid.
  • NOT_FOUND: The provided place_id does not correspond to a known place.
  • Other Errors: Consult the Places API documentation for further error details.

References

  • Google Places API: Place Details
  • Google Places API Field Mask

Version notes

2025-05-28 18:11:26
Current
2025-06-30T11:08:44.000+00:00