Troubleshooting
Locate a failure by stage: installation, room resolution, WebSocket handshake, event handling or an optional HTTP request.
Installation
Use the runtime version and installation method in the relevant library guide. The JavaScript guide requires Node.js 22.19 or newer; the Java guide requires Java 25 or newer.
The PowerShell guide imports the module from its public Git repository. It does not require a PowerShell Gallery package. The C# and Java guides also provide source-based setup instructions.
The account does not resolve to a live room
Check that the username is correct and that the account is currently live. A missing user, an offline host and an API parameter error are different outcomes. Consult API Live User Room for the observed response codes.
Do not treat every room-like ID as proof that the account is live. The room-state fields must also indicate a live room.
The handshake is rejected
| Signal | Meaning | Check |
|---|---|---|
named cookie not present |
The required cookie is missing. | Check the ttwid acquisition and request cookie header. |
DEVICE_BLOCKED |
The WebSocket server rejected the device cookie. | Observe the client's reconnect handling and renewed credentials. |
illegal app_id |
The expected application ID is absent or invalid. | Compare the request to the documented WebSocket parameters. |
illegal secret key |
Required direct-connection parameters may be missing. | Check ws_direct=1 and sup_ws_ds_opt=1. |
HTTP 403 or 429 |
The request is blocked or rate-limited. | Inspect the response and retry policy; avoid an immediate tight retry loop. |
See the WebSocket endpoint for the complete observed contract.
Connected, but no events appear
- Register handlers before connecting.
- Use the event names and payload field names from your library's guide.
- Keep the process and event loop alive. A polling client needs continued polling.
- Check the room's activity and lifecycle events, including disconnection and reconnect attempts.
For JavaScript, connect() completes after a successful handshake. For Python and C#, the corresponding awaited session method normally stays active until the session ends. Do not use the same startup assumption for every language.
HTTP 200 with no usable JSON
Some TikTok web endpoints can return HTTP 200 with an empty body. That is not a successful JSON response. Signed requests can still depend on browser state and transport context; see browser-bound signing.
Metadata needs a session
- Age-restricted room metadata can require session cookies.
- The full audience roster requires login.
- Viewer counts and top-viewer information from LIVE events are a separate data source.
Pass credentials to the particular optional request that needs them. The anonymous event connection does not require a signing-service API key.
Gift or like totals look duplicated
Gift streak messages can report cumulative counts. Summing every received total can overcount. Use a gift-streak helper where available, and distinguish the final streak event from intermediate updates.
Like counters can also move backward or repeat between updates. A library's accumulation helper can provide a monotonic application total; keep that total distinct from the original server value.
A proxy works in one language but not another
Proxy support is library-specific. Java, Elixir, PowerShell and Shell document HTTP CONNECT support rather than SOCKS support. Check the exact language guide before reusing a proxy configuration across runtimes.