Tutorial

How to Build an SDR Research Agent

Automate SDR prospect research with an AI agent that pulls LinkedIn posts, recent news, and Reddit discussion before every email.

Generic outreach gets ignored. The SDRs who book meetings in 2026 send personalized notes that reference the prospect's recent LinkedIn post, their company's latest news, or a Reddit thread in their space. This tutorial walks through building an SDR research agent that pulls all three signals automatically for every prospect.

Prerequisites

  • Python 3.8+
  • A Scavio API key
  • An Apollo or HubSpot prospect list
  • OpenAI or Claude API for personalization draft

Walkthrough

Step 1: Load the prospect

Start with a prospect name and company.

Python
prospect = {'name': 'Jane Doe', 'company': 'Acme Corp', 'title': 'Head of Growth'}

Step 2: Fetch recent LinkedIn posts

Use Google SERP to find recent LinkedIn posts by the prospect.

Python
import requests, os
API_KEY = os.environ['SCAVIO_API_KEY']

def linkedin_posts(name):
    r = requests.post('https://api.scavio.dev/api/v1/search',
        headers={'x-api-key': API_KEY},
        json={'query': f'site:linkedin.com/posts "{name}"', 'num_results': 5})
    return r.json().get('organic_results', [])

Step 3: Fetch recent company news

Google News for the company's latest mentions.

Python
def company_news(company):
    r = requests.post('https://api.scavio.dev/api/v1/search',
        headers={'x-api-key': API_KEY},
        json={'query': f'"{company}"', 'tbm': 'nws'})
    return r.json().get('news_results', [])[:3]

Step 4: Fetch Reddit discussion in the prospect's space

Pull recent Reddit threads relevant to the prospect's role.

Python
def reddit_signals(title, company):
    r = requests.post('https://api.scavio.dev/api/v1/search',
        headers={'x-api-key': API_KEY},
        json={'platform': 'reddit', 'query': f'{title} {company}', 'time': 'month'})
    return r.json().get('posts', [])[:3]

Step 5: Draft personalized email

Feed all signals into Claude or GPT to draft the personalized cold email.

Python
import anthropic
client = anthropic.Anthropic()

def draft_email(prospect, posts, news, reddit):
    context = f'LinkedIn: {posts}\nNews: {news}\nReddit: {reddit}'
    resp = client.messages.create(
        model='claude-sonnet-4-6',
        max_tokens=500,
        messages=[{'role': 'user', 'content': f'Write a 3-sentence cold email to {prospect["name"]} at {prospect["company"]}. Context: {context}'}]
    )
    return resp.content[0].text

Python Example

Python
import os, requests
import anthropic

API_KEY = os.environ['SCAVIO_API_KEY']
claude = anthropic.Anthropic()

def research(prospect):
    posts = requests.post('https://api.scavio.dev/api/v1/search', headers={'x-api-key': API_KEY},
        json={'query': f'site:linkedin.com/posts "{prospect["name"]}"'}).json().get('organic_results', [])[:3]
    news = requests.post('https://api.scavio.dev/api/v1/search', headers={'x-api-key': API_KEY},
        json={'query': f'"{prospect["company"]}"', 'tbm': 'nws'}).json().get('news_results', [])[:3]
    reddit = requests.post('https://api.scavio.dev/api/v1/search', headers={'x-api-key': API_KEY},
        json={'platform': 'reddit', 'query': prospect['title'], 'time': 'month'}).json().get('posts', [])[:3]
    return {'posts': posts, 'news': news, 'reddit': reddit}

prospect = {'name': 'Jane Doe', 'company': 'Acme Corp', 'title': 'Head of Growth'}
signals = research(prospect)
print(signals)

JavaScript Example

JavaScript
const API_KEY = process.env.SCAVIO_API_KEY;
async function scavio(body) {
  const r = await fetch('https://api.scavio.dev/api/v1/search', {
    method: 'POST',
    headers: { 'x-api-key': API_KEY, 'Content-Type': 'application/json' },
    body: JSON.stringify(body)
  });
  return r.json();
}
const prospect = { name: 'Jane Doe', company: 'Acme Corp', title: 'Head of Growth' };
const [posts, news, reddit] = await Promise.all([
  scavio({ query: `site:linkedin.com/posts "${prospect.name}"` }),
  scavio({ query: `"${prospect.company}"`, tbm: 'nws' }),
  scavio({ platform: 'reddit', query: prospect.title, time: 'month' })
]);
console.log({ posts: posts.organic_results?.slice(0, 3), news: news.news_results?.slice(0, 3), reddit: reddit.posts?.slice(0, 3) });

Expected Output

JSON
For each prospect, the agent returns 3 LinkedIn posts, 3 company news items, and 3 Reddit threads in the prospect's space. Claude then drafts a 3-sentence cold email that references the most specific signal (e.g. 'Saw your post about Q4 pipeline hitting plan...').

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+. A Scavio API key. An Apollo or HubSpot prospect list. OpenAI or Claude API for personalization draft. A Scavio API key gives you 500 free credits per month.

Yes. The free tier includes 500 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

Automate SDR prospect research with an AI agent that pulls LinkedIn posts, recent news, and Reddit discussion before every email.