Tutorial

How to Track AI Search Visibility DIY

AI visibility dashboards cost $29-499/mo. The DIY layer in 50 lines of Python costs ~$3/mo of Scavio plus DuckDB.

AI search visibility tools (Otterly, Peec, Profound) cost $29-499/mo. A DIY layer captures the same primary signal at fractional cost. This tutorial builds the DIY tracker.

Prerequisites

  • Python 3.10+
  • Scavio API key
  • DuckDB

Walkthrough

Step 1: Define brand keyword grid

Brand + category + competitor terms.

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

Step 2: Daily snapshot per keyword

SERP + AI Overview citations + Reddit threads.

Python
import os, requests, 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 visibility(date DATE, keyword TEXT, surface TEXT, url TEXT)')

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 visibility VALUES (?, ?, ?, ?)', (today, k, 'serp', o['link']))
        for c in (r.get('ai_overview') or {}).get('citations', []):
            db.execute('INSERT INTO visibility VALUES (?, ?, ?, ?)', (today, k, 'ai_overview', c))

Step 3: Daily Reddit thread tracking

Brand mentions in r/SaaS, r/marketing.

Python
def reddit(k):
    return requests.post('https://api.scavio.dev/api/v1/reddit/search', headers=H, json={'query': k}).json()

Step 4: Weekly delta query

What's new since last week?

Python
delta = db.execute('''
  SELECT keyword, surface, url FROM visibility
  WHERE date >= current_date - INTERVAL 7 days
  AND url NOT IN (SELECT url FROM visibility WHERE date < current_date - INTERVAL 7 days)
''').fetchall()

Step 5: Friday email digest

5-line summary.

Text
# Compose email with new citations + new Reddit threads + lost citations.
# Send Friday 8 AM.

Python Example

Python
# Daily run cost: 30 keywords × 2 calls = 60 credits ≈ $0.26.
# Monthly: ~$8 of Scavio. Vs Otterly $29/mo (similar coverage), DIY saves at row-level depth.

JavaScript Example

JavaScript
// Same in TS with duckdb-async.

Expected Output

JSON
Daily citation log per surface. Friday email with deltas. Annual cost ~$100 vs Otterly's $348 (still worth Otterly for the polished dashboard if you don't want to build).

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

AI visibility dashboards cost $29-499/mo. The DIY layer in 50 lines of Python costs ~$3/mo of Scavio plus DuckDB.