Overview
Generates weekly client reports by pulling current SERP data, YouTube visibility, Reddit mentions, and Amazon product rankings from a single API. Formats results into a structured report and delivers via email or Slack.
Trigger
Weekly Monday at 6 AM UTC via cron
Schedule
Weekly Monday at 6 AM UTC
Workflow Steps
Load client configurations
Read client list with their target keywords, domains, YouTube channels, and product names from a database or config file.
Pull Google rankings
Query target keywords on Google and extract organic positions for the client's domain.
Check YouTube visibility
Search YouTube for the client's brand and product keywords. Note ranking positions and competitor videos.
Scan Reddit mentions
Search Reddit for brand mentions and product discussions. Flag positive and negative sentiment.
Check Amazon product rankings
For e-commerce clients, search Amazon for product keywords and note ranking positions vs competitors.
Generate and deliver report
Compile all data into a formatted report (PDF, Slack message, or email) with week-over-week comparisons.
Python Implementation
import requests, os, json
from datetime import date
H = {"x-api-key": os.environ["SCAVIO_API_KEY"]}
def generate_report(client):
report = {"client": client["name"], "date": str(date.today()), "platforms": {}}
for platform, keywords in client["keywords"].items():
results = []
for kw in keywords:
r = requests.post("https://api.scavio.dev/api/v1/search", headers=H,
json={"platform": platform, "query": kw}, timeout=10).json()
organic = r.get("organic", [])
pos = next((i+1 for i, o in enumerate(organic)
if client["domain"] in o.get("link", "")), None) if platform != "reddit" else None
results.append({"keyword": kw, "position": pos, "total": len(organic)})
report["platforms"][platform] = results
return report
client = {
"name": "Acme Corp",
"domain": "acme.com",
"keywords": {
"google": ["acme software", "acme reviews"],
"youtube": ["acme tutorial"],
"reddit": ["acme software review"],
}
}
print(json.dumps(generate_report(client), indent=2))JavaScript Implementation
const H = {"x-api-key": process.env.SCAVIO_API_KEY, "Content-Type": "application/json"};
async function generateReport(client) {
const report = {client: client.name, date: new Date().toISOString().slice(0, 10), platforms: {}};
for (const [platform, keywords] of Object.entries(client.keywords)) {
report.platforms[platform] = [];
for (const kw of keywords) {
const r = await fetch("https://api.scavio.dev/api/v1/search", {
method: "POST", headers: H,
body: JSON.stringify({platform, query: kw})
}).then(r => r.json());
const pos = (r.organic || []).findIndex(o =>
o.link?.includes(client.domain)) + 1;
report.platforms[platform].push({keyword: kw, position: pos || null});
}
}
return report;
}Platforms Used
Web search with knowledge graph, PAA, and AI overviews
YouTube
Video search with transcripts and metadata
Community, posts & threaded comments from any subreddit
Amazon
Product search with prices, ratings, and reviews