ScavioScavio
FeaturesPricingDocs
Sign InGet Started
  1. Home
  2. Tutorials
  3. How to Build an AEO Dashboard
Tutorial

How to Build an AEO Dashboard

Track your brand's presence in ChatGPT, Perplexity, and Google answers side-by-side. Build an AEO dashboard with Scavio and Metabase in a day.

Get Free API KeyAPI Docs

Answer Engine Optimization (AEO) is the practice of ranking in ChatGPT, Perplexity, and Claude answers, not just Google. This tutorial walks through building an AEO dashboard that runs daily prompts, captures brand mentions, and visualizes trends over time using Scavio for data and Metabase for charts.

Prerequisites

  • Python 3.8+
  • A Scavio API key
  • A Postgres database (Supabase free tier works)
  • Metabase self-hosted or cloud

Walkthrough

Step 1: Set up the database schema

Create a table to log prompt-answer-mention rows.

CREATE TABLE aeo_log (
  id SERIAL PRIMARY KEY,
  run_date DATE,
  engine TEXT,
  prompt TEXT,
  answer TEXT,
  brand_mentions JSONB
);

Step 2: Write the daily tracker script

For each engine and prompt, query Scavio and log the result.

Python
ENGINES = ['chatgpt', 'perplexity']
PROMPTS = ['best SERP API 2026', 'top Claude Code alternatives']

def run_tracker():
    for engine in ENGINES:
        for prompt in PROMPTS:
            resp = requests.post('https://api.scavio.dev/api/v1/ask',
                headers={'x-api-key': API_KEY},
                json={'platform': engine, 'prompt': prompt}).json()
            mentions = count_brands(resp.get('answer', ''))
            save_row(engine, prompt, resp['answer'], mentions)

Step 3: Schedule with cron

Run the tracker daily at 8am UTC.

Bash
0 8 * * * /usr/bin/python3 /path/to/aeo_tracker.py

Step 4: Build Metabase charts

Create a trend chart of brand mentions over time, per engine.

-- In Metabase, use:
SELECT run_date, engine, brand_mentions->>'Scavio' AS scavio_count
FROM aeo_log
ORDER BY run_date;

Step 5: Set up alerts

Configure Metabase to email the team when a competitor's mention count jumps 20%+.

Text
// Metabase UI: Subscriptions > New alert on trend change

Python Example

Python
import os, requests, psycopg2, json

API_KEY = os.environ['SCAVIO_API_KEY']
PG_URL = os.environ['POSTGRES_URL']
BRANDS = ['Scavio', 'SerpAPI', 'Tavily']

def count_brands(text):
    return {b: text.lower().count(b.lower()) for b in BRANDS}

def run():
    conn = psycopg2.connect(PG_URL)
    cur = conn.cursor()
    for engine in ['chatgpt', 'perplexity']:
        for prompt in ['best SERP API 2026']:
            r = requests.post('https://api.scavio.dev/api/v1/ask',
                headers={'x-api-key': API_KEY},
                json={'platform': engine, 'prompt': prompt}).json()
            cur.execute('INSERT INTO aeo_log (run_date, engine, prompt, answer, brand_mentions) VALUES (CURRENT_DATE, %s, %s, %s, %s)',
                (engine, prompt, r.get('answer', ''), json.dumps(count_brands(r.get('answer', '')))))
    conn.commit()

run()

JavaScript Example

JavaScript
import { Client } from 'pg';
const API_KEY = process.env.SCAVIO_API_KEY;
const BRANDS = ['Scavio', 'SerpAPI', 'Tavily'];
const pg = new Client({ connectionString: process.env.POSTGRES_URL });
await pg.connect();
for (const engine of ['chatgpt', 'perplexity']) {
  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: engine, prompt: 'best SERP API 2026' })
  });
  const { answer } = await r.json();
  const mentions = Object.fromEntries(BRANDS.map(b => [b, (answer.toLowerCase().match(new RegExp(b.toLowerCase(), 'g')) || []).length]));
  await pg.query('INSERT INTO aeo_log (run_date, engine, prompt, answer, brand_mentions) VALUES (CURRENT_DATE, $1, $2, $3, $4)', [engine, 'best SERP API 2026', answer, mentions]);
}
await pg.end();

Expected Output

JSON
Daily rows appear in the aeo_log table, one per engine-prompt combination. Metabase charts display a 30-day trend line of brand mentions, and an alert fires when a competitor's count spikes.

Related Tutorials

  • How to Track AI Brand Mentions in ChatGPT
  • How to Monitor Perplexity Citations

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.8+. A Scavio API key. A Postgres database (Supabase free tier works). Metabase self-hosted or cloud. A Scavio API key gives you 250 free credits per month.

Yes. The free tier includes 250 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.

Related Resources

Use Case

Answer Engine Optimization Tracking

Read more
Best Of

Best API for AEO Dashboard Builders in 2026

Read more
Best Of

Best AEO Tracking Tools for SaaS Founders in 2026

Read more
Use Case

GEO/AEO Metric Tracking Dashboard

Read more
Solution

Answer Engine Optimization for Brands

Read more
Solution

Track AEO/GEO Citations Across AI Answer Engines

Read more

Start Building

Track your brand's presence in ChatGPT, Perplexity, and Google answers side-by-side. Build an AEO dashboard with Scavio and Metabase in a day.

Get Free API KeyRead the Docs
ScavioScavio

Real-time search API for AI agents. Search every platform, not just Google.

Product

  • Features
  • Pricing
  • Dashboard
  • Affiliates

Developers

  • Documentation
  • API Reference
  • Quickstart
  • MCP Integration
  • Python SDK

Alternatives

  • Tavily Alternative
  • SerpAPI Alternative
  • Firecrawl Alternative
  • Exa Alternative

Tools

  • JSON Formatter
  • cURL to Code
  • Token Counter
  • All Tools

© 2026 Scavio. All rights reserved.

Featured on TAAFT
Terms of ServicePrivacy Policy