Founders ask the same Reddit question every week: 'how do I track whether my SaaS shows up in AI search results?' This tutorial wires Scavio plus a weekly prompt-study script into a self-hosted AEO monitor that costs $30/mo total.
Prerequisites
- Python 3.10+
- Scavio API key
- Anthropic API key for Claude prompt studies
- DuckDB
Walkthrough
Step 1: Define brand keyword set
10 to 30 brand and category queries in YAML.
# keywords.yaml
brand: scavio
keywords:
- scavio review
- best ai search api 2026
- tavily alternativeStep 2: Daily SERP plus AI Overviews
One Scavio call per keyword.
import requests, os
API_KEY = os.environ['SCAVIO_API_KEY']
def snap(q):
r = requests.post('https://api.scavio.dev/api/v1/google',
headers={'x-api-key': API_KEY},
json={'query': q, 'include_ai_overview': True})
return r.json()Step 3: Reddit brand mentions
Daily Reddit scan for the brand keyword.
def reddit(brand):
r = requests.post('https://api.scavio.dev/api/v1/reddit/search',
headers={'x-api-key': API_KEY},
json={'query': brand})
return r.json().get('posts', [])Step 4: Weekly ChatGPT prompt study
Run the same prompt set against ChatGPT.
import openai
client = openai.OpenAI()
def chatgpt_says(prompt):
r = client.chat.completions.create(model='gpt-5', messages=[{'role':'user','content':prompt}])
return r.choices[0].message.contentStep 5: Store deltas
DuckDB row per (keyword, surface, url, date).
import duckdb
db = duckdb.connect('aeo.duckdb')
db.execute('CREATE TABLE IF NOT EXISTS aeo(brand TEXT, surface TEXT, url TEXT, date DATE)')Python Example
import os, requests, datetime
API_KEY = os.environ['SCAVIO_API_KEY']
def snapshot(brand, keyword):
serp = requests.post('https://api.scavio.dev/api/v1/google',
headers={'x-api-key': API_KEY},
json={'query': keyword, 'include_ai_overview': True}).json()
rdt = requests.post('https://api.scavio.dev/api/v1/reddit/search',
headers={'x-api-key': API_KEY},
json={'query': brand}).json()
return {'date': str(datetime.date.today()), 'ao': serp.get('ai_overview'), 'reddit': rdt.get('posts',[])[:5]}
print(snapshot('scavio', 'best ai search api 2026'))JavaScript Example
const API_KEY = process.env.SCAVIO_API_KEY;
export async function snapshot(brand, keyword) {
const headers = { 'x-api-key': API_KEY, 'Content-Type': 'application/json' };
const [serp, rdt] = await Promise.all([
fetch('https://api.scavio.dev/api/v1/google', { method:'POST', headers, body: JSON.stringify({ query: keyword, include_ai_overview: true }) }).then(r => r.json()),
fetch('https://api.scavio.dev/api/v1/reddit/search', { method:'POST', headers, body: JSON.stringify({ query: brand }) }).then(r => r.json())
]);
return { serp, rdt };
}Expected Output
Daily snapshot per keyword across SERP, AI Overviews, and Reddit. Weekly ChatGPT prompt study runs against the same set. DuckDB stores deltas; weekly digest emails new and lost citations.