ScavioScavio
ProductPricingDocs
Sign InGet Started
  1. Home
  2. Tutorials
  3. How to Build a Reddit Brand Mention Alert
Tutorial

How to Build a Reddit Brand Mention Alert

Monitor Reddit for brand mentions using the Scavio search API with platform:reddit. Deduplicate posts, detect sentiment, and send Slack or email alerts daily.

Get Free API KeyAPI Docs

You can monitor Reddit for brand mentions by searching with platform set to reddit in the Scavio search API, filtering new posts since the last run, and posting alerts to Slack when mentions are found.

Prerequisites

  • Python 3.9+
  • Scavio API key
  • Slack webhook URL (optional)

Walkthrough

Step 1: Search Reddit for brand mentions

Set platform:reddit to restrict results to Reddit posts and comments.

Python
import requests

API_KEY = "your-scavio-api-key"

def search_reddit(brand: str, num_results: int = 20) -> list:
    r = requests.post(
        "https://api.scavio.dev/api/v1/search",
        json={"query": brand, "platform": "reddit", "num_results": num_results},
        headers={"x-api-key": API_KEY},
        timeout=15
    )
    r.raise_for_status()
    return r.json().get("organic_results", [])

mentions = search_reddit("YourBrand")
for m in mentions:
    print(m.get("title"), m.get("link"))

Step 2: Deduplicate with SQLite

Store seen URLs so you only alert on new mentions.

Python
import sqlite3

def init_db(path="reddit_mentions.db"):
    conn = sqlite3.connect(path)
    conn.execute("""
        CREATE TABLE IF NOT EXISTS seen (
            url TEXT PRIMARY KEY,
            title TEXT,
            first_seen TEXT
        )
    """)
    conn.commit()
    return conn

def filter_new(conn, mentions: list) -> list:
    from datetime import date
    new = []
    for m in mentions:
        url = m.get("link", "")
        exists = conn.execute("SELECT 1 FROM seen WHERE url=?", (url,)).fetchone()
        if not exists:
            conn.execute("INSERT INTO seen VALUES (?, ?, ?)",
                         (url, m.get("title"), str(date.today())))
            new.append(m)
    conn.commit()
    return new

Step 3: Send Slack alert for new mentions

Post each new mention as a Slack message via webhook.

Python
import json

def send_slack_alert(webhook_url: str, brand: str, mention: dict):
    message = {
        "text": f"*New Reddit mention of {brand}*",
        "blocks": [
            {"type": "section", "text": {"type": "mrkdwn",
             "text": f"*<{mention['link']}|{mention['title'][:100]}>*"}},
            {"type": "section", "text": {"type": "mrkdwn",
             "text": mention.get("snippet", "")[:300]}}
        ]
    }
    requests.post(webhook_url, json=message, timeout=10)

Step 4: Run as a daily cron

Save as reddit_monitor.py and schedule: 0 8 * * * python /path/to/reddit_monitor.py

Python
BRAND = "YourBrand"
SLACK_WEBHOOK = "https://hooks.slack.com/services/xxx/yyy/zzz"  # or None

conn = init_db()
mentions = search_reddit(BRAND, num_results=20)
new_mentions = filter_new(conn, mentions)

print(f"Found {len(new_mentions)} new mentions of '{BRAND}'")
for m in new_mentions:
    print(f"  {m['title'][:80]}")
    print(f"  {m['link']}")
    if SLACK_WEBHOOK:
        send_slack_alert(SLACK_WEBHOOK, BRAND, m)

Python Example

Python
import requests
import sqlite3
from datetime import date

API_KEY = "your-scavio-api-key"
BRAND = "YourBrand"
SLACK_WEBHOOK = None  # Set to your Slack webhook URL

def search_reddit(brand, n=20):
    r = requests.post("https://api.scavio.dev/api/v1/search",
                      json={"query": brand, "platform": "reddit", "num_results": n},
                      headers={"x-api-key": API_KEY}, timeout=15)
    r.raise_for_status()
    return r.json().get("organic_results", [])

def init_db(path="reddit_mentions.db"):
    conn = sqlite3.connect(path)
    conn.execute("CREATE TABLE IF NOT EXISTS seen (url TEXT PRIMARY KEY, title TEXT, first_seen TEXT)")
    conn.commit()
    return conn

def get_new(conn, mentions):
    new = []
    for m in mentions:
        url = m.get("link","")
        if not conn.execute("SELECT 1 FROM seen WHERE url=?", (url,)).fetchone():
            conn.execute("INSERT INTO seen VALUES (?,?,?)", (url, m.get("title"), str(date.today())))
            new.append(m)
    conn.commit()
    return new

def alert(webhook, brand, m):
    if not webhook: return
    requests.post(webhook, json={"text": f"New Reddit mention of {brand}: <{m['link']}|{m['title'][:100]}>"}, timeout=10)

if __name__ == "__main__":
    conn = init_db()
    mentions = search_reddit(BRAND)
    new = get_new(conn, mentions)
    print(f"[{date.today()}] {BRAND}: {len(new)} new mentions (of {len(mentions)} total)")
    for m in new:
        print(f"  r/{m.get('source_subreddit','?')} | {m['title'][:70]}")
        print(f"  {m['link']}")
        alert(SLACK_WEBHOOK, BRAND, m)

JavaScript Example

JavaScript
const API_KEY = 'your-scavio-api-key';

async function searchReddit(brand, n = 20) {
  const res = await fetch('https://api.scavio.dev/api/v1/search', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json', 'x-api-key': API_KEY },
    body: JSON.stringify({ query: brand, platform: 'reddit', num_results: n })
  });
  const data = await res.json();
  return data.organic_results ?? [];
}

const mentions = await searchReddit('YourBrand');
for (const m of mentions.slice(0, 5)) {
  console.log(`${m.title?.slice(0, 80)}`);
  console.log(`  ${m.link}`);
}

Expected Output

JSON
[2026-05-22] YourBrand: 3 new mentions (of 18 total)
  r/SaaS | Has anyone tried YourBrand for team project management?
  https://reddit.com/r/SaaS/comments/abc123/
  r/entrepreneur | YourBrand vs Notion - which is better for solo founders?
  https://reddit.com/r/entrepreneur/comments/def456/
  r/productivity | YourBrand just launched a new AI feature
  https://reddit.com/r/productivity/comments/ghi789/

Related Tutorials

  • How to Build a Multi-Source Research Agent
  • How to Monitor Competitor SERP Positions with an API
  • How to Verify Competitor Pricing Claims with SERP

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.9+. Scavio API key. Slack webhook URL (optional). 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

Use Case

Search Surface Brand Monitoring

Read more
Best Of

Best Reddit Search API in 2026

Read more
Best Of

Best APIs for Brand Sentiment on Reddit (2026)

Read more
Solution

Auto-Alert When Search API Budget Hits Threshold

Read more
Use Case

Multi-Platform Social Listening

Read more
Workflow

Cross-Platform Brand Mention Monitoring Workflow

Read more

Start Building

Monitor Reddit for brand mentions using the Scavio search API with platform:reddit. Deduplicate posts, detect sentiment, and send Slack or email alerts daily.

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