Overview
This workflow monitors Google AI Overviews for a set of target queries and detects when the AI-generated summary changes its content, sources, or structure. SEO teams use it to understand how Google's AI answers evolve, which sources get cited, and when their own content appears or disappears from the AI Overview panel.
Trigger
Cron schedule (daily at 8 AM UTC)
Schedule
Runs daily at 8 AM UTC
Workflow Steps
Load monitored queries
Read the list of search queries whose AI Overviews should be tracked.
Fetch AI Overviews
Call the Scavio API with platform google and ai_overview enabled for each query.
Extract AI Overview content
Parse the ai_overview field from the response, including the text and cited sources.
Compare with previous snapshot
Load the previous day's AI Overview snapshot and diff the text and source list.
Record changes
Log all detected changes with timestamps, including text additions, removals, and source changes.
Alert on significant changes
If the text changed substantially or a tracked domain was added or removed from sources, send an alert.
Python Implementation
import requests
import json
import hashlib
from pathlib import Path
from datetime import datetime
API_KEY = "your_scavio_api_key"
def fetch_ai_overview(query: str) -> dict:
res = requests.post(
"https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY},
json={"platform": "google", "query": query, "ai_overview": True},
timeout=15,
)
res.raise_for_status()
data = res.json()
aio = data.get("ai_overview", {})
return {
"text": aio.get("text", ""),
"sources": [s.get("link", "") for s in aio.get("sources", [])],
"hash": hashlib.md5(aio.get("text", "").encode()).hexdigest(),
}
def run():
queries = [
"best project management tool",
"how to improve website speed",
"what is retrieval augmented generation",
]
snapshot_path = Path("aio_snapshots.json")
previous = json.loads(snapshot_path.read_text()) if snapshot_path.exists() else {}
changes = []
current = {}
for q in queries:
result = fetch_ai_overview(q)
current[q] = result
prev = previous.get(q)
if prev and prev["hash"] != result["hash"]:
changes.append({
"query": q,
"old_sources": prev["sources"],
"new_sources": result["sources"],
"timestamp": datetime.utcnow().isoformat(),
})
snapshot_path.write_text(json.dumps(current, indent=2))
if changes:
print(f"AI Overview changes detected: {len(changes)}")
for c in changes:
print(f" Query: {c['query']}")
print(f" Sources changed: {c['old_sources']} -> {c['new_sources']}")
else:
print("No AI Overview changes detected")
if __name__ == "__main__":
run()JavaScript Implementation
const API_KEY = "your_scavio_api_key";
function md5(text) {
const { createHash } = require("crypto");
return createHash("md5").update(text).digest("hex");
}
async function fetchAiOverview(query) {
const res = await fetch("https://api.scavio.dev/api/v1/search", {
method: "POST",
headers: {
"x-api-key": API_KEY,
"content-type": "application/json",
},
body: JSON.stringify({ platform: "google", query, ai_overview: true }),
});
if (!res.ok) throw new Error(`scavio ${res.status}`);
const data = await res.json();
const aio = data.ai_overview ?? {};
const text = aio.text ?? "";
return {
text,
sources: (aio.sources ?? []).map((s) => s.link ?? ""),
hash: md5(text),
};
}
async function run() {
const fs = await import("fs/promises");
const queries = [
"best project management tool",
"how to improve website speed",
"what is retrieval augmented generation",
];
let previous = {};
try {
previous = JSON.parse(await fs.readFile("aio_snapshots.json", "utf8"));
} catch {}
const current = {};
const changes = [];
for (const q of queries) {
const result = await fetchAiOverview(q);
current[q] = result;
const prev = previous[q];
if (prev && prev.hash !== result.hash) {
changes.push({
query: q,
oldSources: prev.sources,
newSources: result.sources,
timestamp: new Date().toISOString(),
});
}
}
await fs.writeFile("aio_snapshots.json", JSON.stringify(current, null, 2));
if (changes.length) {
console.log(`AI Overview changes detected: ${changes.length}`);
for (const c of changes) {
console.log(` Query: ${c.query}`);
console.log(` Sources: ${c.oldSources.join(", ")} -> ${c.newSources.join(", ")}`);
}
} else {
console.log("No AI Overview changes detected");
}
}
run();Platforms Used
Web search with knowledge graph, PAA, and AI overviews