Overview
Marketing teams need directory data in spreadsheets, not JSON. This n8n workflow searches Google Maps for businesses in target categories, extracts structured data (name, address, phone, rating, website), and writes results directly into a Google Sheet. No code, no CSV exports, no manual copy-paste. The sheet updates on schedule with fresh data every week.
Trigger
Weekly on Monday 9 AM via n8n cron trigger.
Schedule
Weekly
Workflow Steps
n8n Cron Trigger
Schedule node fires weekly. Configure timezone and day of week.
HTTP Request to Scavio API
HTTP Request node calls Scavio with google-maps platform parameter and business category query.
Parse and Flatten Results
Function node extracts name, address, phone, rating, reviews, and website from each result.
Write to Google Sheets
Google Sheets node appends rows to the target sheet. One row per business with all extracted fields.
Send Completion Notification
Slack or email node sends a summary: number of new businesses found and sheet link.
Python Implementation
import requests, os, json
API_KEY = os.environ["SCAVIO_API_KEY"]
H = {"x-api-key": API_KEY, "Content-Type": "application/json"}
# This mirrors the n8n HTTP Request node logic
def extract_directory(queries: list) -> list:
all_rows = []
for query in queries:
resp = requests.post(
"https://api.scavio.dev/api/v1/search",
headers=H,
json={"query": query, "platform": "google-maps"},
timeout=15,
)
results = resp.json().get("local_results", [])
for r in results:
all_rows.append({
"name": r.get("title", ""),
"address": r.get("address", ""),
"phone": r.get("phone", ""),
"rating": r.get("rating", ""),
"reviews": r.get("reviews", 0),
"website": r.get("website", ""),
"query": query,
})
return all_rows
queries = [
"accounting firms in Denver CO",
"marketing agencies in Denver CO",
"law firms in Denver CO",
]
rows = extract_directory(queries)
print(f"Extracted {len(rows)} directory entries")
for row in rows[:3]:
print(f" {row['name']} | {row['rating']} stars | {row['reviews']} reviews")
# In n8n, the Google Sheets node writes these rows directly
# No CSV export needed -- n8n handles the Sheets API connectionJavaScript Implementation
const H = {'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json'};
async function extractDirectory(queries) {
const allRows = [];
for (const query of queries) {
const r = await fetch('https://api.scavio.dev/api/v1/search', {method:'POST', headers:H, body:JSON.stringify({query, platform:'google-maps'})});
const results = (await r.json()).local_results || [];
for (const res of results) {
allRows.push({name:res.title||'', address:res.address||'', phone:res.phone||'', rating:res.rating||'', reviews:res.reviews||0, website:res.website||'', query});
}
}
return allRows;
}
const queries = ['accounting firms in Denver CO', 'marketing agencies in Denver CO', 'law firms in Denver CO'];
const rows = await extractDirectory(queries);
console.log('Extracted '+rows.length+' directory entries');
for (const row of rows.slice(0,3)) console.log(' '+row.name+' | '+row.rating+' stars | '+row.reviews+' reviews');
// In n8n, the Google Sheets node writes these rows directly
// No CSV export needed -- n8n handles the Sheets API connectionPlatforms Used
Google Maps
Local business search with ratings and contact info