A budget TikTok brand monitoring system tracks mentions of your brand, analyzes comment sentiment, and watches competitor activity without expensive social listening subscriptions. Using the Scavio TikTok API at $0.005/credit, you can search videos mentioning your brand, pull comments for sentiment analysis, and monitor competitor hashtags -- all within a $30/month plan. This tutorial builds a complete monitoring pipeline that runs on a daily cron and outputs a summary report.
Prerequisites
- Python 3.10+ installed
- requests library installed
- A Scavio API key from scavio.dev
- Basic familiarity with TikTok content terminology (hashtags, aweme_id)
Walkthrough
Step 1: Search TikTok for brand mentions
Use the TikTok search/videos endpoint to find recent videos mentioning your brand name. This captures both direct mentions in descriptions and related content.
import requests, os
from datetime import datetime
API_KEY = os.environ['SCAVIO_API_KEY']
HEADERS = {'Authorization': f'Bearer {API_KEY}', 'Content-Type': 'application/json'}
def search_brand_mentions(brand: str, pages: int = 3) -> list:
videos = []
cursor = 0
for _ in range(pages):
resp = requests.post('https://api.scavio.dev/api/v1/tiktok/search/videos',
headers=HEADERS,
json={'keyword': brand, 'count': 20, 'cursor': cursor})
data = resp.json()['data']
videos.extend(data.get('videos', []))
if not data.get('has_more'):
break
cursor = data['cursor']
return videos
mentions = search_brand_mentions('yourBrandName')
print(f'Found {len(mentions)} videos mentioning brand')Step 2: Extract comment sentiment per mention
For each video mentioning your brand, pull comments and classify sentiment using simple keyword matching. For production use, swap in an LLM classifier.
POSITIVE_WORDS = {'love', 'amazing', 'great', 'best', 'perfect', 'awesome', 'recommend'}
NEGATIVE_WORDS = {'hate', 'worst', 'terrible', 'scam', 'broken', 'awful', 'waste'}
def get_comments(video_id: str, pages: int = 2) -> list:
comments = []
cursor = 0
for _ in range(pages):
resp = requests.post('https://api.scavio.dev/api/v1/tiktok/video/comments',
headers=HEADERS,
json={'aweme_id': video_id, 'count': 20, 'cursor': cursor})
data = resp.json()['data']
comments.extend(data.get('comments', []))
if not data.get('has_more'):
break
cursor = data.get('cursor', cursor + 20)
return comments
def classify_sentiment(comments: list) -> dict:
counts = {'positive': 0, 'negative': 0, 'neutral': 0}
for c in comments:
words = set(c['text'].lower().split())
if words & POSITIVE_WORDS:
counts['positive'] += 1
elif words & NEGATIVE_WORDS:
counts['negative'] += 1
else:
counts['neutral'] += 1
return countsStep 3: Monitor competitor hashtags
Track competitor brand hashtags to benchmark their TikTok presence against yours. Compare view counts and video volume over time.
def monitor_hashtag(hashtag: str) -> dict:
resp = requests.post('https://api.scavio.dev/api/v1/tiktok/hashtag',
headers=HEADERS, json={'hashtag': hashtag})
data = resp.json()['data']
return {
'hashtag': hashtag,
'views': data['stats']['view_count'],
'videos': data['stats']['video_count']
}
competitors = ['competitorA', 'competitorB', 'yourBrand']
for tag in competitors:
stats = monitor_hashtag(tag)
print(f'#{stats["hashtag"]}: {stats["views"]:,} views, {stats["videos"]:,} videos')Step 4: Generate a daily summary report
Combine brand mentions, sentiment, and competitor data into a daily JSON report. Schedule this with cron for automated monitoring.
import json
from datetime import date
def daily_report(brand: str, competitors: list) -> dict:
mentions = search_brand_mentions(brand, pages=2)
total_sentiment = {'positive': 0, 'negative': 0, 'neutral': 0}
for v in mentions[:10]: # Sample top 10 for budget
comments = get_comments(v['aweme_id'], pages=1)
sentiment = classify_sentiment(comments)
for k in total_sentiment:
total_sentiment[k] += sentiment[k]
comp_stats = [monitor_hashtag(c) for c in competitors]
report = {
'date': date.today().isoformat(),
'brand': brand,
'mentions_found': len(mentions),
'sentiment': total_sentiment,
'competitors': comp_stats
}
with open(f'brand_report_{date.today()}.json', 'w') as f:
json.dump(report, f, indent=2)
return report
report = daily_report('yourBrand', ['competitorA', 'competitorB'])
print(json.dumps(report, indent=2))Python Example
import requests, os, json
from datetime import date
API_KEY = os.environ['SCAVIO_API_KEY']
HEADERS = {'Authorization': f'Bearer {API_KEY}', 'Content-Type': 'application/json'}
def search_mentions(brand, pages=2):
videos, cursor = [], 0
for _ in range(pages):
data = requests.post('https://api.scavio.dev/api/v1/tiktok/search/videos',
headers=HEADERS, json={'keyword': brand, 'count': 20, 'cursor': cursor}).json()['data']
videos.extend(data.get('videos', []))
if not data.get('has_more'): break
cursor = data['cursor']
return videos
def get_comments(vid_id, pages=1):
comments, cursor = [], 0
for _ in range(pages):
data = requests.post('https://api.scavio.dev/api/v1/tiktok/video/comments',
headers=HEADERS, json={'aweme_id': vid_id, 'count': 20, 'cursor': cursor}).json()['data']
comments.extend(data.get('comments', []))
if not data.get('has_more'): break
cursor = data.get('cursor', cursor + 20)
return comments
def hashtag_stats(tag):
data = requests.post('https://api.scavio.dev/api/v1/tiktok/hashtag',
headers=HEADERS, json={'hashtag': tag}).json()['data']
return {'hashtag': tag, 'views': data['stats']['view_count'], 'videos': data['stats']['video_count']}
mentions = search_mentions('yourBrand')
print(f'{len(mentions)} mentions found')
for v in mentions[:5]:
comments = get_comments(v['aweme_id'])
print(f" {v['desc'][:40]} -> {len(comments)} comments")
for c in ['competitorA', 'competitorB']:
s = hashtag_stats(c)
print(f"#{s['hashtag']}: {s['views']:,} views")JavaScript Example
const API_KEY = process.env.SCAVIO_API_KEY;
const H = { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' };
async function searchMentions(brand, pages = 2) {
const videos = [];
let cursor = 0;
for (let i = 0; i < pages; i++) {
const r = await fetch('https://api.scavio.dev/api/v1/tiktok/search/videos', {
method: 'POST', headers: H,
body: JSON.stringify({ keyword: brand, count: 20, cursor })
}).then(r => r.json());
videos.push(...(r.data.videos || []));
if (!r.data.has_more) break;
cursor = r.data.cursor;
}
return videos;
}
async function getComments(videoId) {
const r = await fetch('https://api.scavio.dev/api/v1/tiktok/video/comments', {
method: 'POST', headers: H,
body: JSON.stringify({ aweme_id: videoId, count: 20, cursor: 0 })
}).then(r => r.json());
return r.data.comments || [];
}
async function hashtagStats(tag) {
const r = await fetch('https://api.scavio.dev/api/v1/tiktok/hashtag', {
method: 'POST', headers: H,
body: JSON.stringify({ hashtag: tag })
}).then(r => r.json());
return { hashtag: tag, views: r.data.stats.view_count };
}
async function main() {
const mentions = await searchMentions('yourBrand');
console.log(`${mentions.length} brand mentions`);
for (const v of mentions.slice(0, 5)) {
const comments = await getComments(v.aweme_id);
console.log(` ${v.desc.slice(0, 40)} -> ${comments.length} comments`);
}
for (const c of ['competitorA', 'competitorB']) {
const s = await hashtagStats(c);
console.log(`#${s.hashtag}: ${s.views.toLocaleString()} views`);
}
}
main().catch(console.error);Expected Output
{
"date": "2026-05-12",
"brand": "yourBrand",
"mentions_found": 38,
"sentiment": {
"positive": 42,
"negative": 7,
"neutral": 31
},
"competitors": [
{ "hashtag": "competitorA", "views": 2400000, "videos": 1200 },
{ "hashtag": "competitorB", "views": 890000, "videos": 430 }
]
}