AI search visibility tools cost $29-499/mo. A DIY layer pulled with Scavio adds the metrics they miss (Reddit thread mentions, AI Overview citation lists, raw delta tracking). This tutorial walks the build.
Prerequisites
- Python 3.10+
- Scavio API key
- DuckDB
Walkthrough
Step 1: Define brand keyword grid
Brand + category + competitor terms.
GRID = ['scavio', 'best mcp search', 'tavily alternative 2026', 'multi platform search api']Step 2: Daily snapshot per keyword
SERP, AI Overview citations, Reddit threads.
import requests, os, duckdb, datetime
API_KEY = os.environ['SCAVIO_API_KEY']
H = {'x-api-key': API_KEY}
db = duckdb.connect('aeo.duckdb')
db.execute('CREATE TABLE IF NOT EXISTS citations(keyword TEXT, surface TEXT, url TEXT, date DATE)')
def snapshot():
today = datetime.date.today()
for k in GRID:
r = requests.post('https://api.scavio.dev/api/v1/search', headers=H, json={'query': k, 'include_ai_overview': True}).json()
for o in r.get('organic_results', [])[:10]:
db.execute('INSERT INTO citations VALUES (?,?,?,?)', (k, 'serp', o['link'], today))
for c in (r.get('ai_overview') or {}).get('citations', []):
db.execute('INSERT INTO citations VALUES (?,?,?,?)', (k, 'ai_overview', c, today))
rdt = requests.post('https://api.scavio.dev/api/v1/reddit/search', headers=H, json={'query': k}).json()
for p in rdt.get('posts', [])[:10]:
db.execute('INSERT INTO citations VALUES (?,?,?,?)', (k, 'reddit', p.get('url',''), today))Step 3: Friday delta query
What's new since last Friday?
delta = db.execute('''
SELECT keyword, surface, url FROM citations
WHERE date >= current_date - INTERVAL 7 days
AND url NOT IN (SELECT url FROM citations WHERE date < current_date - INTERVAL 7 days)
''').fetchall()Step 4: Email digest
Friday 8 AM, 5-line summary.
# Compose email with delta + counts per surface.Python Example
# Daily run cost: 10 keywords × 2 calls = 20 credits ≈ $0.086. Monthly: ~$2.50.JavaScript Example
// Same in TS with duckdb-async.Expected Output
Daily citation log per surface. Friday email with deltas. Annual cost: ~$30 of Scavio plus self-hosted DuckDB.