Tutorial

How to Build a Daily AI Citation Tracker

Free dashboard alternative for AI citation tracking. DuckDB-backed, runs daily, costs cents. Drop-in pair with Otterly or Peec.

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.

Python
GRID = ['scavio', 'best mcp search', 'tavily alternative 2026', 'multi platform search api']

Step 2: Daily snapshot per keyword

SERP, AI Overview citations, Reddit threads.

Python
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?

Python
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.

Text
# Compose email with delta + counts per surface.

Python Example

Python
# Daily run cost: 10 keywords × 2 calls = 20 credits ≈ $0.086. Monthly: ~$2.50.

JavaScript Example

JavaScript
// Same in TS with duckdb-async.

Expected Output

JSON
Daily citation log per surface. Friday email with deltas. Annual cost: ~$30 of Scavio plus self-hosted DuckDB.

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+. Scavio API key. DuckDB. 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

Free dashboard alternative for AI citation tracking. DuckDB-backed, runs daily, costs cents. Drop-in pair with Otterly or Peec.