Tutorial

How to Build a Cold Email Enrichment Pipeline

Enrich cold email prospects with search data. Add company context, recent news, and competitive positioning to personalize outreach at scale.

Cold emails that reference specific company details get significantly higher response rates than generic templates. A search-based enrichment pipeline adds real context to each prospect: recent company news, competitive positioning, technology stack signals, and industry mentions. This tutorial shows how to build an automated enrichment pipeline that takes a list of prospect domains, queries search data for each, and outputs enriched profiles ready for personalized outreach. You will transform a bare CSV of domains into a rich dataset that powers high-converting cold emails.

Prerequisites

  • Python 3.8+ installed
  • requests library installed
  • A Scavio API key from scavio.dev
  • A list of prospect company names or domains

Walkthrough

Step 1: Load prospect list

Read your prospect list and prepare it for enrichment.

Python
import os, requests, json, csv

API_KEY = os.environ["SCAVIO_API_KEY"]

PROSPECTS = [
    {"name": "Acme Corp", "domain": "acme.com"},
    {"name": "Widget Inc", "domain": "widget.io"},
    {"name": "DataFlow", "domain": "dataflow.dev"},
]

Step 2: Enrich with company context

Search for each company to find recent news, positioning, and competitive context.

Python
def enrich_company(name, domain):
    resp = requests.post("https://api.scavio.dev/api/v1/search",
        headers={"x-api-key": API_KEY},
        json={"platform": "google", "query": f"{name} {domain}"})
    data = resp.json()
    results = data.get("organic_results", [])[:5]
    return {
        "company": name, "domain": domain,
        "description": results[0].get("snippet","") if results else "",
        "recent_mentions": [{"title": r["title"], "url": r.get("link","")}
                           for r in results[:3]],
    }

Step 3: Find competitive positioning

Search for the company's industry to understand their competitive landscape.

Python
def find_competitors(name):
    resp = requests.post("https://api.scavio.dev/api/v1/search",
        headers={"x-api-key": API_KEY},
        json={"platform": "google", "query": f"{name} alternatives competitors"})
    results = resp.json().get("organic_results", [])[:3]
    return [r.get("title","") for r in results]

Step 4: Build enriched profiles

Combine all enrichment data and export for outreach.

Python
def enrich_pipeline(prospects):
    enriched = []
    for p in prospects:
        profile = enrich_company(p["name"], p["domain"])
        profile["competitors"] = find_competitors(p["name"])
        enriched.append(profile)
        print(f"Enriched: {p['name']} - {len(profile['recent_mentions'])} mentions")
    with open("enriched_prospects.json", "w") as f:
        json.dump(enriched, f, indent=2)
    print(f"\nEnriched {len(enriched)} prospects")
    return enriched

enrich_pipeline(PROSPECTS)

Step 5: Generate email snippets

Create personalized opening lines from enriched data.

Python
def generate_opener(profile):
    desc = profile.get("description", "")[:100]
    competitors = profile.get("competitors", [])
    if desc:
        return f"I noticed {profile['company']} - {desc}"
    elif competitors:
        return f"I saw {profile['company']} compared alongside {competitors[0][:30]}"
    return f"I came across {profile['company']} while researching the space"

for p in PROSPECTS:
    profile = enrich_company(p["name"], p["domain"])
    print(f"{p['name']}: {generate_opener(profile)}")

Python Example

Python
import os, requests
API_KEY = os.environ["SCAVIO_API_KEY"]
def enrich(company):
    resp = requests.post("https://api.scavio.dev/api/v1/search",
        headers={"x-api-key": API_KEY},
        json={"platform": "google", "query": company})
    results = resp.json().get("organic_results", [])[:3]
    return {"company": company,
            "context": results[0].get("snippet","") if results else ""}

for c in ["Stripe", "Notion", "Linear"]:
    print(enrich(c))

JavaScript Example

JavaScript
const H = {"x-api-key": process.env.SCAVIO_API_KEY, "Content-Type": "application/json"};
async function enrich(company) {
  const r = await fetch("https://api.scavio.dev/api/v1/search", {
    method: "POST", headers: H,
    body: JSON.stringify({platform: "google", query: company})
  });
  const results = (await r.json()).organic_results || [];
  return {company, context: results[0]?.snippet || ""};
}
enrich("Stripe").then(console.log);

Expected Output

JSON
An enriched prospect dataset with company descriptions, recent mentions, competitive context, and personalized email openers generated from live search data.

Related Tutorials

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

Python 3.8+ installed. requests library installed. A Scavio API key from scavio.dev. A list of prospect company names or domains. A Scavio API key gives you 250 free credits per month.

Yes. The free tier includes 250 credits per month, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Start Building

Enrich cold email prospects with search data. Add company context, recent news, and competitive positioning to personalize outreach at scale.