Workflow

n8n Directory Extraction to Google Sheets

n8n workflow that extracts business directory data via Scavio search API and writes structured results directly into Google Sheets for team access.

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

1

n8n Cron Trigger

Schedule node fires weekly. Configure timezone and day of week.

2

HTTP Request to Scavio API

HTTP Request node calls Scavio with google-maps platform parameter and business category query.

3

Parse and Flatten Results

Function node extracts name, address, phone, rating, reviews, and website from each result.

4

Write to Google Sheets

Google Sheets node appends rows to the target sheet. One row per business with all extracted fields.

5

Send Completion Notification

Slack or email node sends a summary: number of new businesses found and sheet link.

Python Implementation

Python
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 connection

JavaScript Implementation

JavaScript
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 connection

Platforms Used

Google Maps

Local business search with ratings and contact info

Frequently Asked Questions

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.

This workflow uses a weekly on monday 9 am via n8n cron trigger.. Weekly.

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

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

n8n Directory Extraction to Google Sheets

n8n workflow that extracts business directory data via Scavio search API and writes structured results directly into Google Sheets for team access.