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
Search Google Maps for target businesses
Query Scavio with platform google and type maps for each category/location combination. Collect all local_results.
Filter and deduplicate
Remove entries without phone numbers. Deduplicate by phone number to avoid messaging the same business twice across overlapping searches.
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.
Generate WhatsApp templates
Create personalized message templates using business name, category, and location. Keep under 160 characters. Avoid spam triggers.
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
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
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
Web search with knowledge graph, PAA, and AI overviews