🎣 Scrape B2B leads from Google Maps to Google Sheets with HasData
⚡ 73 views · 🎣 Lead Generation & Enrichment
💡 Pro Tip — HTTP Request scraping tends to break when sites update their markup. If you’re scraping a major platform, check if ScraperNode covers it — it has maintained scrapers for LinkedIn, Instagram, TikTok, YouTube, and 20+ other platforms that return structured data.
Description
This n8n template shows how to build a complete B2B lead generation pipeline that scrapes Google Maps for businesses and enriches them with emails from their websites or Google search.
Use cases: Find local businesses with contact info for cold email campaigns, B2B prospecting, market research, or building CRM databases.
How it works
- You define search queries, locations, and page counts in a
configsheet inside a Google Spreadsheet called “Leads”. - On each run, the workflow creates a new timestamped results sheet so previous runs don’t get overwritten.
- It reads every row from
config, generates paginated search tasks (20 results per page), and fires them at the HasData Google Maps API. - Results get split into individual businesses. Duplicates are removed by name and place ID.
- For each business with a website, the HasData web scraper hits the URL directly and pulls any emails it finds.
- If no emails turn up on the website, or there’s no website at all, the workflow runs a targeted Google search:
"business name, city" email "@"and parses the organic results with a regex. - All leads (whether emails came from the site or from Google) merge into one stream and get written to the results sheet: name, phone, address, website, emails, rating, reviews, type.
How to set up
- Install the HasData n8n node on your self-hosted instance.
- Connect your HasData API credentials and your Google Sheets OAuth2 credentials inside the workflow.
- In your Google Spreadsheet named
Leads, add a sheet calledconfigwith these columns:leads_queryfor the search term (e.g.coffee shops)locationfor city, state, zip code, or a specific addresspage_countfor number of pages to fetch (20 results per page)offsetfor starting page number (use1to start from the beginning)
- Click Manual Trigger to run.
Requirements
- Self-hosted n8n (community node required)
- HasData account with API key
- Google account with Sheets API access (OAuth2)
- Google Spreadsheet named
Leadswith aconfigsheet
Customizing this workflow
- Swap the Manual Trigger for a Schedule trigger to run nightly lead generation automatically.
- Add a filter node after “Remove Duplicates” to target only businesses above a minimum rating.
- Extend the “Format Lead” nodes to capture additional fields from the Maps API like categories, hours, or social links.
- Point the output to a CRM via HTTP Request instead of Google Sheets.
Further reading
The full build walkthrough, including real test results, node-by-node screenshots, and the regex logic behind the Google search fallback, is on the HasData blog: How to scrape leads with n8n.
🔗 Nodes Used
Google Sheets
📥 Import
Download workflow.json and import into n8n:
Workflow menu → Import from File