ScavioScavio
ProductPricingDocs
Sign InGet Started
  1. Home
  2. Tutorials
  3. How to Monitor TikTok Brand Mentions via API
Tutorial

How to Monitor TikTok Brand Mentions via API

Track brand mentions across TikTok videos and comments programmatically. Search videos by keyword, scan comments, and log mentions with timestamps.

Get Free API KeyAPI Docs

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.

Python
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 videos

Step 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.

Python
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 mentions

Step 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.

Python
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 log

Python Example

Python
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

JavaScript
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

JSON
[
  {
    "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"
  }
]

Related Tutorials

  • How to Search TikTok Videos by Keyword via API
  • How to Get TikTok Video Comments via API
  • How to Build a TikTok Influencer Vetting Pipeline

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

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. A Scavio API key gives you 50 free credits on signup.

Yes. The free tier includes 50 credits on signup, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Related Resources

Solution

Monitor Your Brand on TikTok Without Enterprise Pricing

Read more
Best Of

Best Cross-Platform Brand Monitoring APIs in 2026

Read more
Best Of

Best TikTok Analytics APIs for Brand Monitoring in May 2026

Read more
Use Case

Budget TikTok Brand Monitoring via API

Read more
Use Case

Search Surface Brand Monitoring

Read more
Workflow

Daily TikTok UGC Monitoring Workflow

Read more

Start Building

Track brand mentions across TikTok videos and comments programmatically. Search videos by keyword, scan comments, and log mentions with timestamps.

Get Free API KeyRead the Docs
ScavioScavio

Real-time search API for AI agents. Search every platform, not just Google.

Product

  • Features
  • Pricing
  • Dashboard
  • Affiliates

Developers

  • Documentation
  • API Reference
  • Quickstart
  • MCP Integration
  • Python SDK

Alternatives

  • Tavily Alternative
  • SerpAPI Alternative
  • Firecrawl Alternative
  • Exa Alternative

Tools

  • JSON Formatter
  • cURL to Code
  • Token Counter
  • All Tools

© 2026 Scavio. All rights reserved.

Featured on TAAFT
Terms of ServicePrivacy Policy