Skip to main content
Enable Agno agents with location intelligence with various Google Maps API functionalities including business search, directions, geocoding, address validation, and more. Specify include_tools and exclude_tools parameters for selective function access.

Prerequisites

  • Install the dependencies: uv pip install -U agno googlemaps google-maps-places openai.
  • Set OPENAI_API_KEY for the agent’s default model.
  • Set the environment variable GOOGLE_MAPS_API_KEY with your Google Maps API key. You can obtain the API key from the Google Cloud Console: https://console.cloud.google.com/projectselector2/google/maps-apis/credentials
  • Authenticate Application Default Credentials for the Places client with gcloud auth application-default login.
  • Enable the Places API (New), Directions API, Address Validation API, Geocoding API, Distance Matrix API, Elevation API, and Time Zone API for the key’s project.
google_maps_tools.py

Run the Example

Save the code above as google_maps_tools.py, then run:
For details, see Google Maps cookbook.