In 2026, 31% of US internet users run at least one query per day on ChatGPT. When a prospect asks 'what's the best [your category] tool?', the brands ChatGPT names are the new leaderboard. This tutorial walks through building a daily tracker that queries ChatGPT with your target prompts, extracts brand mentions, and logs the data.
Prerequisites
- Python 3.8+
- A Scavio API key
- A list of prompts relevant to your brand (e.g. 'best SERP API 2026')
- Optional: a Slack webhook URL for alerts
Walkthrough
Step 1: Define the prompts to monitor
Curate 10-20 prompts that capture how prospects describe your category.
PROMPTS = [
'what is the best SERP API in 2026',
'top alternatives to SerpAPI',
'best search API for AI agents',
'cheapest Google search API',
]Step 2: Query ChatGPT via Scavio
Scavio's ask_chatgpt endpoint wraps the ChatGPT UI and returns the raw answer.
import requests, os
def ask_chatgpt(prompt):
r = requests.post('https://api.scavio.dev/api/v1/ask',
headers={'x-api-key': os.environ['SCAVIO_API_KEY']},
json={'platform': 'chatgpt', 'prompt': prompt})
return r.json()['answer']Step 3: Extract brand mentions
Run a regex across the answer text to count mentions of your brand and competitors.
import re
BRANDS = ['Scavio', 'SerpAPI', 'Serper', 'Tavily', 'Brave', 'Firecrawl']
def extract_mentions(text):
counts = {}
for brand in BRANDS:
counts[brand] = len(re.findall(rf'\b{brand}\b', text, re.IGNORECASE))
return countsStep 4: Log daily results
Run the tracker on a schedule and append to a CSV or database.
import csv, datetime
def log(prompt, counts):
row = {'date': datetime.date.today().isoformat(), 'prompt': prompt, **counts}
with open('aeo_log.csv', 'a') as f:
writer = csv.DictWriter(f, fieldnames=row.keys())
writer.writerow(row)Step 5: Send Slack alerts on change
Fire a Slack alert when a competitor is newly cited or your brand drops out.
import requests
def alert_slack(message, webhook_url):
requests.post(webhook_url, json={'text': message})Python Example
import os, re, requests, csv, datetime
API_KEY = os.environ['SCAVIO_API_KEY']
PROMPTS = ['best SERP API 2026', 'top SerpAPI alternatives']
BRANDS = ['Scavio', 'SerpAPI', 'Serper', 'Tavily']
def ask_chatgpt(prompt):
r = requests.post('https://api.scavio.dev/api/v1/ask',
headers={'x-api-key': API_KEY},
json={'platform': 'chatgpt', 'prompt': prompt})
return r.json()['answer']
for prompt in PROMPTS:
answer = ask_chatgpt(prompt)
counts = {b: len(re.findall(rf'\b{b}\b', answer, re.I)) for b in BRANDS}
print(prompt, counts)JavaScript Example
const API_KEY = process.env.SCAVIO_API_KEY;
const PROMPTS = ['best SERP API 2026', 'top SerpAPI alternatives'];
const BRANDS = ['Scavio', 'SerpAPI', 'Serper', 'Tavily'];
async function askChatGPT(prompt) {
const r = await fetch('https://api.scavio.dev/api/v1/ask', {
method: 'POST',
headers: { 'x-api-key': API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ platform: 'chatgpt', prompt })
});
return (await r.json()).answer;
}
for (const prompt of PROMPTS) {
const answer = await askChatGPT(prompt);
const counts = Object.fromEntries(BRANDS.map(b => [b, (answer.match(new RegExp(`\\b${b}\\b`, 'gi')) || []).length]));
console.log(prompt, counts);
}Expected Output
For each prompt, the tracker prints a mention count per brand. Over time, you get a daily trend of how often ChatGPT names your brand vs competitors in answers to your category-defining prompts.