TikTok UGC Tracking: Campaign Monitoring via API
Monitor TikTok UGC campaigns for $0.30/month via API instead of $119/month Brand24. Track videos, engagement, and top creators.
Tracking TikTok UGC (user-generated content) for brand campaigns via API costs $0.005 per check versus $119-299/month for dedicated monitoring platforms like Brand24 or Mention. Search TikTok for your campaign hashtag or brand name, track video counts and engagement over time, and flag content that needs attention -- all from a cron job running a 30-line script.
What UGC tracking means for campaigns
When you launch a TikTok campaign with a branded hashtag, you need to know: how many creators posted, total views and engagement, sentiment of the content, whether any posts violate brand guidelines, and which creators drove the most impressions. Monitoring platforms charge monthly subscriptions for this. An API gives you the raw data to build your own dashboard.
Campaign monitoring script
import os, requests, json
from datetime import datetime
from collections import defaultdict
TOKEN = os.environ["SCAVIO_API_KEY"]
AUTH = {"Authorization": f"Bearer {TOKEN}"}
BASE = "https://api.scavio.dev/api/v1/tiktok"
def monitor_campaign(hashtag: str, brand_name: str) -> dict:
"""Monitor a TikTok campaign. Cost: 2 credits."""
report = {
"hashtag": hashtag,
"brand": brand_name,
"checked_at": datetime.utcnow().isoformat(),
"videos": [],
"totals": {"views": 0, "likes": 0, "shares": 0, "comments": 0},
}
# Search for hashtag content
resp = requests.post(f"{BASE}/search", headers=AUTH,
json={"query": hashtag, "count": 30})
videos = resp.json().get("videos", [])
# Also search for brand name mentions
brand_resp = requests.post(f"{BASE}/search", headers=AUTH,
json={"query": brand_name, "count": 20})
brand_videos = brand_resp.json().get("videos", [])
# Deduplicate by video ID
seen_ids = set()
all_videos = videos + brand_videos
for v in all_videos:
vid = v.get("id", "")
if vid in seen_ids:
continue
seen_ids.add(vid)
stats = v.get("stats", {})
report["videos"].append({
"id": vid,
"desc": v.get("desc", "")[:100],
"author": v.get("author", {}).get("uniqueId", ""),
"plays": stats.get("playCount", 0),
"likes": stats.get("diggCount", 0),
"shares": stats.get("shareCount", 0),
"comments": stats.get("commentCount", 0),
"created": v.get("createTime", 0),
})
report["totals"]["views"] += stats.get("playCount", 0)
report["totals"]["likes"] += stats.get("diggCount", 0)
report["totals"]["shares"] += stats.get("shareCount", 0)
report["totals"]["comments"] += stats.get("commentCount", 0)
report["unique_creators"] = len(set(
v["author"] for v in report["videos"]
))
report["video_count"] = len(report["videos"])
return report
campaign = monitor_campaign("#YourBrandChallenge", "Your Brand")
print(f"Videos: {campaign['video_count']}")
print(f"Creators: {campaign['unique_creators']}")
print(f"Total views: {campaign['totals']['views']:,}")Daily tracking with trend analysis
import csv
from pathlib import Path
def daily_track(hashtag: str, brand: str, log_file: str = "campaign_log.csv"):
"""Run daily, append metrics to CSV for trend analysis."""
report = monitor_campaign(hashtag, brand)
file_exists = Path(log_file).exists()
with open(log_file, "a", newline="") as f:
writer = csv.DictWriter(f, fieldnames=[
"date", "video_count", "unique_creators",
"total_views", "total_likes", "total_shares"
])
if not file_exists:
writer.writeheader()
writer.writerow({
"date": report["checked_at"][:10],
"video_count": report["video_count"],
"unique_creators": report["unique_creators"],
"total_views": report["totals"]["views"],
"total_likes": report["totals"]["likes"],
"total_shares": report["totals"]["shares"],
})
return report
# Cron: 0 9 * * * python track_campaign.py
daily_track("#YourBrandChallenge", "Your Brand")Top creator identification
def top_creators(report: dict, top_n: int = 10) -> list:
"""Rank creators by total engagement from campaign videos."""
creator_stats = defaultdict(lambda: {"videos": 0, "plays": 0, "likes": 0})
for v in report["videos"]:
author = v["author"]
creator_stats[author]["videos"] += 1
creator_stats[author]["plays"] += v["plays"]
creator_stats[author]["likes"] += v["likes"]
ranked = sorted(creator_stats.items(),
key=lambda x: x[1]["plays"], reverse=True)[:top_n]
return [{"username": k, **v} for k, v in ranked]
top = top_creators(campaign)
for c in top[:5]:
print(f"@{c['username']}: {c['videos']} videos, "
f"{c['plays']:,} plays, {c['likes']:,} likes")Cost comparison
- Brand24 Professional: $119/mo (TikTok + other platforms)
- Mention: $41-149/mo depending on mentions volume
- Sprout Social: $249/mo (full social suite)
- API approach: 2 credits/day = $0.30/month for daily monitoring
- Weekly deep dive (30 credits): $0.60/month extra
Alerting on content issues
Add a sentiment check to flag potentially problematic UGC. Search video descriptions for negative keywords, check for unusually low engagement (possible shadow-banned content), and flag videos from creators with controversial histories. One additional search credit per flagged creator for web reputation check.
Key takeaway
TikTok UGC campaign monitoring does not need a $119/month platform. Two API calls per day (hashtag search + brand search) give you video counts, engagement metrics, creator identification, and trend data. Store it in a CSV, build a simple dashboard, and you have the same insights at 1/400th the cost.