Skip to main content
Receive data from X, Telegram, and Discord the instant it’s captured — via WebSocket or SSE. All streams deliver the same SourceEvent payload used by webhooks.

WebSocket

Full-duplex, bidirectional — authenticate via x-api-key header. Supports ping/pong keepalive, fast-x mode, and payload filtering.

Server-Sent Events

Unidirectional, auto-reconnect — public stream (no auth, truncated) or private stream (token auth, full data).

At a Glance

FeatureWebSocketPublic SSEPrivate SSE
Endpointwss://scrape.st/wshttps://scrape.st/streamhttps://scrape.st/stream?token=
Authx-api-key headerNoneToken via /stream/token
PayloadFull SourceEventTruncated (first 100 chars)Full SourceEvent
DirectionBidirectionalServer → ClientServer → Client
ReconnectManual (implement yourself)Automatic (EventSource built-in)Automatic
SourcesX, Telegram, Discordfast-x, Telegram, Discordfast-x, Telegram, Discord

Stream Payload

All streams deliver the same SourceEvent shape — identical to what webhooks receive:
{
  "mid": "1886493083207827456",
  "sid": "44196397",
  "source": "x",
  "timestamp": 1712072400000,
  "payload": { ... }
}
See X, Telegram, or Discord for full payload examples per source.

Query Parameters

Both WebSocket and SSE support these query parameters:
ParameterTypeDescription
useFastXbooleanReceive fast-x push events immediately (before GraphQL enrichment)
ignoreFullPayloadbooleanSkip full enriched X payloads — only receive fast-x + other sources
fast-x delivers post data within ~50ms of posting, before the full GraphQL enrichment pass. The enriched x payload follows shortly after with complete metadata (engagement counts, media, entities).

Quick Start

1

WebSocket

Connect with your API key for full bidirectional streaming.
const ws = new WebSocket("wss://scrape.st/ws", {
  headers: { "x-api-key": "YOUR_API_KEY" },
});
ws.onmessage = (e) => console.log(JSON.parse(e.data));
2

Public SSE (no auth)

Open a stream instantly — no API key needed. Data is truncated.
const es = new EventSource("https://scrape.st/stream");
es.onmessage = (e) => console.log(JSON.parse(e.data));
3

Private SSE (full data)

Generate a token, then connect for full payloads.
# 1. Generate token
curl -X POST https://scrape.st/stream/token \
  -H "x-api-key: YOUR_API_KEY"

# 2. Connect with token
curl -N "https://scrape.st/stream?token=YOUR_TOKEN"