POST /webcast/fetch
Fetch live stream events via HTTP long-polling. Returns the same real-time data as WebSocket (chat, gifts, likes, battles) but over HTTP. Uses TikTok’s binary protobuf protocol and returns decoded events.
How it works: The API signs and fetches TikTok’s internal polling endpoint, decodes the protobuf response, and returns structured event data. Pass a cursor from the previous response for continuous polling.
Identification: Provide either unique_id (username) or room_id. If using unique_id, the server resolves the room ID automatically.
WebSocket vs Fetch: WebSocket connections are preferred for real-time use — they deliver events instantly with lower latency. Use /webcast/fetch when WebSocket is not possible (serverless environments, HTTP-only infrastructure) or for one-off data snapshots.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
unique_id | string | No | TikTok username |
room_id | string | No | Room ID (alternative to unique_id) |
cursor | string | No | Pagination cursor from previous response |