Overview
This workflow searches Google Maps via Scavio for local businesses in a target category and geography, extracts phone numbers and business details, generates personalized WhatsApp message templates, and outputs a ready-to-send lead sheet. Each lead includes the business name, category, phone, rating, and a personalized opening line.
Trigger
Manual (run when building a new lead list)
Schedule
On-demand (manual trigger)
Workflow Steps
Define target queries
Specify business category and location combinations: 'dentist Miami FL', 'plumber Austin TX', 'restaurant Chicago IL'. Each combination becomes a search query.
Search Google Maps via Scavio
For each query, call Scavio with platform google and type maps. Extract local_results with business name, phone, address, rating, and category.
Filter leads with phone numbers
Discard results without phone numbers. These businesses cannot be reached via WhatsApp. Keep only leads with valid phone data.
Generate personalized templates
For each lead, create a WhatsApp message template that references the business name, category, and location. Keep messages under 200 characters for readability.
Export lead sheet
Write the final lead list to CSV or JSON with columns: name, phone, address, rating, category, message_template.
Python Implementation
import requests, os, csv
SCAVIO_KEY = os.environ["SCAVIO_API_KEY"]
H = {"x-api-key": SCAVIO_KEY}
QUERIES = ["dentist Miami FL", "plumber Austin TX", "accountant Denver CO"]
def get_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)
results = resp.json().get("local_results", [])
leads = []
for r in results:
if r.get("phone"):
leads.append({
"name": r["title"], "phone": r["phone"],
"address": r.get("address", ""), "rating": r.get("rating", ""),
"category": query.split()[0],
"template": f"Hi {r['title']}, I help {query.split()[0]}s in {' '.join(query.split()[1:])} grow online. Quick question about your website?"
})
return leads
all_leads = []
for q in QUERIES:
all_leads.extend(get_leads(q))
with open("leads.csv", "w", newline="") as f:
w = csv.DictWriter(f, fieldnames=["name", "phone", "address", "rating", "category", "template"])
w.writeheader()
w.writerows(all_leads)
print(f"Exported {len(all_leads)} leads")JavaScript Implementation
const QUERIES = ["dentist Miami FL", "plumber Austin TX", "accountant Denver CO"];
async function getLeads(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" })
});
const results = (await resp.json()).local_results || [];
const category = query.split(" ")[0];
const location = query.split(" ").slice(1).join(" ");
return results.filter(r => r.phone).map(r => ({
name: r.title, phone: r.phone, address: r.address || "",
rating: r.rating || "", category,
template: `Hi ${r.title}, I help ${category}s in ${location} grow online. Quick question about your website?`
}));
}
const allLeads = [];
for (const q of QUERIES) {
allLeads.push(...await getLeads(q));
}
console.log(`Total leads: ${allLeads.length}`);
console.log(JSON.stringify(allLeads, null, 2));Platforms Used
Web search with knowledge graph, PAA, and AI overviews