ScavioScavio
Pricing
Tools
Sign InsGet Startedg
  1. Home
  2. Tutorials
  3. How to Build a Google Maps to WhatsApp Lead Pipeline
Tutorial

How to Build a Google Maps to WhatsApp Lead Pipeline

Build a pipeline from Google Maps business data to WhatsApp outreach messages. Find local businesses and reach them directly. With Python and JavaScript code.

Get Free API KeyAPI Docs

An r/coldemail thread asked about reaching local businesses via WhatsApp instead of email. The pipeline: find businesses on Google Maps, extract phone numbers, compose personalized WhatsApp messages. This tutorial builds the data collection and message generation steps.

Prerequisites

  • Scavio API key
  • Python 3.8+
  • WhatsApp Business API or manual outreach workflow

Walkthrough

Step 1: Search Google Maps for local businesses

Use Scavio to find businesses by category and location.

Python
import requests, os
H = {'Authorization': 'Bearer ' + os.environ['SCAVIO_API_KEY']}

def find_businesses(category, location):
    data = requests.post('https://api.scavio.dev/api/v2/google',
        headers=H,
        json={'query': f'{category} in {location}'}).json()
    return data.get('local_results', [])

Step 2: Extract and qualify leads

Filter businesses with phone numbers and no existing website (higher conversion potential).

Python
def qualify_leads(businesses):
    qualified = []
    for b in businesses:
        phone = b.get('phone')
        website = b.get('website')
        if phone:
            qualified.append({
                'name': b.get('title'),
                'phone': phone,
                'address': b.get('address'),
                'rating': b.get('rating'),
                'has_website': bool(website),
                'reviews': b.get('reviews', 0)
            })
    return qualified

Step 3: Generate personalized WhatsApp messages

Create message templates with business-specific details.

Python
def whatsapp_message(lead, your_service):
    name = lead['name']
    msg = (f'Hi, I came across {name} and noticed you have great reviews '
           f'({lead["rating"]} stars). I help local businesses like yours with '
           f'{your_service}. Would you be open to a quick chat?')
    # WhatsApp click-to-chat URL
    phone_clean = lead['phone'].replace(' ', '').replace('-', '').replace('(', '').replace(')', '')
    wa_url = f'https://wa.me/{phone_clean}?text={requests.utils.quote(msg)}'
    return {'message': msg, 'wa_url': wa_url}

Step 4: Export lead list with WhatsApp links

Save qualified leads with pre-built WhatsApp links.

Python
import csv

def export_leads(leads, service, filename='leads.csv'):
    with open(filename, 'w', newline='') as f:
        w = csv.DictWriter(f, fieldnames=['name', 'phone', 'rating', 'reviews', 'wa_url'])
        w.writeheader()
        for lead in leads:
            msg = whatsapp_message(lead, service)
            lead['wa_url'] = msg['wa_url']
            w.writerow({k: lead.get(k) for k in w.fieldnames})

Python Example

Python
import os, requests
H = {'Authorization': 'Bearer ' + os.environ['SCAVIO_API_KEY']}

leads = requests.post('https://api.scavio.dev/api/v2/google', headers=H,
    json={'query': 'plumber in Austin TX'}).json()
for biz in leads.get('local_results', []):
    if biz.get('phone'):
        print(f"{biz['title']}: {biz['phone']}")

JavaScript Example

JavaScript
const res = await fetch('https://api.scavio.dev/api/v2/google', {
  method: 'POST',
  headers: {'Authorization': `Bearer ${process.env.SCAVIO_API_KEY}`, 'Content-Type': 'application/json'},
  body: JSON.stringify({query: 'plumber in Austin TX'})
});
const data = await res.json();
data.local_results?.filter(b => b.phone).forEach(b => console.log(b.title, b.phone));

Expected Output

JSON
CSV of qualified local business leads with phone numbers, ratings, and pre-built WhatsApp click-to-chat URLs. One search query = $0.005.

Related Tutorials

    Frequently Asked Questions

    Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

    Scavio API key. Python 3.8+. WhatsApp Business API or manual outreach workflow. A Scavio API key gives you 50 free credits on signup.

    Yes. The free tier includes 50 credits on signup, which is more than enough to complete this tutorial and prototype a working solution.

    Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

    Related Resources

    Best Of

    Best Google Maps Data API in 2026

    Read more
    Use Case

    Small Business Google Maps Outreach

    Read more
    Comparison

    Google Maps Scraper vs Search API (SERP-based local results)

    Read more
    Glossary

    Google Maps Places API Cost

    Read more
    Comparison

    Google Places API vs SERP Local Pack API

    Read more
    Best Of

    Best Search APIs for Local LLMs After Google Shutdown

    Read more

    Start Building

    Build a pipeline from Google Maps business data to WhatsApp outreach messages. Find local businesses and reach them directly. With Python and JavaScript code.

    Get Free API KeyRead the Docs
    ScavioScavio

    One scraper API for every social, search, e-commerce and real estate platform. Built for AI agents.

    Product

    • Features
    • Pricing
    • Dashboard
    • Affiliates

    Developers

    • Documentation
    • API Reference
    • Quickstart
    • MCP Integration
    • Python SDK

    Alternatives

    • Tavily Alternative
    • SerpAPI Alternative
    • Firecrawl Alternative
    • Exa Alternative
    • Serper Alternative
    • Tavily vs Scavio
    • SerpAPI vs Scavio
    • All alternatives
    • Compare Scavio vs alternatives

    Search APIs

    • Google Search API
    • Amazon Product API
    • YouTube API
    • Reddit API
    • Walmart Product API
    • TikTok API
    • Instagram API

    Tools

    • All Tools

    © 2026 Scavio. All rights reserved.

    Featured on TAAFT
    Terms of ServicePrivacy Policy