Twitter WebSocket API Quickstart
Connect to TweetStream's real-time Twitter streaming API alternative in minutes
Getting Started
Authenticate via WebSocket subprotocols—include your API key in the protocol list when opening the connection. No HTTP headers or query strings required.
Stream tweets in real time via WebSocket. Evaluating Twitter API alternatives? Start here.
Connection Details
| Endpoint | wss://ws.tweetstream.io/ws |
| Protocol 1 | tweetstream.v1 |
| Protocol 2 | tweetstream.auth.token.YOUR_API_KEY |
Quick Start Example
Copy and paste this code to get connected immediately:
Production Example
For production use, add reconnection handling:
Envelope Format
All messages use a consistent envelope structure:
v- Protocol version (always 1)t- Message type: tweet or controlop- Operation: content, meta, updatets- Unix timestamp in millisecondsd- Payload data (varies by type and operation)
Common Issues
- Authentication failed: Verify your API key is from an active subscription
- Connection limit reached: Close existing connections or upgrade your plan
- No tweets appearing: Check that accounts are tracked in your dashboard
Start real-time Twitter WebSocket alerts today
WebSocket delivery, OCR, and token detection—no infrastructure to build.
Start 1-Day TrialFrom $199/mo · 1-day trial included · OCR + token detection included