DEV Community

Cover image for Extract Business Directory Listings into Google Sheets with n8n and AI
Snapshot Site
Snapshot Site

Posted on

Extract Business Directory Listings into Google Sheets with n8n and AI

Manually copying companies from business directories into a spreadsheet is slow, repetitive, and difficult to scale.

A single directory page can contain dozens of businesses, each with information such as:

  • Company name
  • Category
  • Address
  • Phone number
  • Email
  • Website
  • Opening hours
  • Rating and reviews

With n8n, Snapshot Site, OpenAI, and Google Sheets, you can automate the entire extraction process without maintaining fragile CSS selectors.

What the workflow does

The workflow follows this pipeline:

Google Sheets directory URLs
        ↓
Snapshot Site renders the page
        ↓
HTML is cleaned
        ↓
AI extracts structured business listings
        ↓
Each business becomes an n8n item
        ↓
Google Sheets appends or updates the rows
Enter fullscreen mode Exit fullscreen mode

A scheduled trigger starts the workflow and reads directory URLs from a Directory Sources sheet.

For each URL, the Snapshot Site n8n node loads the fully rendered page and returns its HTML. This is especially useful for directories that rely on JavaScript to display their listings.

The HTML is then cleaned before being sent to an AI Information Extractor.

The extraction schema

Instead of returning a single object, the AI returns a businesses array.

Each business can contain fields such as:

{
  "companyName": "Example Company",
  "category": "Web Development",
  "description": "Digital agency specializing in SaaS products",
  "address": "10 Example Street",
  "postalCode": "75001",
  "city": "Paris",
  "country": "France",
  "phone": "+33 1 00 00 00 00",
  "email": "contact@example.com",
  "website": "https://example.com",
  "openingHours": "Monday-Friday, 9:00-18:00",
  "rating": 4.7,
  "reviews": 82,
  "directoryUrl": "https://directory.example/business/example-company"
}
Enter fullscreen mode Exit fullscreen mode

The Split Out node converts the array into individual n8n items.

This means that one captured directory page can produce 20, 40, or even 50 Google Sheets rows.

Avoiding duplicate or overwritten rows

The Google Sheets node uses an append-or-update operation.

For this to work correctly, you need a reliable unique field.

The best option is usually:

directoryUrl
Enter fullscreen mode Exit fullscreen mode

However, some directories use relative URLs or do not expose a unique listing URL clearly.

Before activating the workflow:

  1. Run it manually with one directory page.
  2. Inspect the output of the Split Out node.
  3. Check that every directoryUrl is different.
  4. If the values are empty or identical, use website or companyName as the matching column.

A bad matching key can cause every extracted business to overwrite the previous row, even when the workflow reports a successful execution.

Handling pagination

The workflow processes one page per source URL.

It does not automatically discover the next page.

For a paginated directory, add every page to the Directory Sources sheet:

https://directory.example/plumbers?page=1
https://directory.example/plumbers?page=2
https://directory.example/plumbers?page=3
Enter fullscreen mode Exit fullscreen mode

This approach is simple and transparent: the spreadsheet defines exactly which pages the workflow will process.

Request usage

Every source URL uses one Snapshot Site request per workflow run.

Examples:

10 pages every day  ≈ 300 requests per month
30 pages every day  ≈ 900 requests per month
30 pages every week ≈ 130 requests per month
Enter fullscreen mode Exit fullscreen mode

Directories that display more listings per page provide better extraction efficiency because you get more spreadsheet rows from each request.

Error handling

The workflow also includes:

  • Automatic retries
  • API error detection
  • A dedicated Extraction Errors sheet
  • Continuous processing when one source fails

A failed directory page is logged with:

URL
Error message
Timestamp
Enter fullscreen mode Exit fullscreen mode

The remaining URLs can continue processing normally.

Requirements

You will need:

  • An n8n instance
  • The verified n8n-nodes-snapshot-site community node
  • A Snapshot Site API key
  • An OpenAI credential
  • A Google Sheets OAuth2 credential

Create three tabs in your spreadsheet:

Directory Sources
Businesses
Extraction Errors
Enter fullscreen mode Exit fullscreen mode

Add the column headers before configuring the Google Sheets nodes so that n8n can detect the available fields.

Important: respect website policies

A publicly accessible directory does not automatically allow automated bulk extraction.

Before adding a source:

  • Read its terms of service
  • Check its robots directives
  • Confirm that automated extraction is permitted
  • Avoid collecting personal or restricted information

Only process websites and data you are authorized to use.

Use cases

This workflow can help with:

  • Local market research
  • B2B prospect list creation
  • Partner discovery
  • Industry mapping
  • Supplier research
  • Competitive landscape analysis

It is designed primarily for building or refreshing structured datasets.

For continuous website change monitoring, a visual-diff workflow is usually more appropriate.

Try the complete workflow

The complete guide, including technical details, pagination considerations, deduplication issues, and setup instructions, is available here:

https://snapshot-site.com/posts/extract-business-directory-listings-into-google-sheets-with-n8n-and-ai

Snapshot Site provides a screenshot and rendered-page API for developers, automation workflows, and AI agents.

You can use it with n8n to capture dynamic websites, extract rendered HTML, analyze pages with AI, and monitor visual changes.

Top comments (0)