Twitter WebSocket Alerts for Trading Bots
Stream crypto Twitter alerts to your trading bot with real-time WebSocket updates
Real-Time Alerts for Automated Trading
Plug your bot into TweetStream's WebSocket and receive alerts enriched with tokens, prices, and OCR - ready to trade, zero processing.
Why WebSocket?
- Persistent connection - No polling overhead, alerts push instantly when tweets are detected
- Sub-second latency - Response-time targets published for each plan tier
- Structured data - Consistent JSON schema - parse once, handle all alerts
- Connection management - Built-in heartbeat and auto-reconnect - your bot stays connected
Enriched Alert Data
Tweet alerts can include:
- Detected tokens with contract addresses and live prices
- OCR-extracted text from screenshots and images
- Polymarket market references with live odds
- CEX ticker matches (Binance, Bybit, Hyperliquid)
- Full tweet content including media and referenced tweets
Quick Start
Connect to TweetStream in just a few lines of code:
const API_KEY = 'YOUR_API_KEY';
const WS_URL = 'wss://ws.tweetstream.io/ws';
const protocols = [
'tweetstream.v1',
`tweetstream.auth.token.${API_KEY}`,
];
const ws = new WebSocket(WS_URL, protocols);
ws.onmessage = (event) => {
const envelope = JSON.parse(event.data);
if (envelope.t === 'tweet' && envelope.op === 'content') {
const tweet = envelope.d;
const author = tweet.author?.handle ?? 'unknown';
// Access detected tokens with live prices
const meta = envelope.d.meta;
if (meta?.detected?.tokens?.length) {
for (const token of meta.detected.tokens) {
console.log(`Token: ${token.symbol} @ $${token.priceUsd}`);
// Trigger your trading logic here
}
}
}
};Use Cases
Trading bots that front-run influencer calls. Portfolio trackers watching whale wallets. Sentiment dashboards. Alert systems that wake your team for market-moving posts.
Frequently Asked Questions
Start real-time Twitter WebSocket alerts today
WebSocket delivery, OCR, and token detection - no infrastructure to build.
Start 3-Day TrialFrom $199/mo · Basic/Elite 3-day trial · OCR + token detection included
