You can enrich leads in n8n by adding an HTTP Request node that calls the Scavio search API with the company name, then parsing the results to extract the website, description, and employee count into your lead record.
Prerequisites
- n8n installed (self-hosted or cloud)
- Scavio API key
- Input list of company names
Walkthrough
Step 1: Create the HTTP Request node for search
Add an HTTP Request node in n8n with POST method and the Scavio search endpoint.
// n8n HTTP Request Node Configuration
// Method: POST
// URL: https://api.scavio.dev/api/v1/search
// Authentication: Header Auth
// Name: x-api-key
// Value: {{ $env.SCAVIO_API_KEY }}
// Body (JSON):
{
"query": "{{ $json.company_name }} company website about",
"num_results": 5
}Step 2: Parse the search results with a Code node
Add a Code node after the HTTP Request to extract structured fields from the SERP results.
// n8n Code Node (JavaScript)
const results = $input.item.json.organic_results || [];
const companyName = $('Input').item.json.company_name;
// Find the most relevant result (usually the first)
const main = results[0] || {};
// Try to find official website (avoid Wikipedia, LinkedIn)
const officialSite = results.find(r =>
!r.link.includes('wikipedia') &&
!r.link.includes('linkedin') &&
!r.link.includes('crunchbase')
);
return {
company_name: companyName,
website: officialSite?.link || null,
description: main.snippet || null,
search_title: main.title || null,
enriched_at: new Date().toISOString()
};Step 3: Extract the company from the organic results
Get funding, employee count, or industry by parsing the knowledge panel if present.
// Extended Code node to include knowledge panel data
const data = $input.item.json;
const kp = data.knowledge_panel || {};
const results = data.organic_results || [];
const officialSite = results.find(r =>
!r.link.includes('wikipedia') &&
!r.link.includes('linkedin') &&
!r.link.includes('crunchbase')
);
return {
company_name: $('Input').item.json.company_name,
website: officialSite?.link || kp.website || null,
description: kp.description || results[0]?.snippet || null,
industry: kp.industry || null,
founded: kp.founded || null,
headquarters: kp.headquarters || null,
enriched_at: new Date().toISOString()
};Step 4: Verify with the Python equivalent
Use this Python script to test your enrichment logic before wiring up n8n.
import requests
API_KEY = "your-scavio-api-key"
def enrich_company(company_name: str) -> dict:
r = requests.post(
"https://api.scavio.dev/api/v1/search",
json={"query": f"{company_name} company website about", "num_results": 5},
headers={"x-api-key": API_KEY},
timeout=15
)
r.raise_for_status()
data = r.json()
results = data.get("organic_results", [])
kp = data.get("knowledge_panel", {})
official = next(
(res for res in results
if not any(x in res["link"] for x in ["wikipedia", "linkedin", "crunchbase"])),
results[0] if results else {}
)
return {
"company": company_name,
"website": official.get("link") or kp.get("website"),
"description": kp.get("description") or official.get("snippet"),
"industry": kp.get("industry"),
"founded": kp.get("founded")
}
print(enrich_company("Notion"))Python Example
import requests
from typing import Optional
API_KEY = "your-scavio-api-key"
EXCLUDE_DOMAINS = ["wikipedia.org", "linkedin.com", "crunchbase.com", "facebook.com", "twitter.com"]
def enrich_company(company_name: str) -> dict:
r = requests.post(
"https://api.scavio.dev/api/v1/search",
json={"query": f"{company_name} company official website", "num_results": 10},
headers={"x-api-key": API_KEY},
timeout=15
)
r.raise_for_status()
data = r.json()
results = data.get("organic_results", [])
kp = data.get("knowledge_panel", {})
official = next(
(res for res in results if not any(exc in res.get("link", "") for exc in EXCLUDE_DOMAINS)),
results[0] if results else {}
)
return {
"company": company_name,
"website": official.get("link") or kp.get("website"),
"description": kp.get("description") or official.get("snippet"),
"industry": kp.get("industry"),
"founded": kp.get("founded"),
"headquarters": kp.get("headquarters"),
"source": official.get("link")
}
def enrich_batch(companies: list[str]) -> list[dict]:
results = []
for company in companies:
try:
record = enrich_company(company)
results.append(record)
print(f"Enriched: {company} -> {record.get('website')}")
except Exception as e:
print(f"Failed: {company} -> {e}")
results.append({"company": company, "error": str(e)})
return results
if __name__ == "__main__":
companies = ["Notion", "Linear", "Retool", "Vercel", "PlanetScale"]
enriched = enrich_batch(companies)
import json
print(json.dumps(enriched, indent=2))JavaScript Example
const API_KEY = 'your-scavio-api-key';
const EXCLUDE = ['wikipedia.org', 'linkedin.com', 'crunchbase.com'];
async function enrichCompany(companyName) {
const res = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'x-api-key': API_KEY },
body: JSON.stringify({ query: `${companyName} company official website`, num_results: 10 })
});
const data = await res.json();
const results = data.organic_results ?? [];
const kp = data.knowledge_panel ?? {};
const official = results.find(r => !EXCLUDE.some(e => r.link?.includes(e))) ?? results[0] ?? {};
return {
company: companyName,
website: official.link ?? kp.website ?? null,
description: kp.description ?? official.snippet ?? null,
industry: kp.industry ?? null,
founded: kp.founded ?? null
};
}
const companies = ['Notion', 'Linear', 'Retool'];
for (const c of companies) {
const record = await enrichCompany(c);
console.log(JSON.stringify(record, null, 2));
}Expected Output
{
"company": "Notion",
"website": "https://www.notion.so",
"description": "Notion is a productivity and note-taking web application. It offers organizational tools including task management, project tracking, to-do lists, bookmarking, and more.",
"industry": "Software",
"founded": "2013",
"headquarters": "San Francisco, CA"
}