Tutorial

How to Build Cross-Platform Brand Monitor

Monitor brand mentions across Google, Reddit, TikTok, and YouTube from one API. Daily digest with sentiment and reach metrics.

Brand mentions happen across Google, Reddit, TikTok, and YouTube simultaneously. Monitoring each platform separately is expensive and fragmented. This pipeline queries all four platforms from one API, deduplicates mentions, scores sentiment, and generates a unified daily digest. Total cost: $0.020 per brand per day.

Prerequisites

  • Python 3.8+
  • requests library
  • A Scavio API key from scavio.dev
  • Brand name and competitor names

Walkthrough

Step 1: Query all platforms for brand mentions

Search Google, Reddit, TikTok, and YouTube for your brand in one sweep.

Python
import os, requests, json
from datetime import datetime
from collections import Counter

API_KEY = os.environ['SCAVIO_API_KEY']
SH = {'x-api-key': API_KEY, 'Content-Type': 'application/json'}
TH = {'Authorization': f'Bearer {API_KEY}', 'Content-Type': 'application/json'}

BRAND = 'Scavio'

def search_platform(query, platform=None):
    body = {'query': query, 'country_code': 'us'}
    if platform:
        body['platform'] = platform
    data = requests.post('https://api.scavio.dev/api/v1/search',
        headers=SH, json=body).json()
    return [{'title': r.get('title', ''), 'link': r.get('link', ''),
             'snippet': r.get('snippet', ''), 'platform': platform or 'google'}
            for r in data.get('organic_results', [])]

def search_tiktok(query):
    data = requests.post('https://api.scavio.dev/api/v1/tiktok/search/videos',
        headers=TH, json={'query': query}).json()
    videos = data.get('videos', data.get('data', {}).get('videos', []))
    return [{'title': v.get('desc', '')[:80], 'link': f'tiktok.com/@{v.get("author", {}).get("uniqueId", "")}',
             'snippet': v.get('desc', ''), 'platform': 'tiktok',
             'plays': v.get('stats', {}).get('playCount', 0)} for v in videos]

all_mentions = []
for platform in [None, 'reddit', 'youtube']:
    mentions = search_platform(BRAND, platform)
    all_mentions.extend(mentions)
    print(f'{platform or "google":10}: {len(mentions)} mentions')
tiktok_mentions = search_tiktok(BRAND)
all_mentions.extend(tiktok_mentions)
print(f'{"tiktok":10}: {len(tiktok_mentions)} mentions')
print(f'\nTotal: {len(all_mentions)} mentions. Cost: $0.020')

Step 2: Score sentiment and reach per platform

Classify mention sentiment and estimate reach across platforms.

Python
POSITIVE = ['best', 'great', 'love', 'recommend', 'amazing', 'excellent', 'perfect']
NEGATIVE = ['worst', 'terrible', 'avoid', 'hate', 'broken', 'expensive', 'scam']

def score_mention(mention):
    text = f'{mention["title"]} {mention["snippet"]}'.lower()
    pos = sum(1 for w in POSITIVE if w in text)
    neg = sum(1 for w in NEGATIVE if w in text)
    if pos > neg: return 'positive'
    if neg > pos: return 'negative'
    return 'neutral'

def platform_report(mentions):
    by_platform = {}
    for m in mentions:
        p = m['platform']
        if p not in by_platform:
            by_platform[p] = []
        by_platform[p].append(m)
    print(f'\n=== Cross-Platform Brand Report - {BRAND} ===')
    for platform, items in by_platform.items():
        sentiments = Counter(score_mention(m) for m in items)
        print(f'\n  [{platform.upper()}] {len(items)} mentions')
        print(f'    Positive: {sentiments["positive"]} | Neutral: {sentiments["neutral"]} | Negative: {sentiments["negative"]}')
        for item in items[:2]:
            print(f'    - {item["title"][:55]}')

platform_report(all_mentions)

Step 3: Generate unified daily digest

Compile all platform data into a single actionable report.

Python
def daily_digest(mentions):
    total = len(mentions)
    sentiments = Counter(score_mention(m) for m in mentions)
    platforms = Counter(m['platform'] for m in mentions)
    print(f'\n=== Daily Brand Digest - {datetime.now().strftime("%Y-%m-%d")} ===')
    print(f'  Brand: {BRAND}')
    print(f'  Total mentions: {total}')
    print(f'  Sentiment: +{sentiments["positive"]} neutral:{sentiments["neutral"]} -{sentiments["negative"]}')
    print(f'  Platforms: {", ".join(f"{p}({c})" for p, c in platforms.most_common())}')
    # Highlight negative mentions that need attention
    negative = [m for m in mentions if score_mention(m) == 'negative']
    if negative:
        print(f'\n  NEEDS ATTENTION ({len(negative)} negative mentions):')
        for m in negative[:3]:
            print(f'    [{m["platform"]}] {m["title"][:50]}')
            print(f'      {m["link"][:60]}')
    # Highlight high-reach mentions
    tiktok_high = [m for m in mentions if m.get('plays', 0) > 10000]
    if tiktok_high:
        print(f'\n  HIGH REACH TikTok ({len(tiktok_high)} videos >10K plays):')
        for m in tiktok_high[:3]:
            print(f'    {m["plays"]:,} plays: {m["title"][:40]}')
    print(f'\n  Daily cost: $0.020 (4 platform searches)')

daily_digest(all_mentions)

Python Example

Python
import os, requests
SH = {'x-api-key': os.environ['SCAVIO_API_KEY'], 'Content-Type': 'application/json'}
TH = {'Authorization': f'Bearer {os.environ["SCAVIO_API_KEY"]}', 'Content-Type': 'application/json'}

brand = 'Scavio'
for p in [None, 'reddit', 'youtube']:
    body = {'query': brand, 'country_code': 'us'}
    if p: body['platform'] = p
    data = requests.post('https://api.scavio.dev/api/v1/search', headers=SH, json=body).json()
    print(f'{p or "google"}: {len(data.get("organic_results", []))} mentions')
tt = requests.post('https://api.scavio.dev/api/v1/tiktok/search/videos', headers=TH, json={'query': brand}).json()
print(f'tiktok: {len(tt.get("videos", []))} mentions')
print('Cost: $0.020')

JavaScript Example

JavaScript
const SH = { 'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json' };
for (const p of [null, 'reddit', 'youtube']) {
  const body = { query: 'Scavio', country_code: 'us' };
  if (p) body.platform = p;
  const data = await fetch('https://api.scavio.dev/api/v1/search', {
    method: 'POST', headers: SH, body: JSON.stringify(body)
  }).then(r => r.json());
  console.log(`${p || 'google'}: ${(data.organic_results || []).length} mentions`);
}

Expected Output

JSON
google    : 8 mentions
reddit    : 5 mentions
youtube   : 4 mentions
tiktok    : 6 mentions

Total: 23 mentions. Cost: $0.020

=== Daily Brand Digest - 2026-05-20 ===
  Brand: Scavio
  Total mentions: 23
  Sentiment: +12 neutral:9 -2
  Platforms: google(8), tiktok(6), reddit(5), youtube(4)

  NEEDS ATTENTION (2 negative mentions):
    [reddit] Scavio API returning 429 errors today

  Daily cost: $0.020 (4 platform searches)

Related Tutorials

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+. requests library. A Scavio API key from scavio.dev. Brand name and competitor names. A Scavio API key gives you 250 free credits per month.

Yes. The free tier includes 250 credits per month, 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.

Start Building

Monitor brand mentions across Google, Reddit, TikTok, and YouTube from one API. Daily digest with sentiment and reach metrics.