Resumen
Este pipeline scans Reddit trading communities diario, extrae ticker menciones de publicacion titles y comentarios, y cross-references con Google News to validar senales. El flujo de trabajo produces un manana briefing con tickers showing unusual Reddit activity alongside cualquier confirming news headlines. Designed for traders who quiere Reddit-sourced alpha sin manualmente scrolling trading subreddits.
Desencadenador
Cron programar (diario at 7:00 AM EST)
Programación
Ejecuta diario at 7:00 AM EST
Pasos del flujo de trabajo
Scan Reddit trading subreddits
Consulta Scavio Reddit for reciente publicaciones de WSB, r/stocks, r/opciones, y r/investing.
Extraer y conteo ticker menciones
Analizar ticker symbols de publicacion titles y fragmentos, filtrado noise words.
Cross-reference con Google News
For top-mentioned tickers, consulta Scavio Google for confirming o contradicting news.
Generar manana briefing
Compile un ranked ticker lista con Reddit mencion counts y news confirmation estado.
Implementacion en Python
import requests
import json
import re
from collections import Counter
from datetime import datetime
from pathlib import Path
API_KEY = "your_scavio_api_key"
TICKER_RE = re.compile(r"\b[A-Z]{2,5}\b")
SKIP = {"THE","AND","FOR","ARE","BUT","NOT","YOU","ALL","CAN","HAS","WSB","IMO","YOLO","FOMO","HODL","TBH"}
def scan_reddit(queries: list[str]) -> list[dict]:
posts = []
for q in queries:
res = requests.post(
"https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY},
json={"platform": "reddit", "query": q},
timeout=15,
)
res.raise_for_status()
posts.extend(res.json().get("organic", []))
return posts
def cross_reference_news(ticker: str) -> dict:
res = requests.post(
"https://api.scavio.dev/api/v1/search",
headers={"x-api-key": API_KEY},
json={"platform": "google", "query": f"{ticker} stock news today"},
timeout=15,
)
res.raise_for_status()
headlines = [r.get("title", "") for r in res.json().get("organic", [])[:3]]
return {"ticker": ticker, "news_headlines": headlines, "has_news": len(headlines) > 0}
def run():
date = datetime.utcnow().strftime("%Y-%m-%d")
posts = scan_reddit(["wallstreetbets today", "stocks picks today", "options plays this week"])
counts = Counter()
for p in posts:
text = f"{p.get('title', '')} {p.get('snippet', '')}"
for t in TICKER_RE.findall(text):
if t not in SKIP:
counts[t] += 1
top = counts.most_common(10)
briefing = {"date": date, "posts_scanned": len(posts), "signals": []}
for ticker, mentions in top:
news = cross_reference_news(ticker)
briefing["signals"].append({"ticker": ticker, "reddit_mentions": mentions, **news})
Path(f"trading_scan_{date}.json").write_text(json.dumps(briefing, indent=2))
for s in briefing["signals"][:5]:
news_str = s["news_headlines"][0][:60] if s["news_headlines"] else "no confirming news"
print(f" ${s['ticker']}: {s['reddit_mentions']} mentions | {news_str}")
if __name__ == "__main__":
run()Implementacion en JavaScript
const API_KEY = "your_scavio_api_key";
const SKIP = new Set(["THE","AND","FOR","ARE","BUT","NOT","YOU","ALL","WSB","YOLO","FOMO"]);
async function scanReddit(queries) {
const posts = [];
for (const q of queries) {
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: q }),
});
posts.push(...((await res.json()).organic ?? []));
}
return posts;
}
const posts = await scanReddit(["wallstreetbets today", "stocks picks today"]);
const counts = {};
for (const p of posts) {
for (const m of `${p.title ?? ""} ${p.snippet ?? ""}`.matchAll(/\b[A-Z]{2,5}\b/g)) {
if (!SKIP.has(m[0])) counts[m[0]] = (counts[m[0]] ?? 0) + 1;
}
}
Object.entries(counts).sort((a, b) => b[1] - a[1]).slice(0, 5).forEach(([t, c]) => console.log(`$${t}: ${c} mentions`));Plataformas utilizadas
Comunidad, publicaciones y comentarios en hilos de cualquier subreddit
Búsqueda web con grafo de conocimiento, PAA y resúmenes de IA