Social listening tools charge $200-500/month for multi-platform monitoring. This pipeline covers Reddit, TikTok, YouTube, and Google web mentions from a single API at $0.020 per scan. It unifies mention formats, scores sentiment, tracks reach, and generates a daily listening report.
Prerequisites
- Python 3.8+
- requests library
- A Scavio API key from scavio.dev
- Brand terms and competitor names
Walkthrough
Step 1: Set up multi-platform mention collection
Query each platform for brand mentions using the right API endpoint.
import os, requests, json
from datetime import datetime
from collections import Counter, defaultdict
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'
COMPETITORS = ['Tavily', 'SerpAPI']
def collect_mentions(brand):
mentions = []
# Google web mentions
data = requests.post('https://api.scavio.dev/api/v1/search',
headers=SH, json={'query': brand, 'country_code': 'us'}).json()
for r in data.get('organic_results', [])[:5]:
mentions.append({'platform': 'google', 'title': r.get('title', ''), 'text': r.get('snippet', ''), 'link': r.get('link', ''), 'reach': 0})
# Reddit mentions
data = requests.post('https://api.scavio.dev/api/v1/search',
headers=SH, json={'query': brand, 'platform': 'reddit', 'country_code': 'us'}).json()
for r in data.get('organic_results', [])[:5]:
mentions.append({'platform': 'reddit', 'title': r.get('title', ''), 'text': r.get('snippet', ''), 'link': r.get('link', ''), 'reach': 0})
# YouTube mentions
data = requests.post('https://api.scavio.dev/api/v1/search',
headers=SH, json={'query': brand, 'platform': 'youtube', 'country_code': 'us'}).json()
for r in data.get('organic_results', [])[:5]:
mentions.append({'platform': 'youtube', 'title': r.get('title', ''), 'text': r.get('snippet', ''), 'link': r.get('link', ''), 'reach': 0})
# TikTok mentions
data = requests.post('https://api.scavio.dev/api/v1/tiktok/search/videos',
headers=TH, json={'query': brand}).json()
for v in (data.get('videos', data.get('data', {}).get('videos', [])))[:5]:
mentions.append({'platform': 'tiktok', 'title': v.get('desc', '')[:80], 'text': v.get('desc', ''), 'link': '', 'reach': v.get('stats', {}).get('playCount', 0)})
return mentions
all_mentions = collect_mentions(BRAND)
by_platform = Counter(m['platform'] for m in all_mentions)
print(f'{BRAND}: {len(all_mentions)} total mentions')
for p, c in by_platform.most_common():
print(f' {p}: {c} mentions')
print(f'Cost: $0.020')Step 2: Unify sentiment scoring across platforms
Apply consistent sentiment analysis to all mention types.
POSITIVE = ['best', 'great', 'love', 'recommend', 'amazing', 'excellent', 'game changer', 'solid']
NEGATIVE = ['worst', 'terrible', 'avoid', 'hate', 'broken', 'expensive', 'scam', 'disappointed']
def score_sentiment(text):
text_lower = text.lower()
pos = sum(1 for w in POSITIVE if w in text_lower)
neg = sum(1 for w in NEGATIVE if w in text_lower)
if pos > neg: return 'positive'
if neg > pos: return 'negative'
return 'neutral'
def sentiment_by_platform(mentions):
results = defaultdict(lambda: Counter())
for m in mentions:
sentiment = score_sentiment(f'{m["title"]} {m["text"]}')
m['sentiment'] = sentiment
results[m['platform']][sentiment] += 1
print(f'\n=== Sentiment by Platform ===')
for platform, sentiments in results.items():
total = sum(sentiments.values())
pos_pct = sentiments['positive'] / total * 100 if total else 0
neg_pct = sentiments['negative'] / total * 100 if total else 0
print(f' {platform:10} | +{sentiments["positive"]} ~{sentiments["neutral"]} -{sentiments["negative"]} | {pos_pct:.0f}% positive')
return results
sentiment_by_platform(all_mentions)Step 3: Generate social listening report
Compile all data into an actionable social listening report.
def social_listening_report(brand, mentions, competitors):
print(f'\n{"=" * 60}')
print(f' SOCIAL LISTENING REPORT - {brand}')
print(f' Date: {datetime.now().strftime("%Y-%m-%d")}')
print(f'{"=" * 60}')
# Overview
total = len(mentions)
positive = sum(1 for m in mentions if m.get('sentiment') == 'positive')
negative = sum(1 for m in mentions if m.get('sentiment') == 'negative')
total_reach = sum(m.get('reach', 0) for m in mentions)
print(f'\n Mentions: {total} | Reach: {total_reach:,}')
print(f' Sentiment: +{positive} ~{total-positive-negative} -{negative}')
# Platform breakdown
print(f'\n Platform Breakdown:')
by_platform = defaultdict(list)
for m in mentions:
by_platform[m['platform']].append(m)
for p, items in by_platform.items():
reach = sum(m.get('reach', 0) for m in items)
print(f' {p:10} | {len(items):3} mentions | reach: {reach:,}')
# Top mentions by reach
high_reach = sorted(mentions, key=lambda m: m.get('reach', 0), reverse=True)[:3]
if any(m.get('reach', 0) > 0 for m in high_reach):
print(f'\n Top by Reach:')
for m in high_reach:
if m.get('reach', 0) > 0:
print(f' [{m["platform"]}] {m["reach"]:,} reach: {m["title"][:40]}')
# Competitor comparison
if competitors:
print(f'\n Competitor Comparison:')
for comp in competitors:
comp_mentions = collect_mentions(comp)
print(f' {comp:15} | {len(comp_mentions)} mentions')
print(f'\n Cost: $0.020 per brand scan')
social_listening_report(BRAND, all_mentions, COMPETITORS)Python Example
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'}
def listen(brand):
for platform in [None, 'reddit', 'youtube']:
body = {'query': brand, 'country_code': 'us'}
if platform: body['platform'] = platform
data = requests.post('https://api.scavio.dev/api/v1/search', headers=SH, json=body).json()
print(f'{platform 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')
listen('Scavio')
print('Cost: $0.020')JavaScript Example
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', ...(p && { 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
Scavio: 18 total mentions
google: 5 mentions
reddit: 5 mentions
youtube: 4 mentions
tiktok: 4 mentions
Cost: $0.020
============================================================
SOCIAL LISTENING REPORT - Scavio
Date: 2026-05-20
============================================================
Mentions: 18 | Reach: 125,000
Sentiment: +10 ~6 -2
Platform Breakdown:
google | 5 mentions | reach: 0
reddit | 5 mentions | reach: 0
youtube | 4 mentions | reach: 0
tiktok | 4 mentions | reach: 125,000
Cost: $0.020 per brand scan