Twitter WebSocket API Quickstart
Connect to TweetStream's real-time Twitter streaming API alternative in minutes
Getting Started
Most clients authenticate via WebSocket subprotocols by including the API key in the protocol list. If your environment cannot set that token, Bearer auth headers and apiKey query parameters are also accepted.
Stream tweet, account, and control events 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 family: tweet, account, or controlop- Operation such as content, meta, update, profile_update, follow, or twitter_handles_resultts- 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 7-Day TrialFrom $199/mo · Basic/Elite 7-day trial · OCR + token detection included
