Feature Comparison
| Feature | WebSocket | Public SSE | Private SSE |
|---|---|---|---|
| Endpoint | wss://scrape.st/ws | GET /stream | GET /stream?token= |
| Authentication | x-api-key header | None | Token (24h, via /stream/token) |
| Direction | Bidirectional | Server → Client | Server → Client |
| Payload | Full SourceEvent | Truncated (100 chars) | Full SourceEvent |
| X enriched | ✅ | ❌ (fast-x only) | ✅ |
| Telegram / Discord | ✅ | ✅ | ✅ |
| Auto-reconnect | ❌ (implement yourself) | ✅ (built-in EventSource) | ✅ (built-in EventSource) |
| Buffer on reconnect | ❌ | ✅ Last 5 events | ✅ Last 5 events |
| Keepalive | Ping/Pong (30s interval) | : comment (15s interval) | : comment (15s interval) |
| Dead timeout | 60s | N/A | N/A |
| Best for | Production bots, trading | Demos, public dashboards | Production web apps |
When to Use What
WebSocket
Use when you need:
- Full payload for all sources
- Bidirectional communication
- Fine-grained connection control
- Server-side Node.js / Python apps
Public SSE
Use when you need:
- Quick prototype, zero setup
- No API key at hand
- Public monitoring dashboard
- Browser-only (no backend)
Private SSE
Use when you need:
- Full data in a browser app
- Automatic reconnection
- Token-based auth (no exposed API key)
- Frontend
EventSourcecompatibility
Latency
All methods deliver data within milliseconds of each other:| Method | Typical Latency (fast-x) | Typical Latency (enriched) |
|---|---|---|
| WebSocket | ~50ms | ~200-500ms |
| Public SSE | ~50ms | N/A (not streamed) |
| Private SSE | ~50ms | ~200-500ms |
Query Parameters (All Methods)
| Parameter | WebSocket | Public SSE | Private SSE | Description |
|---|---|---|---|---|
useFastX | ✅ | ✅ | ✅ | Receive fast-x push events |
ignoreFullPayload | ✅ | N/A | ✅ | Skip enriched X payloads |
token | N/A | N/A | ✅ | Authentication token |