Resumen
Search Reddit for stock ticker menciones diario, puntuacion cada thread's sentiment con un LLM, agregar by ticker, y rastrear sentiment tendencias sobre un rolling 30-dia window.
Desencadenador
Diario cron (e.g. 18:00 UTC, despues de mercado close)
Programación
Diario despues de mercado close
Pasos del flujo de trabajo
Define ticker watchlist
List of tickers to rastrear: AAPL, TSLA, NVDA, etc.
Search Scavio Reddit endpoint per ticker
POST /api/v1/search con plataforma=reddit, consulta='$TICKER'. Top-20 threads.
Puntuacion sentiment per thread
Enviar thread titulo + top comentario to LLM: 'Rate sentiment -1 to +1 for este stock discussion. Return JSON {puntuacion, reasoning}.'
Agregar diario puntuacion per ticker
Average sentiment puntuaciones a traves de todos threads for ese ticker.
Agregar to rolling 30-dia registro
Almacenar in SQLite o CSV: date, ticker, avg_sentiment, thread_count.
Optional: alerta on sentiment spikes
Si today's puntuacion deviates > 0.5 de 7-dia promedio, enviar Slack alerta.
Implementacion en Python
import requests, os, json
key = os.environ["SCAVIO_API_KEY"]
tickers = ["AAPL", "TSLA", "NVDA"]
for ticker in tickers:
resp = requests.post("https://api.scavio.dev/api/v1/search",
headers={"x-api-key": key},
json={"query": f"${ticker}", "platform": "reddit", "limit": 20})
threads = resp.json().get("results", [])
scores = []
for t in threads:
result = call_llm(f"Rate sentiment -1 to +1: {t['title']}. JSON: score, reasoning.")
scores.append(json.loads(result)["score"])
avg = sum(scores) / len(scores) if scores else 0
print(f"{ticker}: avg sentiment {avg:.2f} across {len(threads)} threads")Implementacion en JavaScript
const tickers = ["AAPL", "TSLA", "NVDA"];
for (const ticker of tickers) {
const resp = await fetch("https://api.scavio.dev/api/v1/search", {
method: "POST",
headers: { "x-api-key": process.env.SCAVIO_API_KEY, "Content-Type": "application/json" },
body: JSON.stringify({ query: `$${ticker}`, platform: "reddit", limit: 20 })
});
const threads = (await resp.json()).results;
const scores = [];
for (const t of threads) {
const r = await callLLM(`Rate sentiment -1 to +1: ${t.title}. JSON: {score, reasoning}.`);
scores.push(JSON.parse(r).score);
}
const avg = scores.reduce((a, b) => a + b, 0) / (scores.length || 1);
console.log(`${ticker}: avg sentiment ${avg.toFixed(2)} across ${threads.length} threads`);
}Plataformas utilizadas
Comunidad, publicaciones y comentarios en hilos de cualquier subreddit