Conversational AI agent that extracts and enriches business leads from Google Maps through natural language chat.
Simply chat with the AI: "Find me 100 dental clinics in Los Angeles" and watch it automatically scrape, enrich, and organize leads into Google Sheets.
- Overview
- Key Features
- How It Works
- System Architecture
- Tech Stack
- Prerequisites
- Installation
- Configuration
- Usage Examples
- Data Fields
- Enrichment Process
- Troubleshooting
- Best Practices
- 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.
Unlike traditional scrapers with rigid forms, this system uses:
- π€ Natural Language Interface - Chat naturally like talking to a human assistant
- π§ AI-Powered Understanding - GPT-4o interprets your requests intelligently
- π Automatic Enrichment - Finds emails and company backgrounds automatically
- π Smart Organization - Structures data perfectly in Google Sheets
- β‘ Real-Time Processing - Watch leads populate as you chat
- πΌ Sales Teams - Build targeted prospect lists by location and niche
- π Cold Callers - Get phone numbers and business info instantly
- π§ Email Marketers - Extract contacts with email enrichment
- π’ B2B Agencies - Research local businesses for clients
- π Entrepreneurs - Find potential customers or partners in any area
- Natural language input: "Find 50 restaurants in NYC"
- No complex forms or parameters
- AI understands context and intent
- Clarifying questions when needed
- Multi-turn conversations
- Searches via Serper.dev Google Maps API
- Handles pagination automatically
- Extracts comprehensive business data
- Geographic targeting with coordinates
- Filters by location, type, and niche
- Perplexity AI finds company emails
- Scrapes from websites automatically
- Background research on each business
- Validates and formats data
- Updates Google Sheets in real-time
- Organized Google Sheets storage
- UUID tracking for each lead
- Clean, CRM-ready format
- Automatic deduplication
- Export-friendly structure
- Stage 1: AI chat β Google Maps scraping β Initial data save
- Stage 2: Auto-triggered enrichment β Email finding β Data update
- Fully automated pipeline
- No manual intervention required
You: "Extract info for 100 dental clinics in Los Angeles"
AI Agent: "I'll search for dental clinics in Los Angeles. Starting now..."
[Searches Google Maps]
[Finds 100+ results across multiple pages]
[Saves to Google Sheets automatically]
AI Agent: "β
Found and saved 97 dental clinics to your sheet!"
[Background process automatically starts]
[Enriches each lead with email and background]
[Updates sheet with enriched data]
User Chat Input
β
GPT-4o AI Agent
β
Map Search Tool (Serper.dev)
β
Extract Business Data
β
Call Sub-Workflow
β
Generate UUID
β
Save to Google Sheets
β
[Automatic Trigger]
β
Google Sheets Detects New Row
β
Perplexity AI Enrichment
β
Find Email & Background
β
Update Sheet with Enriched Data
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CHAT INTERFACE β
β (User converses with AI) β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AI AGENT (GPT-4o) β
β β’ Understands natural language requests β
β β’ Plans multi-step search strategy β
β β’ Manages pagination and iteration β
β β’ Calls tools intelligently β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββ΄βββββββββββ
β β
βββββββββββββββββββββββ βββββββββββββββββββββββ
β MAP SEARCH TOOL β β WORKFLOW TOOL β
β (Serper.dev API) β β (Sub-workflow call) β
βββββββββββββββββββββββ€ βββββββββββββββββββββββ€
β β β β
β β’ Query: "q" β β β’ JSON data input β
β β’ Location: "ll" β β β’ UUID generation β
β β’ Page: number β β β’ Sheet append β
β β’ Returns: β β β’ Returns: "ok" β
β - Name β β β
β - Address β β β
β - Phone β β β
β - Website β β β
β - Rating β β β
β - Hours β β β
β β β β
ββββββββββββ¬βββββββββββ ββββββββββββ¬βββββββββββ
β β
βββββββββββββ¬βββββββββββββ
β
β
βββββββββββββββββββββββββ
β GOOGLE SHEETS β
β Initial Data Saved β
βββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β GOOGLE SHEETS TRIGGER β
β (Monitors for new rows every minute) β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FILTER β
β β’ Exclude header row (Name β "Name") β
β β’ Only process rows with data β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LOOP OVER ITEMS β
β (Process each lead individually) β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PERPLEXITY AI ENRICHMENT β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β Prompt: "Get email and background for [Company] at β
β [Address], reference website: [URL]" β
β β
β Returns JSON: β
β { β
β "Email": "contact@company.com", β
β "Background": "Company description..." β
β } β
β β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β UPDATE GOOGLE SHEETS β
β (Match by UUID, update Email & Background) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Category | Technology | Purpose |
---|---|---|
Automation | n8n | Workflow orchestration |
AI Agent | OpenAI GPT-4o | Natural language understanding and task execution |
AI Memory | Buffer Window | Conversation context retention |
Maps Search | Serper.dev | Google Maps API for business data |
Enrichment | Perplexity AI (Sonar) | Email finding and company research |
Storage | Google Sheets | Lead database and organization |
Trigger | n8n Chat Trigger | Conversational interface |
Sub-workflow | n8n Workflow Tool | Modular data processing |
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 |
- β OpenAI API Key
- β Serper.dev API Key
- β Perplexity API Key
- β Google Sheets OAuth credentials
- n8n instance (v1.0+)
- Modern web browser
- Stable internet connection
Download these two JSON files:
Google map ai agent.json
(Main workflow)Sub-Workflow of Google map lead ai agent.json
(Helper workflow)
- Open your n8n instance
- Click "Workflows" β "Import from File"
- Select
Google map ai agent.json
- Click "Import"
- Repeat the import process
- Select
Sub-Workflow of Google map lead ai agent.json
- This workflow will be called by the main workflow
-
Create new spreadsheet: "Leads Google map ai agent"
-
Create headers in row 1:
UUID | Name | Address | Number | Website | Rating | Opening Hours | Email | Background
-
Copy the spreadsheet ID from URL:
https://docs.google.com/spreadsheets/d/SPREADSHEET_ID_HERE/edit
See Configuration section below for detailed setup.
- In main workflow, find "Call n8n Workflow Tool" node
- Update
workflowId
to your imported sub-workflow ID - Find workflow ID in URL when viewing sub-workflow:
/workflow/YOUR_WORKFLOW_ID
- Open main workflow β Toggle "Active" (green)
- Sub-workflow can remain inactive (called by main)
- Chat interface is now live!
Node: "OpenAI Chat Model"
- Get API key from https://platform.openai.com/api-keys
- In n8n: Settings β Credentials
- Add "OpenAi account" credential
- Paste API key
- Select in node
Model: GPT-4o (recommended for best performance)
Node: "Map Search Tool"
- Sign up at https://serper.dev/
- Get API key from dashboard
- In node, find Headers section
- Update
X-API-KEY
value with your key
Current in workflow:
"X-API-KEY": "c2305ea10799e51fd2b15865df14caac6ba573eb"
Replace with:
"X-API-KEY": "YOUR_SERPER_API_KEY"
Parameters explained:
q
: Search query (provided by AI)ll
: Location coordinates (default: New York area)page
: Pagination (AI handles automatically)hl
: Language (en = English)location
: Country filtergl
: Geographic location code (us = USA)
Node: "Message a model1"
- Get API key from https://www.perplexity.ai/settings/api
- In n8n: Settings β Credentials
- Add "Perplexity account" credential
- Paste API key
- Select in node
Model: Sonar (optimized for research tasks)
Nodes:
- "Google Sheets Trigger"
- "Append row in sheet" (in sub-workflow)
- "Google Sheets" (update node)
-
In n8n: Settings β Credentials
-
Add "Google Sheets OAuth2 API"
-
Follow OAuth flow to authorize
-
Grant permissions for:
- Read spreadsheets
- Write spreadsheets
- Create/update rows
-
Update all Google Sheets nodes:
- Set credential
- Select your spreadsheet
- Select "Sheet1" (or your sheet name)
In Main Workflow:
Find "Google Sheets Trigger" node:
"documentId": "1R4PGBIBihrNCfj0olbDT2p3jbtWCwYVlCgKU6Z3rf48" // Your ID
"sheetName": "gid=0" // Sheet1
Find "Google Sheets" (update node):
"documentId": "1R4PGBIBihrNCfj0olbDT2p3jbtWCwYVlCgKU6Z3rf48" // Your ID
In Sub-Workflow:
Find "Append row in sheet" node:
"documentId": "1R4PGBIBihrNCfj0olbDT2p3jbtWCwYVlCgKU6Z3rf48" // Your ID
You:
Find 50 coffee shops in Seattle
AI Agent:
- Searches Google Maps for coffee shops in Seattle
- Extracts all business data
- Saves to Google Sheets
- Returns: "β Found and saved 47 coffee shops!"
You:
Extract info for 100 dental clinics in Los Angeles
AI Agent:
- Searches: "Dental Clinic Los Angeles"
- Handles pagination (100 results = 5 pages)
- Saves each page to sheets automatically
- Background enrichment starts automatically
You:
I need restaurants in Manhattan, specifically Italian ones
AI Agent:
- Refines query: "Italian Restaurant Manhattan"
- Searches with New York coordinates
- Extracts comprehensive data
- Enriches with emails and backgrounds
You:
Now find 30 more in Brooklyn
AI Agent:
- Remembers context (restaurants)
- Searches Brooklyn area
- Continues adding to same sheet
- Maintains conversation flow
Field | Description | Example |
---|---|---|
UUID | Unique identifier | 679a1234-5678-7abc-ydef-123456789012 |
Name | Business name | "Joe's Pizza" |
Address | Full address | "123 Main St, New York, NY 10001" |
Number | Phone number | "212-555-0123" (+ prefix removed) |
Website | Company website | "https://joespizza.com" |
Rating | Google rating | "4.5" |
Opening Hours | Business hours | "Mon-Fri 9AM-9PM" |
Field | Description | Source |
---|---|---|
Contact email | Perplexity AI scrapes website | |
Background | Company description | Perplexity AI research |
-
Trigger: New row detected in Google Sheets
-
Filter: Skip header row and empty entries
-
Loop: Process each lead individually
-
Perplexity Query:
Get the email and background for [Company Name] at [Address], reference website: [Website URL]
-
AI Research:
- Visits company website
- Scrapes contact pages
- Finds email patterns
- Researches company info
-
JSON Response:
{ "Email": "contact@company.com", "Background": "Family-owned pizza restaurant since 1985..." }
-
Update Sheet: Matches by UUID, updates Email & Background columns
- Processing: ~5-10 seconds per lead
- Batch: 60 leads in ~5-10 minutes
- Automatic: No manual intervention needed
Error: Webhook URL doesn't open
Solution:
- Verify main workflow is Active
- Click "When chat message received" node
- Copy "Production URL"
- Open URL in new browser tab
- Should see chat interface
Error: AI says "Found 0 results"
Solution:
- Check Serper.dev API key is valid
- Verify you have credits remaining
- Try broader search terms
- Check location parameter (ll) is set
- Test query directly at serper.dev
Error: Workflow runs but sheet empty
Solution:
- Verify Google Sheets credentials
- Check spreadsheet ID is correct
- Ensure sheet has proper headers
- Test sub-workflow independently
- Review execution logs for errors
Error: Email and Background stay empty
Solution:
- Check Perplexity API key is valid
- Verify Google Sheets Trigger is active
- Check filter conditions aren't too restrictive
- Ensure website URLs are valid
- Monitor trigger polling (every 1 minute)
- Review Perplexity AI response in logs
Error: UUID column empty or errors
Solution:
- Check Code node in sub-workflow
- Verify UUID v7 generation function
- Test with simpler UUID generation
- Ensure JSON parsing is correct
Error: AI gives irrelevant responses
Solution:
- Use clear, specific language
- Include: quantity, niche, location
- Example: "Find 50 dentists in Miami"
- Check system prompt in AI Agent node
- Verify GPT-4o model is selected
- Review conversation memory settings
β Good:
- "Extract 100 dental clinics in Los Angeles"
- "Find 50 Italian restaurants in Manhattan"
- "Get coffee shops in Seattle, 30 results"
β Avoid:
- "Find some businesses" (too vague)
- "Restaurants" (missing location)
- "Get me leads" (not specific)
Serper.dev (Biggest cost):
- Each search = 1 credit
- 100 results = ~5 searches (pagination)
- $50/mo = 5,000 searches = ~100,000 leads
OpenAI GPT-4o:
- ~$0.01-0.03 per chat interaction
- Optimize: Ask for all leads in one message
Perplexity AI:
- ~$0.005 per enrichment
- 100 leads = ~$0.50
- Consider enriching only high-quality leads
Before Running:
- Define clear target criteria
- Use specific location names
- Include business type/niche
After Scraping:
- Spot-check first 10 results
- Verify data accuracy
- Remove duplicates if any
- Export to CRM
For 1,000+ Leads:
- Break into smaller batches (100-200)
- Use multiple conversations
- Monitor API rate limits
- Let enrichment complete between batches
- Export and backup regularly
Target specific niches in geographic areas:
- "Find 200 plumbers in Chicago"
- "Get auto repair shops in Texas"
Create comprehensive F&B lists:
- "Extract all sushi restaurants in Los Angeles"
- "Find Italian restaurants, NYC, 150 results"
Build medical practice databases:
- "Dental clinics in Florida, 500 leads"
- "Chiropractors in California"
Map out retail opportunities:
- "Coffee shops in Seattle metro area"
- "Boutique clothing stores in Manhattan"
Find local service businesses:
- "HVAC companies in Phoenix"
- "Electricians in Boston area"
This project is licensed under the MIT License.
β
Commercial use allowed
β
Modification allowed
β
Distribution allowed
β
Private use allowed
Built with powerful tools:
- n8n - Workflow automation
- OpenAI GPT-4o - Conversational AI
- Serper.dev - Google Maps API
- Perplexity AI - Email enrichment
- Google Sheets - Data storage
- Export to CSV/Excel
- CRM integration (HubSpot, Salesforce)
- Advanced filtering options
- Duplicate detection
- Email verification
- Social media profile finding
- Bulk search from file upload
- Custom data field extraction
- Schedule automated scraping
- Multi-language support
- π§ Email: letsautomatewothawais@gmail.com
- π Issues: GitHub Issues
Expected Performance:
Metric | Value |
---|---|
Search Speed | 20 results/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 |
Made with β€οΈ for Sales & Marketing Professionals
β Star this repo if it helps your lead generation!
π’ Share with teams who need automated prospecting!
π Fork and customize for your specific needs!
Ready to generate thousands of leads? Start chatting with your AI agent now! πΊοΈ