Overview
Track competitor TikTok accounts daily to detect content strategy changes, viral posts, and engagement pattern shifts. Pull latest posts, compare engagement rates to their baseline, and flag videos that outperform their average by 3x or more.
Trigger
Daily cron at 07:00 UTC
Schedule
Daily at 07:00 UTC
Workflow Steps
Load competitor list
Read competitor TikTok usernames from config. Each entry includes their historical average engagement rate for comparison.
Pull latest posts
For each competitor, fetch their 20 most recent posts via the user/posts endpoint.
Detect viral outliers
Flag any post with engagement 3x above the competitor's baseline average.
Extract content patterns
Log video descriptions, hashtags used, posting times, and duration for pattern analysis.
Generate daily digest
Output a summary of new posts, viral outliers, and any shifts in posting frequency or content themes.
Python Implementation
import requests, os
H = {"Authorization": f"Bearer {os.environ['SCAVIO_API_KEY']}", "Content-Type": "application/json"}
BASE = "https://api.scavio.dev"
def monitor_competitor(username, baseline_eng=0.03):
profile = requests.post(f"{BASE}/api/v1/tiktok/profile",
headers=H, json={"username": username}).json()["data"]["user"]
followers = profile["follower_count"]
posts = requests.post(f"{BASE}/api/v1/tiktok/user/posts",
headers=H, json={"sec_user_id": profile["sec_uid"], "count": 20}).json()
viral = []
for p in posts["data"].get("posts", []):
stats = p.get("statistics", {})
eng = (stats.get("digg_count", 0) + stats.get("comment_count", 0)) / max(followers, 1)
if eng > baseline_eng * 3:
viral.append({
"desc": p.get("desc", "")[:80],
"views": stats.get("play_count", 0),
"engagement": round(eng * 100, 2),
})
return {"username": username, "followers": followers, "viral_posts": viral}
report = monitor_competitor("competitor_brand")
print(f"@{report['username']}: {len(report['viral_posts'])} viral posts detected")
for v in report["viral_posts"]:
print(f" {v['views']:,} views, {v['engagement']}% eng: {v['desc']}")JavaScript Implementation
const BASE = "https://api.scavio.dev";
const H = { Authorization: `Bearer ${process.env.SCAVIO_API_KEY}`, "Content-Type": "application/json" };
async function monitorCompetitor(username, baselineEng = 0.03) {
const profile = await fetch(`${BASE}/api/v1/tiktok/profile`, {
method: "POST", headers: H, body: JSON.stringify({ username })
}).then(r => r.json());
const user = profile.data.user;
const posts = await fetch(`${BASE}/api/v1/tiktok/user/posts`, {
method: "POST", headers: H,
body: JSON.stringify({ sec_user_id: user.sec_uid, count: 20 })
}).then(r => r.json());
const viral = (posts.data.posts || []).filter(p => {
const s = p.statistics || {};
return ((s.digg_count || 0) + (s.comment_count || 0)) / user.follower_count > baselineEng * 3;
});
console.log(`@${username}: ${viral.length} viral posts`);
}
monitorCompetitor("competitor_brand");Platforms Used
TikTok
Trending video, creator, and product discovery