Tools
Google Maps Tools
Examples
- Introduction
- Getting Started
- Agents
- Workflows
- Applications
Agent Concepts
- Multimodal
- RAG
- Knowledge
- Memory
- Teams
- Async
- Hybrid Search
- Storage
- Tools
- DuckDuckGo Search
- Calculator
- Airflow Tools
- Apify Tools
- ArXiv Tools
- AWS Lambda Tools
- Baidu Search Tools
- Cal.com Tools
- Composio Tools
- Confluence Tools
- Crawl4ai Tools
- CSV Tools
- DALL-E Tools
- Desi Vocal Tools
- Discord Tools
- DuckDB Tools
- Email Tools
- Exa Tools
- Fal Tools
- File Tools
- Firecrawl Tools
- Giphy Tools
- GitHub Tools
- Google Calendar Tools
- Google Maps Tools
- Google Search Tools
- Hacker News Tools
- Jina Reader Tools
- Jira Tools
- Linear Tools
- Luma Labs Tools
- MLX Transcribe Tools
- Models Labs Tools
- Newspaper Tools
- Newspaper4k Tools
- OpenBB Tools
- Pandas Tools
- Postgres Tools
- PubMed Tools
- Python Tools
- Replicate Tools
- Resend Tools
- SearxNG Tools
- SerpAPI Tools
- Shell Tools
- Slack Tools
- Sleep Tools
- Spider Tools
- SQL Tools
- Tavily Tools
- Todoist Tools
- Twilio Tools
- X (Twitter) Tools
- Website Tools
- Wikipedia Tools
- YFinance Tools
- YouTube Tools
- Zendesk Tools
- Vector Databases
- Embedders
Models
- Anthropic
- AWS Bedrock
- AWS Bedrock Claude
- Azure AI Foundry
- Azure OpenAI
- Cohere
- DeepSeek
- Fireworks
- Gemini
- Groq
- Hugging Face
- Mistral
- NVIDIA
- Ollama
- OpenAI
- Perplexity
- Together
- xAI
Tools
Google Maps Tools
Code
cookbook/tools/google_maps_tools.py
from agno.agent import Agent
from agno.tools.google_maps import GoogleMapTools
from agno.tools.crawl4ai import Crawl4aiTools # Optional: for enriching place data
agent = Agent(
name="Maps API Demo Agent",
tools=[
GoogleMapTools(),
Crawl4aiTools(max_length=5000), # Optional: for scraping business websites
],
description="Location and business information specialist for mapping and location-based queries.",
markdown=True,
show_tool_calls=True,
)
# Example 1: Business Search
print("\n=== Business Search Example ===")
agent.print_response(
"Find me highly rated Indian restaurants in Phoenix, AZ with their contact details",
markdown=True,
stream=True,
)
# Example 2: Directions
print("\n=== Directions Example ===")
agent.print_response(
"""Get driving directions from 'Phoenix Sky Harbor Airport' to 'Desert Botanical Garden',
avoiding highways if possible""",
markdown=True,
stream=True,
)
# Example 3: Address Validation and Geocoding
print("\n=== Address Validation and Geocoding Example ===")
agent.print_response(
"""Please validate and geocode this address:
'1600 Amphitheatre Parkway, Mountain View, CA'""",
markdown=True,
stream=True,
)
# Example 4: Distance Matrix
print("\n=== Distance Matrix Example ===")
agent.print_response(
"""Calculate the travel time and distance between these locations in Phoenix:
Origins: ['Phoenix Sky Harbor Airport', 'Downtown Phoenix']
Destinations: ['Desert Botanical Garden', 'Phoenix Zoo']""",
markdown=True,
stream=True,
)
# Example 5: Location Analysis
print("\n=== Location Analysis Example ===")
agent.print_response(
"""Analyze this location in Phoenix:
Address: '2301 N Central Ave, Phoenix, AZ 85004'
Please provide:
1. Exact coordinates
2. Nearby landmarks
3. Elevation data
4. Local timezone""",
markdown=True,
stream=True,
)
# Example 6: Multi-mode Transit Comparison
print("\n=== Transit Options Example ===")
agent.print_response(
"""Compare different travel modes from 'Phoenix Convention Center' to 'Phoenix Art Museum':
1. Driving
2. Walking
3. Transit (if available)
Include estimated time and distance for each option.""",
markdown=True,
stream=True,
)
Usage
1
Create a virtual environment
Open the Terminal
and create a python virtual environment.
python3 -m venv .venv
source .venv/bin/activate
2
Set your API keys
export GOOGLE_MAPS_API_KEY=xxx
export OPENAI_API_KEY=xxx
Get your API key from the Google Cloud Console
3
Install libraries
pip install -U openai googlemaps agno
4
Run Agent
python cookbook/tools/google_maps_tools.py