Brands need to know when TikTok creators mention them in videos or comments. Manual monitoring means scrolling endlessly through search results and comment threads. The Scavio TikTok API lets you search videos by brand keyword, fetch comments for each matching video, and flag any that reference your brand name or product. This tutorial builds a pipeline that runs on a schedule, scans new TikTok content for brand mentions, and logs each mention with the creator handle, video ID, and engagement stats. At $0.005 per API call, monitoring 50 videos plus their comments costs under $1 per run.
Prerequisites
- Python 3.8+ or Node.js 18+
- A Scavio API key from scavio.dev
- requests library installed (Python)
- The brand name or product name you want to track
Walkthrough
Step 1: Search TikTok videos mentioning your brand
Use the search/videos endpoint to find TikTok videos that mention your brand name in the description or hashtags.
import requests, os
API_KEY = os.environ['SCAVIO_API_KEY']
HEADERS = {'Authorization': f'Bearer {API_KEY}', 'Content-Type': 'application/json'}
def search_brand_videos(brand, pages=3):
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 videosStep 2: Scan comments on each video for brand mentions
For each video returned, fetch comments and check if any mention your brand name. This catches indirect mentions where the video itself may not reference the brand but commenters do.
def scan_comments_for_brand(video_id, brand, max_pages=2):
mentions = []
cursor = 0
for _ in range(max_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']
for c in data.get('comments', []):
if brand.lower() in c['text'].lower():
mentions.append({'user': c['user']['unique_id'],
'text': c['text'], 'likes': c['digg_count']})
if not data.get('has_more'):
break
cursor = data.get('cursor', cursor + 20)
return mentionsStep 3: Aggregate and log all mentions
Combine video-level and comment-level mentions into a single log with timestamps. Write to a JSON file for downstream alerting or dashboarding.
import json
from datetime import datetime
def run_monitor(brand):
videos = search_brand_videos(brand)
log = []
for v in videos:
entry = {'type': 'video', 'creator': v.get('author', {}).get('unique_id', ''),
'video_id': v['aweme_id'], 'desc': v['desc'][:100],
'plays': v['stats']['playCount'], 'scanned_at': datetime.now().isoformat()}
log.append(entry)
comment_mentions = scan_comments_for_brand(v['aweme_id'], brand)
for cm in comment_mentions:
log.append({'type': 'comment', 'video_id': v['aweme_id'],
'user': cm['user'], 'text': cm['text'][:100],
'scanned_at': datetime.now().isoformat()})
with open(f'brand_mentions_{brand}_{datetime.now().strftime("%Y-%m-%d")}.json', 'w') as f:
json.dump(log, f, indent=2)
print(f'Logged {len(log)} mentions for {brand}')
return logPython Example
import requests, os, json
from datetime import datetime
API_KEY = os.environ['SCAVIO_API_KEY']
HEADERS = {'Authorization': f'Bearer {API_KEY}', 'Content-Type': 'application/json'}
def search_videos(brand, pages=3):
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}).json()['data']
videos.extend(resp.get('videos', []))
if not resp.get('has_more'): break
cursor = resp['cursor']
return videos
def scan_comments(video_id, brand):
mentions, cursor = [], 0
for _ in range(2):
resp = requests.post('https://api.scavio.dev/api/v1/tiktok/video/comments',
headers=HEADERS, json={'aweme_id': video_id, 'count': 20, 'cursor': cursor}).json()['data']
for c in resp.get('comments', []):
if brand.lower() in c['text'].lower():
mentions.append({'user': c['user']['unique_id'], 'text': c['text'][:100]})
if not resp.get('has_more'): break
cursor = resp.get('cursor', cursor + 20)
return mentions
def monitor(brand):
videos = search_videos(brand)
log = []
for v in videos:
log.append({'type': 'video', 'creator': v.get('author', {}).get('unique_id', ''),
'video_id': v['aweme_id'], 'plays': v['stats']['playCount']})
for cm in scan_comments(v['aweme_id'], brand):
log.append({'type': 'comment', 'video_id': v['aweme_id'], **cm})
with open(f'mentions_{brand}_{datetime.now():%Y-%m-%d}.json', 'w') as f:
json.dump(log, f, indent=2)
print(f'{len(log)} mentions found')
monitor('scavio')JavaScript Example
const API_KEY = process.env.SCAVIO_API_KEY;
const H = { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json' };
const fs = require('fs');
async function searchVideos(brand, pages = 3) {
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 scanComments(videoId, brand) {
const mentions = [];
let cursor = 0;
for (let i = 0; i < 2; i++) {
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 })
}).then(r => r.json());
for (const c of r.data.comments || []) {
if (c.text.toLowerCase().includes(brand.toLowerCase()))
mentions.push({ user: c.user.unique_id, text: c.text.slice(0, 100) });
}
if (!r.data.has_more) break;
cursor = r.data.cursor || cursor + 20;
}
return mentions;
}
async function monitor(brand) {
const videos = await searchVideos(brand);
const log = [];
for (const v of videos) {
log.push({ type: 'video', creator: v.author?.unique_id, videoId: v.aweme_id, plays: v.stats.playCount });
const cms = await scanComments(v.aweme_id, brand);
cms.forEach(cm => log.push({ type: 'comment', videoId: v.aweme_id, ...cm }));
}
fs.writeFileSync(`mentions_${brand}_${new Date().toISOString().slice(0, 10)}.json`, JSON.stringify(log, null, 2));
console.log(`${log.length} mentions found`);
}
monitor('scavio').catch(console.error);Expected Output
[
{
"type": "video",
"creator": "techreviewer42",
"video_id": "7345678901234",
"plays": 24500,
"scanned_at": "2026-05-17T14:30:00"
},
{
"type": "comment",
"video_id": "7345678901234",
"user": "devfan99",
"text": "just tried scavio api and it worked great for my project",
"scanned_at": "2026-05-17T14:30:01"
}
]