Tutorial

How to Build a B2B Real Estate Lead Engine with Scavio

Build a B2B real estate lead engine in two days with Claude Code. SERP plus Reddit signal feeds the agent's daily prospect digest.

B2B teams selling into real estate brokerages need fresh signals: brokerage moves, hiring posts, market commentary. Direct MLS access is gated and expensive. Public SERP plus Reddit covers 80% of the same signal at a fraction of the cost. This tutorial walks through the two-day Claude Code build that landed on Reddit in 2026.

Prerequisites

  • Python 3.10+
  • A Scavio API key
  • Anthropic API key for Claude Code

Walkthrough

Step 1: Define market and practice

Parameterize city plus practice area.

Python
def query_for(city, practice):
    return f'{practice} brokerages {city} 2026 hiring OR new listings'

Step 2: Run SERP discovery

Top 25 organic results plus brokerage news.

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

def discover(query):
    r = requests.post('https://api.scavio.dev/api/v1/google',
        headers={'x-api-key': API_KEY},
        json={'query': query, 'num_results': 25})
    return r.json().get('organic_results', [])

Step 3: Reddit signal per market

Reddit search for hiring threads and reviews.

Python
def reddit_signal(city, practice):
    r = requests.post('https://api.scavio.dev/api/v1/reddit/search',
        headers={'x-api-key': API_KEY},
        json={'query': f'{city} {practice} brokerage'})
    return r.json().get('posts', [])[:10]

Step 4: Extract contact pages

Use Scavio's extract endpoint on each candidate site.

Python
def contacts(url):
    r = requests.post('https://api.scavio.dev/api/v1/extract',
        headers={'x-api-key': API_KEY}, json={'url': url})
    return r.json().get('content', '')

Step 5: Score and rank

Claude scores each prospect by recency and fit.

Python
import anthropic
client = anthropic.Anthropic()

def score(prospect):
    msg = client.messages.create(
        model='claude-sonnet-4-6', max_tokens=200,
        messages=[{'role':'user','content':f'Score 1-10 fit: {prospect}'}])
    return msg.content[0].text

Step 6: Email digest

Top 25 prospects with one-line rationale.

Python
# SMTP wiring left to reader; output is markdown digest.

Python Example

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

def daily_engine(city, practice):
    serp = requests.post('https://api.scavio.dev/api/v1/google',
        headers={'x-api-key': API_KEY},
        json={'query': f'{practice} brokerages {city} 2026'}).json()
    rdt = requests.post('https://api.scavio.dev/api/v1/reddit/search',
        headers={'x-api-key': API_KEY},
        json={'query': f'{city} {practice} brokerage'}).json()
    return {'prospects': serp.get('organic_results',[])[:25], 'signal': rdt.get('posts',[])[:10]}

print(daily_engine('austin', 'commercial'))

JavaScript Example

JavaScript
const API_KEY = process.env.SCAVIO_API_KEY;
export async function dailyEngine(city, practice) {
  const [serp, rdt] = await Promise.all([
    fetch('https://api.scavio.dev/api/v1/google', { method:'POST', headers:{'x-api-key':API_KEY,'Content-Type':'application/json'}, body: JSON.stringify({ query: `${practice} brokerages ${city} 2026` }) }).then(r => r.json()),
    fetch('https://api.scavio.dev/api/v1/reddit/search', { method:'POST', headers:{'x-api-key':API_KEY,'Content-Type':'application/json'}, body: JSON.stringify({ query: `${city} ${practice} brokerage` }) }).then(r => r.json())
  ]);
  return { serp, rdt };
}

Expected Output

JSON
Daily morning email with top 25 brokerage prospects per market, scored by Claude on recency and fit. Reddit signal flags hiring threads and brokerage reviews.

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.10+. A Scavio API key. Anthropic API key for Claude Code. 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

Build a B2B real estate lead engine in two days with Claude Code. SERP plus Reddit signal feeds the agent's daily prospect digest.