Lead Generation & Contact Extraction
Extract contact information from business directories, company pages, and industry listings to build targeted lead lists at scale.
Responsible Use
The Problem
Sales and marketing teams need qualified leads, but building contact lists manually is extremely time-consuming. Data is spread across directories, company websites, and professional networks:
- Business directories have thousands of listings but no export functionality
- Company websites have contact info in different formats and locations
- Job boards reveal hiring companies and decision-maker roles
- Industry listings and trade association pages have member directories
Solution Architecture
Combine crawling, extraction schemas, and batch processing to build lead lists efficiently:
1. Discover
POST /crawl or POST /search to find business listings, company pages, and directory entries.
2. Extract
POST /scrape with extraction_schema targeting contact fields: company name, email, phone, address, industry.
3. Scale
POST /batch to process hundreds of company pages in parallel and build your lead database.
Quick Example
Extract business contact information from a company page:
import requests
response = requests.post(
"https://api.alterlab.io/api/v1/scrape",
headers={"X-API-Key": "YOUR_API_KEY"},
json={
"url": "https://example-company.com/contact",
"extraction_schema": {
"type": "object",
"properties": {
"company_name": {"type": "string"},
"email": {"type": "string"},
"phone": {"type": "string"},
"address": {"type": "string"},
"industry": {"type": "string"},
"employee_count": {"type": "string"}
}
}
}
)
contact = response.json().get("filtered_content", {})
print(f"{contact.get('company_name')}: {contact.get('email')}")Advanced Patterns
Directory Scraping
Crawl business directories to discover company pages, then batch extract contact information:
import requests
contact_schema = {
"type": "object",
"properties": {
"company_name": {"type": "string"},
"email": {"type": "string"},
"phone": {"type": "string"},
"website": {"type": "string"},
"address": {"type": "string"},
"industry": {"type": "string"}
}
}
# Step 1: Crawl a business directory to find company pages
crawl_resp = requests.post(
"https://api.alterlab.io/api/v1/crawl",
headers={"X-API-Key": "YOUR_API_KEY"},
json={
"url": "https://directory.example.com/category/software",
"max_pages": 50,
"webhook_url": "https://your-app.com/webhooks/leads"
}
)
# Step 2: When crawl results arrive, batch extract contacts
company_urls = [
"https://company1.com/about",
"https://company2.com/contact",
# ... URLs from crawl results
]
batch_resp = requests.post(
"https://api.alterlab.io/api/v1/batch",
headers={"X-API-Key": "YOUR_API_KEY"},
json={
"requests": [
{"url": url, "extraction_schema": contact_schema}
for url in company_urls
]
}
)
job_id = batch_resp.json().get("job_id")
print(f"Lead extraction batch: {job_id}")Company Enrichment
Enrich existing lead lists by scraping company websites for additional data points:
import requests
def enrich_company(api_key, website_url):
"""Enrich a company record with data from their website."""
enrichment_schema = {
"type": "object",
"properties": {
"company_name": {"type": "string"},
"description": {"type": "string"},
"industry": {"type": "string"},
"headquarters": {"type": "string"},
"founded_year": {"type": "string"},
"employee_count": {"type": "string"},
"key_products": {"type": "array"}
}
}
resp = requests.post(
"https://api.alterlab.io/api/v1/scrape",
headers={"X-API-Key": api_key},
json={
"url": website_url,
"extraction_schema": enrichment_schema
}
)
return resp.json().get("filtered_content", {})
# Enrich existing leads
leads = [
{"company": "Acme Corp", "website": "https://acme.com/about"},
{"company": "Widget Inc", "website": "https://widget.io/about"},
]
for lead in leads:
enriched = enrich_company("YOUR_API_KEY", lead["website"])
lead.update(enriched)
print(f"{lead['company']}: {enriched.get('industry', 'N/A')}")Caching for Enrichment
Related Guides
Batch Scraping Guide
Submit up to 1,000 URLs in a single API call for bulk extraction.
JSON Schema Filtering
Define extraction schemas for structured contact data output.
Structured Extraction Tutorial
Use AI to extract structured JSON data from any web page.
Pricing Reference
Understand tier costs for lead generation workloads.