Lead-Generation-System-using-Google-Map
Health Warn
- License Γ’β¬β License: MIT
- Description Γ’β¬β Repository has a description
- Active repo Γ’β¬β Last push 0 days ago
- Low visibility Γ’β¬β Only 9 GitHub stars
Code Pass
- Code scan Γ’β¬β Scanned 2 files during light audit, no dangerous patterns found
Permissions Pass
- Permissions Γ’β¬β No dangerous permissions requested
This is a conversational AI agent and n8n workflow that allows users to extract B2B leads from Google Maps via natural language chat, automatically enriching the data with emails and exporting it to Google Sheets.
Security Assessment
Overall Risk: Medium. Because the repository primarily consists of an n8n workflow rather than standard code, the automated scanner only analyzed 2 files. No hardcoded secrets or dangerous local shell executions were detected in those files. However, the workflow inherently requires extensive network access to external services (OpenAI, Serper.dev, Perplexity AI) to function. You will need to provide your own highly sensitive API keys to these third-party platforms and grant it write permissions to your Google Sheets. Users must trust both the tool's creator and the external services with their API credentials and the scraped data.
Quality Assessment
Quality is relatively low. The project is very new (last pushed 0 days ago) and lacks community visibility, evidenced by having only 9 GitHub stars. It operates under a standard MIT license, which is a positive sign for open-source transparency and legal usage. While the light code scan found no malicious patterns, the small user base means the tool has not undergone rigorous peer review or widespread testing by the developer community.
Verdict
Use with caution β the setup requires handing over your third-party API keys, and the project currently lacks the community trust and extensive peer review needed for an unreserved recommendation.
πΊοΈ Conversational AI agent that extracts unlimited business leads from Google Maps with automatic email enrichment. Chat with GPT-4o to find any business, anywhere. Built with n8n, Serper.dev, and Perplexity AI.
πΊοΈ Google Maps AI Agent
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.
π Table of Contents
- Overview
- Key Features
- How It Works
- System Architecture
- Tech Stack
- Prerequisites
- Installation
- Configuration
- Usage Examples
- Data Fields
- Enrichment Process
- Troubleshooting
- Best Practices
- License
π― Overview
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.
What Makes This Special?
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
Who Is This For?
- πΌ 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
β¨ Key Features
π£οΈ Conversational Interface
- 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
π Intelligent Google Maps Scraping
- Searches via Serper.dev Google Maps API
- Handles pagination automatically
- Extracts comprehensive business data
- Geographic targeting with coordinates
- Filters by location, type, and niche
π§ Automatic Email Enrichment
- Perplexity AI finds company emails
- Scrapes from websites automatically
- Background research on each business
- Validates and formats data
- Updates Google Sheets in real-time
π Structured Data Export
- Organized Google Sheets storage
- UUID tracking for each lead
- Clean, CRM-ready format
- Automatic deduplication
- Export-friendly structure
π Two-Stage Workflow
- 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
π How It Works
User Experience
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]
Technical Flow
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
ποΈ System Architecture
Main Workflow: Chat Agent
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 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 β
βββββββββββββββββββββββββ
Sub-Workflow: Enrichment Process
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 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": "[email protected]", β
β "Background": "Company description..." β
β } β
β β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β UPDATE GOOGLE SHEETS β
β (Match by UUID, update Email & Background) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π οΈ Tech Stack
| 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 |
π¦ Prerequisites
Required Accounts & API Keys
| 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 |
API Keys Needed
- β OpenAI API Key
- β Serper.dev API Key
- β Perplexity API Key
- β Google Sheets OAuth credentials
Technical Requirements
- n8n instance (v1.0+)
- Modern web browser
- Stable internet connection
π Installation
Step 1: Download Workflows
Download these two JSON files:
Google map ai agent.json(Main workflow)Sub-Workflow of Google map lead ai agent.json(Helper workflow)
Step 2: Import Main Workflow
- Open your n8n instance
- Click "Workflows" β "Import from File"
- Select
Google map ai agent.json - Click "Import"
Step 3: Import Sub-Workflow
- Repeat the import process
- Select
Sub-Workflow of Google map lead ai agent.json - This workflow will be called by the main workflow
Step 4: Create Google Sheet
Create new spreadsheet: "Leads Google map ai agent"
Create headers in row 1:
UUID | Name | Address | Number | Website | Rating | Opening Hours | Email | BackgroundCopy the spreadsheet ID from URL:
https://docs.google.com/spreadsheets/d/SPREADSHEET_ID_HERE/edit
Step 5: Configure API Keys
See Configuration section below for detailed setup.
Step 6: Link Sub-Workflow
- In main workflow, find "Call n8n Workflow Tool" node
- Update
workflowIdto your imported sub-workflow ID - Find workflow ID in URL when viewing sub-workflow:
/workflow/YOUR_WORKFLOW_ID
Step 7: Activate Both Workflows
- Open main workflow β Toggle "Active" (green)
- Sub-workflow can remain inactive (called by main)
- Chat interface is now live!
βοΈ Configuration
1. OpenAI API Key
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)
2. Serper.dev API Key
Node: "Map Search Tool"
- Sign up at https://serper.dev/
- Get API key from dashboard
- In node, find Headers section
- Update
X-API-KEYvalue 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)
3. Perplexity API Key
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)
4. Google Sheets OAuth
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)
5. Update Spreadsheet IDs
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
π Usage Examples
Example 1: Simple Search
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!"
Example 2: Specific Niche
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
Example 3: Multiple Locations
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
Example 4: Follow-up Requests
You:
Now find 30 more in Brooklyn
AI Agent:
- Remembers context (restaurants)
- Searches Brooklyn area
- Continues adding to same sheet
- Maintains conversation flow
π Data Fields
Fields Scraped from Google Maps
| 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" |
Fields Added by Enrichment
| Field | Description | Source |
|---|---|---|
| Contact email | Perplexity AI scrapes website | |
| Background | Company description | Perplexity AI research |
π Enrichment Process
How Emails Are Found
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": "[email protected]", "Background": "Family-owned pizza restaurant since 1985..." }Update Sheet: Matches by UUID, updates Email & Background columns
Enrichment Speed
- Processing: ~5-10 seconds per lead
- Batch: 60 leads in ~5-10 minutes
- Automatic: No manual intervention needed
π Troubleshooting
Issue: Chat Interface Not Loading
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
Issue: No Results from Map Search
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
Issue: Data Not Saving to Sheets
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
Issue: Email Enrichment Not Working
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
Issue: UUID Not Generating
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
Issue: AI Agent Not Understanding Requests
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
π‘ Best Practices
Effective Prompts
β 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)
Cost Optimization
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
Data Quality
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
Scaling Tips
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
π― Use Cases
1. Local Business Prospecting
Target specific niches in geographic areas:
- "Find 200 plumbers in Chicago"
- "Get auto repair shops in Texas"
2. Restaurant Database Building
Create comprehensive F&B lists:
- "Extract all sushi restaurants in Los Angeles"
- "Find Italian restaurants, NYC, 150 results"
3. Healthcare Provider Lists
Build medical practice databases:
- "Dental clinics in Florida, 500 leads"
- "Chiropractors in California"
4. Retail Location Research
Map out retail opportunities:
- "Coffee shops in Seattle metro area"
- "Boutique clothing stores in Manhattan"
5. Service Provider Sourcing
Find local service businesses:
- "HVAC companies in Phoenix"
- "Electricians in Boston area"
π License
This project is licensed under the MIT License.
What This Means
β
Commercial use allowed
β
Modification allowed
β
Distribution allowed
β
Private use allowed
β οΈ No warranty or liability
π Acknowledgments
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
π Roadmap
Planned Features
- 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
π¬ Support
Get Help
- π§ Email: [email protected]
- π Issues: GitHub Issues
π Performance Metrics
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! πΊοΈ
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found