Overview
This workflow scans popular stock-focused subreddits daily to identify the most discussed tickers and extract sentiment signals from post titles and scores. It searches r/wallstreetbets, r/stocks, and r/investing for a list of target tickers, counts mention frequency, and flags tickers with unusual discussion volume. Quantitative traders and retail investors use this to detect Reddit-driven momentum before it shows up in price.
Trigger
Cron schedule (daily at 7:00 AM UTC)
Schedule
Runs daily at 7:00 AM UTC
Workflow Steps
Define ticker watchlist
Load a list of stock tickers to monitor from configuration (e.g., AAPL, NVDA, TSLA, GME).
Search Reddit for each ticker
Query Scavio Reddit search for each ticker across r/wallstreetbets, r/stocks, and r/investing.
Count mentions and extract sentiment
Tally mention counts per ticker and classify post titles as bullish, bearish, or neutral based on keyword matching.
Detect volume anomalies
Compare today's mention counts against 7-day averages to flag tickers with unusual discussion spikes.
Generate daily ticker report
Output a ranked report of tickers by discussion volume with sentiment breakdown and anomaly flags.
Python Implementation
import requests
import json
from pathlib import Path
from datetime import datetime
API_KEY = "your_scavio_api_key"
TICKERS = ["AAPL", "NVDA", "TSLA", "GME", "AMD", "PLTR", "AMZN", "MSFT", "META", "GOOG"]
SUBREDDITS = ["wallstreetbets", "stocks", "investing"]
BULLISH_WORDS = ["moon", "buy", "calls", "long", "bullish", "undervalued", "breakout"]
BEARISH_WORDS = ["puts", "short", "crash", "overvalued", "sell", "bearish", "dump"]
def search_ticker(ticker: str) -> list[dict]:
results = []
for sub in SUBREDDITS:
res = requests.post(
"https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY},
json={"platform": "reddit", "query": f"{ticker} {sub}"},
timeout=15,
)
res.raise_for_status()
for post in res.json().get("organic", []):
results.append({
"title": post.get("title", ""),
"subreddit": post.get("subreddit", sub),
"score": post.get("score", 0),
"link": post.get("link", ""),
})
return results
def classify_sentiment(title: str) -> str:
lower = title.lower()
bull = sum(1 for w in BULLISH_WORDS if w in lower)
bear = sum(1 for w in BEARISH_WORDS if w in lower)
if bull > bear:
return "bullish"
elif bear > bull:
return "bearish"
return "neutral"
def run():
date = datetime.utcnow().strftime("%Y-%m-%d")
ticker_data = {}
for ticker in TICKERS:
posts = search_ticker(ticker)
sentiments = [classify_sentiment(p["title"]) for p in posts]
ticker_data[ticker] = {
"mentions": len(posts),
"total_score": sum(p["score"] for p in posts),
"bullish": sentiments.count("bullish"),
"bearish": sentiments.count("bearish"),
"neutral": sentiments.count("neutral"),
"top_posts": sorted(posts, key=lambda x: x["score"], reverse=True)[:3],
}
# Sort by mention count
ranked = sorted(ticker_data.items(), key=lambda x: x[1]["mentions"], reverse=True)
report = {"date": date, "tickers_scanned": len(TICKERS), "tickers": dict(ranked)}
Path(f"reddit_stocks_{date}.json").write_text(json.dumps(report, indent=2))
print(f"Reddit Stock Scan {date}")
for ticker, data in ranked[:5]:
print(f" {ticker}: {data['mentions']} mentions, {data['bullish']}B/{data['bearish']}b/{data['neutral']}N")
if __name__ == "__main__":
run()JavaScript Implementation
const API_KEY = "your_scavio_api_key";
const TICKERS = ["AAPL", "NVDA", "TSLA", "GME", "AMD"];
async function searchTicker(ticker) {
const res = await fetch("https://api.scavio.dev/api/v1/search", {
method: "POST",
headers: { "x-api-key": API_KEY, "content-type": "application/json" },
body: JSON.stringify({ platform: "reddit", query: `${ticker} wallstreetbets stocks` }),
});
if (!res.ok) throw new Error(`scavio ${res.status}`);
return (await res.json()).organic ?? [];
}
const report = {};
for (const ticker of TICKERS) {
const posts = await searchTicker(ticker);
report[ticker] = { mentions: posts.length, topScore: Math.max(0, ...posts.map((p) => p.score ?? 0)) };
}
const sorted = Object.entries(report).sort((a, b) => b[1].mentions - a[1].mentions);
for (const [ticker, data] of sorted) console.log(`${ticker}: ${data.mentions} mentions, top score ${data.topScore}`);Platforms Used
Community, posts & threaded comments from any subreddit