Payloads, Token Detection & OCR
Complete reference for TweetStream alert data structures and enrichment features
Tweet Lifecycle
For tweet events, TweetStream sends a base content message first, optional update messages, and a meta message when enrichment is ready:
content- The tweet text, author, and media (arrives first)update- Optional ref context or URL expansion updatesmeta- Enrichment data: OCR results, detected tokens, markets (arrives shortly after)
Message Families
TweetStream uses one WebSocket envelope format for live events and a separate history response shape for replay:
tweet- tweet envelopes carry content, update, and meta eventsaccount- account envelopes carry profile_update and follow eventscontrol- control envelopes carry handle-management results such as twitter_handles_result/api/history- the history API returns rows with tweetId, body, time, receivedTime, link, messageType, twitterHandle, twitterId, content, and optional meta
Tweet Content Type
Truth Social posts use the same tweet content shape. Check author.platform to distinguish them from X/Twitter posts.
Account Event Types
Profile updates and follow notifications use the account envelope family and share the richer actor fields shown below:
Tweet Meta Type
The meta payload contains all enrichment data:
History Response Type
Historical replay returns tweet, profile, and follow rows in one response shape with metadata filters echoed back.
Control Event Type
Handle-management responses use the control envelope family. These results arrive after follow or unfollow commands you send over the WebSocket.
Token Detection
TweetStream automatically detects tokens from multiple sources:
| Source | Examples |
|---|---|
| $TICKER symbols | $BTC, $ETH, $SOL |
| Contract addresses | 0x... (EVM), pump... (Solana) |
| DEX URLs | dexscreener.com, birdeye.so |
| OCR text | Tickers and addresses in images |
OCR Text Extraction
Text is automatically extracted from images attached to tweets. This includes:
- Screenshots of charts and trading terminals
- Images containing token information
- Announcements and promotional graphics
OCR results are included in the meta.ocr.text field and are also scanned for token detection.
Prediction Markets
References to Polymarket markets are detected and enriched with live odds. The detected.prediction array includes:
- Market ID and title
- Current price (probability)
- Direct link to the market
Example: Content Envelope
Example: Meta Envelope
Example: Account Envelope
Example: Control Envelope
Example: History Response
Start real-time Twitter WebSocket alerts today
WebSocket delivery, OCR, and token detection - no infrastructure to build.
Start 7-Day TrialFrom $199/mo · Basic/Elite 7-day trial · OCR + token detection included
