Overview
This pipeline monitors brand mentions across Google, Reddit, TikTok, and YouTube, sending alerts when new mentions are detected or when sentiment shifts. It queries each platform for the brand name and key product terms, deduplicates against previously seen results, and flags new mentions for review. Alerts include context about whether the mention is positive, negative, or a competitor comparison.
Trigger
Cron schedule (every 4 hours)
Schedule
Runs every 4 hours
Workflow Steps
Query brand terms across platforms
Search Scavio Google, Reddit, YouTube, and TikTok for brand name and key product terms.
Deduplicate against known mentions
Compare results against the stored list of previously seen URLs and post IDs.
Classify mention sentiment
Score each new mention as positive, negative, or neutral based on context keywords.
Send alerts for new mentions
Push new mentions to Slack or email with platform, sentiment, and direct link.
Python Implementation
import requests
import json
from datetime import datetime
from pathlib import Path
API_KEY = "your_scavio_api_key"
def search_platform(brand: str, platform: str) -> list[dict]:
if platform == "tiktok":
res = requests.post(
"https://api.scavio.dev/api/v1/tiktok/search/videos",
headers={"Authorization": f"Bearer {API_KEY}"},
json={"query": brand},
timeout=15,
)
if res.ok:
return [{"title": v.get("description", "")[:100], "link": v.get("id", ""), "platform": "tiktok"} for v in res.json().get("videos", [])[:5]]
return []
res = requests.post(
"https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY},
json={"platform": platform, "query": brand},
timeout=15,
)
res.raise_for_status()
return [{"title": r.get("title", ""), "link": r.get("link", ""), "platform": platform} for r in res.json().get("organic", [])[:5]]
def run():
brand = "Scavio"
platforms = ["google", "reddit", "youtube", "tiktok"]
seen_path = Path("seen_mentions.json")
seen = set(json.loads(seen_path.read_text())) if seen_path.exists() else set()
all_mentions = []
for p in platforms:
mentions = search_platform(brand, p)
all_mentions.extend(mentions)
new_mentions = [m for m in all_mentions if m["link"] not in seen]
for m in new_mentions:
seen.add(m["link"])
seen_path.write_text(json.dumps(list(seen)))
print(f"Brand monitoring: {len(all_mentions)} total, {len(new_mentions)} new")
for m in new_mentions:
print(f" [{m['platform']}] {m['title'][:80]}")
if __name__ == "__main__":
run()JavaScript Implementation
const API_KEY = "your_scavio_api_key";
async function searchPlatform(brand, platform) {
if (platform === "tiktok") {
const res = await fetch("https://api.scavio.dev/api/v1/tiktok/search/videos", {
method: "POST",
headers: { Authorization: `Bearer ${API_KEY}`, "content-type": "application/json" },
body: JSON.stringify({ query: brand }),
});
if (!res.ok) return [];
return ((await res.json()).videos ?? []).slice(0, 5).map((v) => ({ title: (v.description ?? "").slice(0, 100), link: v.id ?? "", platform }));
}
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, query: brand }),
});
const data = await res.json();
return (data.organic ?? []).slice(0, 5).map((r) => ({ title: r.title ?? "", link: r.link ?? "", platform }));
}
const mentions = [];
for (const p of ["google", "reddit", "youtube", "tiktok"]) mentions.push(...await searchPlatform("Scavio", p));
console.log(`Found ${mentions.length} mentions across 4 platforms`);
mentions.forEach((m) => console.log(` [${m.platform}] ${m.title.slice(0, 80)}`));Platforms Used
Web search with knowledge graph, PAA, and AI overviews
Community, posts & threaded comments from any subreddit
YouTube
Video search with transcripts and metadata
TikTok
Trending video, creator, and product discovery