🎣 Beginner lead finder using SerpAPI search

⚑ 1,874 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.

View All Scrapers

Description

This n8n workflow finds experts on any topic, scrapes their websites, and pulls out contact emails automatically.
Core services used: SerpAPI (google search) Β· Apify (website crawler) Β· OpenAI (GPT-4o email extraction).


πŸ› οΈ Step-by-Step Setup & Execution

1️⃣ Run Workflow (Manual Trigger)

NodeTypePurpose
Run WorkflowManual TriggerStart the workflow on demand while you test.

2️⃣ Set Your Topic

NodeTypeHow to configure
Set TopicSetAdd a string field Topic – e.g. "n8n". This keyword drives every subsequent step.

3️⃣ Search Google (Results 1-10)

NodeTypeAPI Credential
Search Google (top 10)SerpAPICreate SerpAPI credential
1. Sign up β†’ copy API key β†’ n8n β†’ Credentials β†’ New β†’ SerpAPI β†’ paste.
2. Select the credential in this node.
Key Params
q={{ $json.Topic }} Expert
locationRegion code (ex 585069efee19ad271e9c9b36)
additionalFields.start"10" (Google position 1-10)

4️⃣ Search Google (Results 11-20)

NodeTypeNotes
Search Google (11-20)SerpAPI (same credential)Remove start or set to 20+ to fetch next page.

5️⃣ Extract URL Lists

NodeTypeScript Purpose
Extract Url & Extract Url 2CodeLoop data.organic_results β†’ output { title, link, displayed_link } for each result.

6️⃣ Combine Both Result Sets

NodeTypeDetails
Append ResultsMerge (combineAll)Merges arrays from steps 3 & 4 into a single list for processing.

7️⃣ Loop Over Every URL

NodeTypeConfiguration
Loop Over Items1Split In BatchesDefault batch = 1 (process one page at a time).
onError = continueRegularOutput keeps loop alive on failures.

8️⃣ Scrape Webpage Content (Apify)

NodeTypeAPI Credential
Scrape URL with apifyHTTP RequestCreate Apify credential
1. Sign up at https://console.apify.com
2. Account β†’ API tokens β†’ copy.
3. n8n β†’ Credentials β†’ New β†’ HTTP Query Auth β†’ set query param token=YOUR_TOKEN.
Request Details
MethodPOST
URLhttps://api.apify.com/v2/acts/6sigmag~fast-website-content-crawler/run-sync-get-dataset-items
JSON Bodyjson { "startUrls": ["{{ $json.link }}"] }

9️⃣ Extract Email with OpenAI

NodeTypeAPI Credential
Extract Email from webpageLangChain AgentCreate OpenAI credential
1. Generate key at https://platform.openai.com/account/api-keys
2. n8n β†’ Credentials β†’ New β†’ OpenAI API β†’ paste key.
Prompt (system)extract the email address from the text. if there is no email address, output null.
Output ParserStructured Output Parser2 expects β†’ { "email": "address OR null" }

πŸ”Ÿ Loop Continues & Final Data

πŸ’‘ Optional Enhancements Idea How Save Leads Add a Google Sheets or Airtable node after the loop. Validate Emails Chain a ZeroBounce / Hunter.io verification API before saving. Parallel Crawling Increase SplitInBatches size (watch Apify rate limits).

πŸ™‹β€β™‚οΈ Need More Help? Robert Breen – Automation Consultant & n8n Expert πŸ“§ robert.j.breen@gmail.com πŸ”— https://www.linkedin.com/in/robert-breen-29429625/ 🌐 https://ynteractive.com

πŸ”— Nodes Used

HTTP Request, AI Agent, OpenAI Chat Model, Structured Output Parser

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup