Google Maps Local Business Data Scraper - n8n Workflow

Scrape comprehensive Google Maps place data (website, phone, rating, address) using SerpAPI and automatically save results to Google Sheets with this powerful n8n workflow.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Lead generation specialists needing local business contact information.

  • Marketing professionals performing competitive analysis on local markets.

  • Data analysts requiring structured datasets of Google Maps listings.

  • Users looking for efficient web scraping solutions using an automated n8n node approach.

Overview

Acquiring structured data from Google Maps manually is tedious, and using the official Google Maps API can be costly. This powerful n8n workflow template solves this problem by integrating with SerpAPI to efficiently scrape detailed local business information, such as phone numbers, websites, ratings, and addresses. The entire process is automated: you simply provide the search URLs in a Google Sheet, and the n8n automation handles the rest, including complex tasks like pagination and data cleansing. Utilizing this n8n template ensures you get high-quality, normalized data written directly to a designated Google Sheet, making it a highly valuable n8n workflow for data acquisition.

How it Works

This automation offers two starting methods: either utilizing the manual n8n trigger ('When clicking "Execute Workflow"') or setting it to run periodically via the schedule n8n trigger ('Run workflow every hours').


  1. Input Data Fetch: The n8n workflow starts by connecting to Google Sheets to retrieve the search URLs entered by the user ('Google Sheets - Get searches to scrap').

  2. Preprocessing: The 'Extract keyword and location from URL' n8n node uses a regular expression to parse the URL, extracting the necessary keyword and geographical coordinates (geo) for the scraping request.

  3. Scraping Loop: The 'SERPAPI - Scrape Google Maps URL' n8n node sends the structured request to the SerpAPI service. After receiving the response, the 'Extract next start value' Code n8n node checks the pagination details.

  4. Pagination Control: The 'Continue IF Loop is complete' n8n node ensures that if a 'next' page is available, the workflow loops back to the 'SERPAPI - Scrape Google Maps URL' node, retrieving all subsequent pages until the entire result set is scraped. If an error occurs during scraping, the 'Update Status to Error' node marks the input row accordingly.

  5. Data Aggregation: The 'Merge all values from SERPAPI' Code n8n node aggregates all collected local business results from every page of the scrape.

  6. Data Cleaning: The data is then refined using the 'Split out items', 'Remove empty values' (Filter n8n node), and 'Transform data in the right format' Code n8n node. Crucially, the 'Remove duplicate items' n8n node uses the unique place_id field to deduplicate listings.

  7. Final Output: The clean, deduplicated list is written to the results tab in Google Sheets using the 'Add rows in Google Sheets' n8n node.

  8. Status Update: Finally, the 'Update Status to Success' n8n node marks the original search URL as completed in the input sheet.

Installation Guide

To deploy and use this powerful n8n workflow, follow these steps:


  1. Import: Copy the provided JSON data and paste it into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. Google Sheets Credentials: You need to configure the Google Sheets credentials. For the 'Google Sheets - Get searches to scrap' and 'Add rows in Google Sheets' n8n node steps, ensure you link a Google Sheets account with read/write access to the specified document.

  3. SerpAPI Credentials: Obtain an API key from SerpAPI. Create a new credential in n8n for 'SerpAPI' and enter your key. This credential must be linked to the 'SERPAPI - Scrape Google Maps URL' n8n node.

  4. Spreadsheet Setup: Clone the provided template spreadsheet link mentioned in the sticky note within the n8n workflow structure. Ensure your input data (Google Maps search URLs) is placed in the designated 'Add your search here' sheet.

  5. Execution: You can either activate the schedule n8n trigger to run hourly or use the 'Execute Workflow' n8n trigger for immediate testing.

Node Details


  • Schedule Trigger / Manual Trigger: These n8n trigger nodes initiate the workflow either on a fixed schedule (hourly interval is configured) or upon manual execution.

  • Google Sheets (Get searches to scrap): Fetches rows from the input sheet where Google Maps URLs are stored. Key configuration: Reads data from the 'Add your search here' sheet.

  • Set (Extract keyword and location from URL): A crucial n8n node that uses regex to parse the raw Google Maps URL, extracting the search query (keyword) and geo-coordinates (geo) required by the SERPAPI integration.

  • HTTP Request (SERPAPI - Scrape Google Maps URL): The core scraping n8n node. It is configured to use the googlemaps engine with parameters like q, ll, and start dynamically pulled from the previous node's output.

  • Code (Extract next start value): This custom n8n node parses the SERPAPI response to find the next pagination URL and extracts the start parameter, enabling the multi-page scraping loop.

  • If (Continue IF Loop is complete): Manages the pagination loop control, checking if the serpapipagination.next element exists before looping back to the SERPAPI n8n node.

  • Code (Merge all values from SERPAPI): Aggregates the local results from all successful SerpAPI calls during the looping process into a single item list.

  • Item Lists (Remove duplicate items): A cleanup n8n node that ensures data quality by removing duplicate entries based on the placeid field before saving.

  • Google Sheets (Add rows in Google Sheets): The final action n8n node. It updates or appends the structured, scraped data into the 'Results' sheet using appendOrUpdate operation, relying on placeid for matching.

Related n8n Workflows

Free

Nodes: 10 Nodes
Updated: December 26 2025
View all
Created by
Lucas Perret
Lucas Perret

Featured*