Traditional lead enrichment tools like ZoomInfo and Apollo charge $0.10-0.50 per record from proprietary databases that update periodically. Search API enrichment takes a different approach: query live search results for each lead to get current company info, social presence, and online sentiment. This tutorial builds a Python enrichment pipeline that takes a list of company names and outputs enriched records with website, LinkedIn URL, review data, and recent news.
Prerequisites
- Python 3.8+ installed
- requests library installed
- A Scavio API key from scavio.dev
- A CSV of company names to enrich
Walkthrough
Step 1: Load your lead list
Read company names from a CSV file.
import csv
def load_leads(filepath: str) -> list:
with open(filepath) as f:
reader = csv.DictReader(f)
return [row['company_name'] for row in reader]
leads = load_leads('leads.csv')
print(f'Loaded {len(leads)} leads')Step 2: Enrich each lead with search data
Run multiple searches per lead to build a complete profile.
import requests, os
H = {'x-api-key': os.environ['SCAVIO_API_KEY']}
def enrich_lead(company: str) -> dict:
# Search for company website and info
info = requests.post('https://api.scavio.dev/api/v1/search', headers=H,
json={'platform': 'google', 'query': company}, timeout=10).json()
# Search for LinkedIn
linkedin = requests.post('https://api.scavio.dev/api/v1/search', headers=H,
json={'platform': 'google', 'query': f'{company} site:linkedin.com'}, timeout=10).json()
# Search for reviews
reviews = requests.post('https://api.scavio.dev/api/v1/search', headers=H,
json={'platform': 'google', 'query': f'{company} reviews'}, timeout=10).json()
return {
'company': company,
'website': info.get('organic', [{}])[0].get('link', ''),
'description': info.get('organic', [{}])[0].get('snippet', ''),
'linkedin': next((r['link'] for r in linkedin.get('organic', []) if 'linkedin.com' in r.get('link', '')), ''),
'review_count': len(reviews.get('organic', [])),
}Step 3: Process all leads with rate limiting
Enrich all leads with a small delay between requests to be respectful of rate limits.
import time
def enrich_all(leads: list, delay: float = 0.5) -> list:
enriched = []
for i, company in enumerate(leads):
try:
data = enrich_lead(company)
enriched.append(data)
print(f'[{i+1}/{len(leads)}] Enriched: {company}')
except Exception as e:
enriched.append({'company': company, 'error': str(e)})
print(f'[{i+1}/{len(leads)}] Failed: {company}: {e}')
time.sleep(delay)
return enrichedStep 4: Export enriched data
Save the enriched leads to a CSV for import into your CRM or outreach tool.
def export_enriched(data: list, filepath: str):
if not data: return
keys = data[0].keys()
with open(filepath, 'w', newline='') as f:
writer = csv.DictWriter(f, fieldnames=keys)
writer.writeheader()
writer.writerows(data)
print(f'Exported {len(data)} enriched leads to {filepath}')
enriched = enrich_all(leads)
export_enriched(enriched, 'enriched_leads.csv')Python Example
import requests, os, csv
H = {'x-api-key': os.environ['SCAVIO_API_KEY']}
def enrich(company):
data = requests.post('https://api.scavio.dev/api/v1/search', headers=H,
json={'platform': 'google', 'query': company}, timeout=10).json()
top = data.get('organic', [{}])[0]
return {'company': company, 'url': top.get('link', ''), 'snippet': top.get('snippet', '')}
# Usage: enriched = [enrich(c) for c in companies]JavaScript Example
async function enrich(company) {
const data = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST', headers: {'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json'},
body: JSON.stringify({platform: 'google', query: company})
}).then(r => r.json());
const top = data.organic?.[0] || {};
return {company, url: top.link, snippet: top.snippet};
}Expected Output
A CSV of enriched leads with company website, LinkedIn URL, description, and review presence data.