Google Maps

Description: Enable agents to get directions between two locations with Google Maps.

Author: Arcade

Code: GitHub

Auth: API Key

PyPI VersionLicensePython VersionsWheel StatusDownloads

The Arcade Google Maps toolkit provides a pre-built set of tools for interacting with Google Maps. These tools make it easy to build agents and AI apps that can:

  • Get directions to a location using an address or latitude/longitude.

Install

pip install arcade_search

pip installing the toolkit is only needed if you are self-hosting Arcade. You do not need to install the toolkit if you’re using Arcade Cloud.

Available Tools

Tool NameDescription
GetDirectionsBetweenAddressesGet directions between two addresses.
GetDirectionsBetweenCoordinatesGet directions between two latitude/longitude coordinates.

If you need to perform an action that’s not listed here, you can get in touch with us to request a new tool, or create your own tools.

GetDirectionsBetweenAddresses


Get directions between two addresses.

Parameters

  • origin_address (string, required) The origin address. Example: ‘123 Main St, New York, NY 10001’.
  • destination_address (string, required) The destination address. Example: ‘456 Main St, New York, NY 10001’.
  • language (string, optional, Defaults to ‘en’ English) 2-character language code to use in the Google Maps search. A list of supported language codes can be found here.
  • country (string, optional, Defaults to None) 2-character country code to use in the Google Maps search. A list of supported country codes can be found here.
  • distance_unit (enum (GoogleMapsDistanceUnit), optional, Defaults to GoogleMapsDistanceUnit.KM) Distance unit to use in the Google Maps search.
  • travel_mode (enum (GoogleMapsTravelMode), optional, Defaults to GoogleMapsTravelMode.BEST) Travel mode to use in the Google Maps search.

GetDirectionsBetweenCoordinates


Get directions between two latitude/longitude coordinates.

Parameters

  • origin_latitude (float, required) The origin latitude.
  • origin_longitude (float, required) The origin longitude.
  • destination_latitude (float, required) The destination latitude.
  • destination_longitude (float, required) The destination longitude.
  • language (string, optional, Defaults to ‘en’ English) 2-character language code to use in the Google Maps search. A list of supported language codes can be found here.
  • country (string, optional, Defaults to None) 2-character country code to use in the Google Maps search. A list of supported country codes can be found here.
  • distance_unit (enum (GoogleMapsDistanceUnit), optional, Defaults to GoogleMapsDistanceUnit.KM) Distance unit to use in the Google Maps search.
  • travel_mode (enum (GoogleMapsTravelMode), optional, Defaults to GoogleMapsTravelMode.BEST) Travel mode to use in the Google Maps search.

Auth

The Arcade Google Maps toolkit uses the SerpAPI to get directions.

  • Secret:
    • SERP_API_KEY: Your SerpAPI API key.

Setting the SERP_API_KEY secret is only required if you are self-hosting Arcade. If you’re using Arcade Cloud, the secret is already set for you. To manage your secrets, go to the Secrets page in the Arcade Dashboard.

Default parameters

Language, Country, Distance Unit, and Travel Mode are configurable through environment variables. When set, they will be used as default for Google Maps tools.

Providing a different value as language, country, distance_unit, or travel_mode argument in a tool call will override the default value.

Language

The language code is a 2-character code that determines the language in which the API will search and return directions. There are two environment variables:

  • ARCADE_GOOGLE_LANGUAGE: a default value for all Google tools. If not set, defaults to ‘en’ (English).
  • ARCADE_GOOGLE_MAPS_LANGUAGE: a default value for the Google Maps tools. If not set, defaults to ARCADE_GOOGLE_LANGUAGE.

A list of supported language codes can be found here.

Country

The country code is a 2-character code that determines the country in which the API will search for directions:

  • ARCADE_GOOGLE_MAPS_COUNTRY: a default value for the Google Maps tools. If not set, defaults to None.

A list of supported country codes can be found here.

Distance Unit

The distance unit is a string that determines the unit of distance to use in the Google Maps search:

  • ARCADE_GOOGLE_MAPS_DISTANCE_UNIT: a default value for the Google Maps tools. If not set, defaults to GoogleMapsDistanceUnit.KM.

A list of supported distance units can be found here.

Travel Mode

The travel mode is a string that determines the mode of travel to use in the Google Maps search:

  • ARCADE_GOOGLE_MAPS_TRAVEL_MODE: a default value for the Google Maps tools. If not set, defaults to GoogleMapsTravelMode.BEST.

A list of supported travel modes can be found here.

  • Secret:
    • SERP_API_KEY: Your SerpAPI API key.

Setting the SERP_API_KEY secret is only required if you are self-hosting Arcade. If you’re using Arcade Cloud, the secret is already set for you. To manage your secrets, go to the Secrets page in the Arcade Dashboard.