An r/BusinessHub thread asked how to scale Google Maps lead generation without manual copy-paste. The answer most people skip: SERP queries scoped to google.com/maps return structured local-pack results without a browser. This tutorial walks the pattern.
Prerequisites
- Python 3.10+
- Scavio API key
Walkthrough
Step 1: Define the seed list
City + practice area pairs.
SEEDS = [('Austin TX', 'dentist'), ('Austin TX', 'med spa'), ('Austin TX', 'real estate broker')]Step 2: SERP query for the local pack
Map-scoped query returns business listings.
import requests, os
API_KEY = os.environ['SCAVIO_API_KEY']
def local_pack(city, practice):
return requests.post('https://api.scavio.dev/api/v1/search',
headers={'x-api-key': API_KEY},
json={'query': f'{practice} {city}', 'search_type': 'local'}).json()Step 3: Extract business data per result
Name, phone, website come back structured.
def normalize(local):
rows = []
for biz in local.get('local_results', []):
rows.append({'name': biz.get('title'), 'phone': biz.get('phone'), 'website': biz.get('website'), 'address': biz.get('address')})
return rowsStep 4: Verify website and pull homepage
Extract endpoint converts the homepage to markdown.
def verify(rows):
for r in rows:
if r.get('website'):
md = requests.post('https://api.scavio.dev/api/v1/extract',
headers={'x-api-key': API_KEY}, json={'url': r['website'], 'format': 'markdown'}).json()
r['site_excerpt'] = md.get('markdown', '')[:500]
return rowsStep 5: Dedupe + write CSV
Drop into a CRM or BI tool.
import csv
with open('leads.csv', 'w') as f:
w = csv.DictWriter(f, fieldnames=['name','phone','website','address','site_excerpt'])
w.writeheader(); w.writerows(verified)Python Example
import os, requests, csv
API_KEY = os.environ['SCAVIO_API_KEY']
H = {'x-api-key': API_KEY}
def leads(city, niche):
r = requests.post('https://api.scavio.dev/api/v1/search', headers=H, json={'query': f'{niche} {city}', 'search_type': 'local'}).json()
return [{'name': b.get('title'), 'phone': b.get('phone'), 'website': b.get('website')} for b in r.get('local_results', [])]
print(leads('Austin TX', 'dentist'))JavaScript Example
const H = { 'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json' };
export async function leads(city, niche) {
const r = await fetch('https://api.scavio.dev/api/v1/search', { method:'POST', headers:H, body: JSON.stringify({ query: `${niche} ${city}`, search_type: 'local' }) }).then(r => r.json());
return r.local_results || [];
}Expected Output
About 20 local businesses per (city, niche) seed, with name, phone, website, and address. Verified excerpt for each that has a public site.