Workflow

Google Maps to WhatsApp Lead Pipeline

Complete pipeline from Google Maps business discovery to WhatsApp message delivery. Extract leads, verify phone numbers, generate templates, and track outreach.

Overview

This is the full end-to-end pipeline: discover local businesses via Google Maps, filter for those with phone numbers, verify numbers against business websites using the Extract endpoint, generate personalized WhatsApp templates, and log the outreach with response tracking. Designed for local marketing agencies running outreach campaigns at scale.

Trigger

Manual (run per campaign batch)

Schedule

On-demand (per campaign batch)

Workflow Steps

1

Search Google Maps for target businesses

Query Scavio with platform google and type maps for each category/location combination. Collect all local_results.

2

Filter and deduplicate

Remove entries without phone numbers. Deduplicate by phone number to avoid messaging the same business twice across overlapping searches.

3

Verify phone via Extract

For each lead with a website, call Scavio Extract endpoint to check if the phone number appears on the business website. Mark as verified or unverified.

4

Generate WhatsApp templates

Create personalized message templates using business name, category, and location. Keep under 160 characters. Avoid spam triggers.

5

Export to outreach tool

Write verified leads with templates to CSV. Import into WhatsApp Business API or manual outreach workflow. Include a tracking column for response status.

Python Implementation

Python
import requests, os, csv

SCAVIO_KEY = os.environ["SCAVIO_API_KEY"]
H = {"x-api-key": SCAVIO_KEY}

SEARCHES = [
    "dentist Miami FL", "dentist Fort Lauderdale FL",
    "plumber Austin TX", "electrician Houston TX"
]

def get_map_leads(query: str) -> list:
    resp = requests.post("https://api.scavio.dev/api/v1/search", headers=H,
        json={"platform": "google", "query": query, "type": "maps"}, timeout=10)
    return [r for r in resp.json().get("local_results", []) if r.get("phone")]

def verify_phone(website: str, phone: str) -> bool:
    try:
        page = requests.post("https://api.scavio.dev/api/v1/extract", headers=H,
            json={"url": website}, timeout=15).json()
        return phone in page.get("text", "")
    except Exception:
        return False

all_leads = []
seen_phones = set()
for query in SEARCHES:
    for lead in get_map_leads(query):
        if lead["phone"] not in seen_phones:
            seen_phones.add(lead["phone"])
            verified = verify_phone(lead.get("website", ""), lead["phone"]) if lead.get("website") else False
            all_leads.append({
                "name": lead["title"], "phone": lead["phone"],
                "address": lead.get("address", ""), "rating": lead.get("rating", ""),
                "verified": verified, "query": query,
                "template": f"Hi {lead['title']}, quick question about your online presence?"
            })

with open("verified_leads.csv", "w", newline="") as f:
    w = csv.DictWriter(f, fieldnames=all_leads[0].keys())
    w.writeheader()
    w.writerows(all_leads)
print(f"Total: {len(all_leads)} leads ({sum(1 for l in all_leads if l['verified'])} verified)")

JavaScript Implementation

JavaScript
const SEARCHES = [
  "dentist Miami FL", "dentist Fort Lauderdale FL",
  "plumber Austin TX", "electrician Houston TX"
];

async function getMapLeads(query) {
  const resp = await fetch("https://api.scavio.dev/api/v1/search", {
    method: "POST",
    headers: { "x-api-key": process.env.SCAVIO_API_KEY, "Content-Type": "application/json" },
    body: JSON.stringify({ platform: "google", query, type: "maps" })
  });
  return ((await resp.json()).local_results || []).filter(r => r.phone);
}

async function verifyPhone(website, phone) {
  try {
    const page = await fetch("https://api.scavio.dev/api/v1/extract", {
      method: "POST",
      headers: { "x-api-key": process.env.SCAVIO_API_KEY, "Content-Type": "application/json" },
      body: JSON.stringify({ url: website })
    }).then(r => r.json());
    return (page.text || "").includes(phone);
  } catch { return false; }
}

const allLeads = [];
const seenPhones = new Set();
for (const query of SEARCHES) {
  for (const lead of await getMapLeads(query)) {
    if (!seenPhones.has(lead.phone)) {
      seenPhones.add(lead.phone);
      const verified = lead.website ? await verifyPhone(lead.website, lead.phone) : false;
      allLeads.push({ name: lead.title, phone: lead.phone, verified,
        template: `Hi ${lead.title}, quick question about your online presence?` });
    }
  }
}
console.log(`Total: ${allLeads.length} leads (${allLeads.filter(l => l.verified).length} verified)`);

Platforms Used

Google

Web search with knowledge graph, PAA, and AI overviews

Frequently Asked Questions

This is the full end-to-end pipeline: discover local businesses via Google Maps, filter for those with phone numbers, verify numbers against business websites using the Extract endpoint, generate personalized WhatsApp templates, and log the outreach with response tracking. Designed for local marketing agencies running outreach campaigns at scale.

This workflow uses a manual (run per campaign batch). On-demand (per campaign batch).

This workflow uses the following Scavio platforms: google. Each platform is called via the same unified API endpoint.

Yes. Scavio's free tier includes 500 credits per month with no credit card required. That is enough to test and validate this workflow before scaling it.

Google Maps to WhatsApp Lead Pipeline

Complete pipeline from Google Maps business discovery to WhatsApp message delivery. Extract leads, verify phone numbers, generate templates, and track outreach.