🗺️ Google Maps AI Agent
💥 Developed by xCodeWraith
A conversational AI agent that extracts, enriches, and organizes business leads from Google Maps using natural language.
Simply chat with the AI: "Find 100 dental clinics in Los Angeles" and watch it automatically scrape, enrich, and organize the data into Google Sheets.
- Overview
- Key Features
- How It Works
- Tech Stack
- Requirements
- Installation
- Configuration
- Usage Examples
- Data Fields
- Troubleshooting
- License
Google Maps AI Agent is an intelligent conversational system that transforms Google Maps into a powerful B2B lead generation tool. Instead of manually searching and copying business data, simply chat with an AI agent that understands your requirements and automates the entire process.
- 🤖 Natural Language Interface - Chat naturally as if speaking to a human assistant
- 🧠 AI-Powered Understanding - GPT-4o intelligently interprets your requests
- 🔄 Automatic Enrichment - Automatically finds emails and company backgrounds
- 📊 Smart Organization - Structures data perfectly in Google Sheets
- ⚡ Real-Time Processing - Watch leads populate as you chat
| Target Audience | Use Case |
|---|---|
| 💼 Sales Teams | Targeted lead lists by location and niche |
| 📞 Cold Callers | Get phone numbers and business info instantly |
| 📧 Email Marketers | Contact info with email enrichment |
| 🏢 B2B Agencies | Local business research for clients |
| 🚀 Entrepreneurs | Find potential clients or partners |
- Natural language input: "Find 50 restaurants in NYC"
- No complex forms or parameters
- AI understands context and intent
- Multi-turn conversations
- Search via Serper.dev Google Maps API
- Automatically handles pagination
- Extracts comprehensive business data
- Geo-targeting with coordinates
- Perplexity AI finds company emails
- Automatic web scraping from websites
- Background research for every business
- Real-time updates to Google Sheets
┌──────────────────────────────────────────────────────────┐
│ STAGE 1: DATA COLLECTION │
├──────────────────────────────────────────────────────────┤
│ Chat Trigger → AI Agent → Serper API → Sub-Workflow │
│ ↓ │
│ Google Sheets Save │
└──────────────────────────────────────────────────────────┘
↓
┌──────────────────────────────────────────────────────────┐
│ STAGE 2: ENRICHMENT │
├──────────────────────────────────────────────────────────┤
│ Sheets Trigger → Perplexity AI → Email & Background │
│ ↓ │
│ Sheets Update │
└──────────────────────────────────────────────────────────┘
You: "Extract info for 100 dental clinics in Los Angeles"
AI Agent: "I'll search for dental clinics in Los Angeles. Starting now..."
[Google Maps search]
[Finds 100+ results across multiple pages]
[Automatically saves to Google Sheets]
AI Agent: "✅ Found and saved 97 dental clinics to your sheet!"
[Background process starts automatically]
[Enriches each lead with email and background]
[Updates the sheet with enriched data]
| Category | Technology | Purpose |
|---|---|---|
| Automation | n8n | Workflow orchestration |
| AI Agent | OpenAI GPT-4o | Natural language understanding & task execution |
| AI Memory | Buffer Window | Conversation context retention |
| Map Search | Serper.dev | Google Maps API for business data |
| Enrichment | Perplexity AI (Sonar) | Email discovery & company research |
| Storage | Google Sheets | Lead database |
| Service | Required? | Purpose | Cost |
|---|---|---|---|
| n8n | ✅ Yes | Run workflows | Free (self-hosted) or $20/mo |
| OpenAI | ✅ Yes | GPT-4o AI agent | ~$0.01-0.03 per request |
| Serper.dev | ✅ Yes | Google Maps search | $50/mo for 5,000 searches |
| Perplexity AI | ✅ Yes | Email enrichment | $20/mo or pay-per-use |
| Google Account | ✅ Yes | Google Sheets storage | Free |
⚠️ IMPORTANT: This system consists of 2 separate workflows. Both must be imported separately and linked together!
| File | Type | Description |
|---|---|---|
Google map ai agent.json |
Main Workflow | Chat interface and AI agent |
Gooogle map lead ai agent.json |
Sub-Workflow | Data saving and UUID generation |
🔴 ORDER MATTERS! The sub-workflow MUST be imported first!
- Open n8n
- Click "Workflows" → "Import from File"
- Select
Gooogle map lead ai agent.json - Click "Import"
- ✅ Once imported, note down the workflow ID:
- Visible in URL:
https://your-n8n.com/workflow/WORKFLOW_ID
- Visible in URL:
- Click "Workflows" → "Import from File"
- Select
Google map ai agent.json - Click "Import"
🔗 The main workflow must be linked to call the sub-workflow!
- Open the main workflow
- Find the "Call n8n Workflow Tool" node
- Click on the node
- In the "Workflow" field:
- Select "💥 xCodeWraith - Google Maps Lead Sub-Workflow" from the dropdown
- Go to https://sheets.google.com/
- Create a new spreadsheet named: "Leads Google map ai agent"
- Create headers in row 1:
UUID | Name | Address | Number | Website | Rating | Opening Hours | Email | Background
Update Google Sheets nodes in both workflows:
In Main Workflow:
Google Sheets Triggernode → Select your Spreadsheet IDGoogle Sheets(update) node → Select your Spreadsheet ID
In Sub-Workflow:
Append row in sheetnode → Select your Spreadsheet ID
- Open the Main workflow → Toggle "Active" (green)
- The Sub-workflow can remain inactive (it is called automatically by the main one)
- Click the "When chat message received" node in the Main workflow
- Copy the "Production URL"
- Open this URL in a browser to access the chat interface!
Node: "OpenAI Chat Model"
- Get API key from https://platform.openai.com/api-keys
- In n8n: Settings → Credentials
- Add "OpenAi account" credential
- Paste your API key
Node: "Map Search Tool"
- Sign up at https://serper.dev/
- Get API key from dashboard
- Find the Headers section in the node
- Update
X-API-KEYvalue with your key
Node: "Message a model1"
- Get API key from https://www.perplexity.ai/settings/api
- In n8n: Settings → Credentials
- Add "Perplexity account" credential
- In n8n: Settings → Credentials
- Add "Google Sheets OAuth2 API"
- Follow the OAuth flow
You: "Find 50 coffee shops in Seattle"
AI: ✅ Found and saved 47 coffee shops!
You: "Extract info for 100 dental clinics in Los Angeles"
AI: Searching for dental clinics in Los Angeles...
100 results = 5 pages to scan
✅ 97 dental clinics saved!
| Field | Description | Source |
|---|---|---|
| UUID | Unique identifier | Auto-generated |
| Name | Business name | Google Maps |
| Address | Full address | Google Maps |
| Number | Phone number | Google Maps |
| Website | Company website | Google Maps |
| Rating | Google rating | Google Maps |
| Opening Hours | Operating hours | Google Maps |
| Contact email | Perplexity AI | |
| Background | Company description | Perplexity AI |
| Issue | Solution |
|---|---|
| Chat interface not loading | Verify Main workflow is Active |
| No results from map search | Check Serper.dev API key |
| Data not saving to Sheets | Verify Google Sheets credentials |
| Sub-workflow not running | Check workflow connection link |
| Metric | Value |
|---|---|
| Search Speed | 20 results per page in 2 seconds |
| Scraping | ~100 leads in 1 minute |
| Enrichment | ~60 leads in 5-10 minutes |
| Accuracy | 90%+ data accuracy |
| Daily Capacity | 5,000-10,000 leads |
This project is licensed under the MIT License.
✅ Commercial use allowed
✅ Modification allowed
✅ Distribution allowed
✅ Private use allowed
💥 Made with ❤️ by xCodeWraith
⭐ Star this repo if it helps you generate leads!
Ready to generate thousands of leads? Start chatting with your AI agent now! 🗺️