Los subreddits de Reddit como r/wallstreetbets, r/stocks y r/investing contienen señales comerciales tempranas enterradas en publicaciones de diligencia debida e hilos de discusión. Al consultar Reddit a través de SERP API, estas publicaciones se devuelven como JSON estructurado sin OAuth, límites de velocidad ni credenciales de Reddit API. Cada escaneo de subreddit cuesta $0,005.
Requisitos previos
- Python 3.8+
- solicita biblioteca
- Una clave API de Scavio de scavio.dev
- Lista de tickers o sectores para escanear
Guia paso a paso
Paso 1: Escanee subreddits financieros en busca de menciones
Busque en varios subreddits comerciales menciones de tickers objetivo.
import os, requests
from collections import Counter, defaultdict
API_KEY = os.environ['SCAVIO_API_KEY']
SH = {'x-api-key': API_KEY, 'Content-Type': 'application/json'}
SUBREDDITS = ['wallstreetbets', 'stocks', 'investing', 'options']
TICKERS = ['NVDA', 'TSLA', 'AMD', 'PLTR', 'SOFI']
def scan_subreddit(ticker, subreddit):
data = requests.post('https://api.scavio.dev/api/v1/search',
headers=SH, json={'query': f'{ticker} site:reddit.com/r/{subreddit}',
'country_code': 'us'}).json()
posts = data.get('organic_results', [])
return [{'title': p.get('title', ''), 'snippet': p.get('snippet', ''),
'link': p.get('link', '')} for p in posts]
signals = defaultdict(list)
for ticker in TICKERS:
for sub in SUBREDDITS:
posts = scan_subreddit(ticker, sub)
for p in posts:
signals[ticker].append({**p, 'subreddit': sub})
print(f'{ticker}: {len(signals[ticker])} posts across {len(SUBREDDITS)} subreddits')
print(f'Cost: ${len(TICKERS) * len(SUBREDDITS) * 0.005:.3f}')Paso 2: Clasificar tipos de señales del contenido de la publicación
Detecte publicaciones de DD, reproducciones de YOLO, cambios de sentimiento y catalizadores de títulos.
DD_SIGNALS = ['dd', 'due diligence', 'analysis', 'thesis', 'deep dive', 'research']
YOLO_SIGNALS = ['yolo', 'all in', 'bet', 'calls', 'puts', 'options play']
CATALYST_SIGNALS = ['earnings', 'fda', 'merger', 'acquisition', 'guidance', 'contract']
def classify_signal(title, snippet):
text = f'{title} {snippet}'.lower()
if any(s in text for s in DD_SIGNALS): return 'DD'
if any(s in text for s in YOLO_SIGNALS): return 'YOLO'
if any(s in text for s in CATALYST_SIGNALS): return 'CATALYST'
return 'DISCUSSION'
def build_signal_report(signals):
print(f'\n=== Reddit Trading Signals Report ===')
for ticker, posts in sorted(signals.items(), key=lambda x: len(x[1]), reverse=True):
signal_types = Counter(classify_signal(p['title'], p['snippet']) for p in posts)
print(f'\n {ticker} ({len(posts)} posts):')
for stype, count in signal_types.most_common():
print(f' {stype:12}: {count} posts')
# Show top DD post if any
dd_posts = [p for p in posts if classify_signal(p['title'], p['snippet']) == 'DD']
if dd_posts:
print(f' Top DD: {dd_posts[0]["title"][:60]}')
build_signal_report(signals)Paso 3: Generar resumen de señales procesables
Clasifique los teletipos según la intensidad de la señal y genere una lista de vigilancia diaria.
def daily_watchlist(signals):
ranked = []
for ticker, posts in signals.items():
types = Counter(classify_signal(p['title'], p['snippet']) for p in posts)
score = types.get('DD', 0) * 3 + types.get('CATALYST', 0) * 2 + types.get('YOLO', 0) * 1
ranked.append({'ticker': ticker, 'posts': len(posts), 'score': score,
'dd': types.get('DD', 0), 'catalyst': types.get('CATALYST', 0)})
ranked.sort(key=lambda x: x['score'], reverse=True)
print(f'\n=== Daily Watchlist - Reddit Signals ===')
for r in ranked:
heat = 'HOT' if r['score'] >= 5 else 'WARM' if r['score'] >= 2 else 'COOL'
print(f' {r["ticker"]:6} | {heat:4} | Score:{r["score"]:3} | DD:{r["dd"]} CAT:{r["catalyst"]} | {r["posts"]} posts')
total_queries = len(TICKERS) * len(SUBREDDITS)
print(f'\nTotal cost: ${total_queries * 0.005:.3f} ({total_queries} queries)')
daily_watchlist(signals)Ejemplo en Python
import os, requests
SH = {'x-api-key': os.environ['SCAVIO_API_KEY'], 'Content-Type': 'application/json'}
def reddit_signal(ticker):
data = requests.post('https://api.scavio.dev/api/v1/search',
headers=SH, json={'query': f'{ticker} DD site:reddit.com/r/wallstreetbets', 'country_code': 'us'}).json()
posts = data.get('organic_results', [])
print(f'{ticker}: {len(posts)} DD posts on WSB')
for p in posts[:2]:
print(f' {p.get("title", "")[:60]}')
for t in ['NVDA', 'TSLA']: reddit_signal(t)
print('Cost: $0.010')Ejemplo en JavaScript
const SH = { 'x-api-key': process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json' };
async function redditSignal(ticker) {
const data = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST', headers: SH,
body: JSON.stringify({ query: `${ticker} DD site:reddit.com/r/wallstreetbets`, country_code: 'us' })
}).then(r => r.json());
console.log(`${ticker}: ${(data.organic_results || []).length} DD posts`);
}
for (const t of ['NVDA', 'TSLA']) await redditSignal(t);Salida esperada
NVDA: 18 posts across 4 subreddits
TSLA: 22 posts across 4 subreddits
AMD: 14 posts across 4 subreddits
Cost: $0.100
=== Daily Watchlist - Reddit Signals ===
NVDA | HOT | Score: 8 | DD:2 CAT:1 | 18 posts
TSLA | WARM | Score: 4 | DD:1 CAT:0 | 22 posts
PLTR | WARM | Score: 3 | DD:1 CAT:0 | 12 posts
AMD | COOL | Score: 1 | DD:0 CAT:0 | 14 posts
SOFI | COOL | Score: 0 | DD:0 CAT:0 | 8 posts
Total cost: $0.100 (20 queries)