What the TikTok LIVE API gives you
TikTok LIVE is where creators stream, sell and get paid in gifts, and almost none of it is available through an official API. TikTok’s public developer APIs cover logging in, posting and research access; they do not let you read another creator’s LIVE room, its chat or its gifts. Developers who build LIVE overlays, gift alerts, analytics or LIVE shopping trackers use unofficial APIs instead.
Tikultra’s LIVE API reads LIVE the way the TikTok app does. You can find rooms, check who is live, read room details, pull the chat and event stream, list the gift catalog with coin prices, rank the audience, get the video stream URLs for recording, and list the products in a LIVE shopping bag. With a managed account you can also go LIVE yourself and moderate the chat.
Every LIVE endpoint
| What you get | Endpoint | Cost per call | Plan |
|---|---|---|---|
| Whether rooms are live right now | /v1/live/check-alive | 1 req | Every plan |
| Room details by room ID, @username or link | /v1/live/room | 2 reqs | Every plan |
| Chat, gifts, likes, joins and room events | /v1/live/chat | 2 reqs | Every plan |
| Room details and latest chat in one call | /v1/live/with-chat | 2 reqs | Every plan |
| FLV, HLS and CMAF stream URLs | /v1/live/stream | 2 reqs | Every plan |
| Gift catalog with coin prices | /v1/live/gifts | 2 reqs | Every plan |
| Online audience ranking | /v1/live/audience | 2 reqs | Every plan |
| Daily and hourly creator ranking | /v1/live/ranking | 2 reqs | Every plan |
| Rooms the LIVE feed recommends | /v1/live/recommended | 2 reqs | Every plan |
| Products in the LIVE shopping bag | /v1/live/bag-items | 2 reqs | Every plan |
| Search LIVE rooms by keyword | /v1/search?type=live | 1 req | Every plan |
How TikTok LIVE works
A few facts about LIVE make the rest of this guide easier to follow.
- Every broadcast is a new room. When a creator goes LIVE, TikTok creates a room with a 19-digit
room_id. When they end the stream the room is finished, and the next LIVE gets a new ID. Store the creator’s username orsec_uid, not the room ID. - Chat is a stream of events. The app receives LIVE activity as a series of typed messages: chat comments (
WebcastChatMessage), gifts (WebcastGiftMessage), likes, viewers joining, follows and shares, and room updates. The app either holds a WebSocket open or fetches new events every second or so with a cursor. - Gifts are priced in coins. Viewers buy coins and spend them on gifts. Each gift in a room’s catalog has a fixed coin price, which TikTok calls
diamond_count. Creators earn from the gifts they receive. - Streams are plain video. The LIVE video itself is served over FLV and HLS at several qualities, so any video tool can play or record it once you have a current URL.
Build a LIVE tracker step by step
- 1Find rooms
Look up a creator’s current room with
/v1/live/room?username=…, search LIVE by keyword with/v1/search?type=live, or take rooms from/v1/live/recommended. - 2Check who is live
For room IDs you already have,
/v1/live/check-aliveanswers for many rooms in one call. For creators, ask for their room by username: offline hosts return 404 and cost nothing. - 3Read the room
/v1/live/roomreturns the title, topic, host and room stats such as likes and comments. - 4Poll the chat
Call
/v1/live/chatwith the cursor from the last call, about once a second. Each call returns only new events. - 5Add gifts, audience and video
Price gifts with
/v1/live/gifts, rank top viewers with/v1/live/audience, and record with the URLs from/v1/live/stream.
Step 1: find a LIVE room
GET /v1/live/room · 2 reqs per call| Parameter | Type | Required | What it does |
|---|---|---|---|
room_id | string | one of these | The numeric LIVE room ID. e.g. 7708619922263280397 |
username | string | one of these | The host's @username. |
url | string | one of these | A LIVE link. |
from tikultra import TikUltra, NotFoundError
client = TikUltra()
try:
r = client.live.room(username="some_creator")
room_id = r["room_id"]
print("LIVE now:", r["room"]["title"], room_id)
except NotFoundError:
print("not live right now") # 404 room_not_found, not billed{
"context_id": "ctx_7227caf24b51a4128aaf",
"room_id": "7708619922263280397",
"room": {
"title": "Rain and Thunder",
"hashtag": {
"title": "Gaming",
"id": 5,
"image": {
"avg_color": "#A3A3CC",
"height": 0,
"image_type": 0,
"is_animated": false,
"open_web_url": "",
"uri": "webcast-sg/5Gaming.png",
"url_list": [
"https://p16-webcast.tiktokcdn.com/img/alisg/webcast-sg/5Gaming.png~tplv-obj.image"
],
"width": 0
},
"namespace": 0
},
"stats": {
"comment_count": 0,
"deprecated1": 0,
"deprecated2": "",
"digg_count": 0,
"enter_count": 89514,
…
}Step 2: know when creators go live
A go-live alert is the most requested LIVE feature: a Discord ping, an email or a dashboard row the moment a creator starts streaming. Because each broadcast gets a new room, the reliable check is by username. Run it every few minutes for the creators you follow:
import time
from tikultra import TikUltra, NotFoundError
client = TikUltra()
creators = ["creator_one", "creator_two", "creator_three"]
live_now = {}
while True:
for u in creators:
try:
r = client.live.room(username=u)
if u not in live_now:
live_now[u] = r["room_id"]
notify(f"@{u} is LIVE: {r['room']['title']}")
except NotFoundError:
live_now.pop(u, None) # offline: free
time.sleep(300)Offline checks are free, so you only pay while someone is live. Twenty creators checked every five minutes, each live about an hour a day, is roughly 480 requests a day, $0.44 on Growth. If you already hold room IDs, /v1/live/check-alive checks many rooms at once and is available on every plan.
Step 3: read the chat in real time
/v1/live/chat returns the events since the cursor you pass, plus a new cursor and a fetch_interval in milliseconds, which is how long TikTok suggests waiting before the next fetch. Chat comments come decoded with the text and the sender. Gifts, likes, joins and other events come with their event type and TikTok’s raw protobuf payload, which you can keep as-is or decode with the open Webcast message definitions.
import time
cursor, seen = None, set()
while True:
page = client.live.chat(room_id, cursor=cursor)
chat = page["chat"]
for m in chat["messages"]:
if m["msg_id"] in seen:
continue
seen.add(m["msg_id"])
if m["method"] == "WebcastChatMessage":
print(f'{m["user"]["nickname"]}: {m["content"]}')
elif m["method"] == "WebcastGiftMessage":
on_gift(m["payload"]) # raw event, decode if you need the sender and gift id
cursor = chat["cursor"]
time.sleep(max(chat.get("fetch_interval", 1000), 1000) / 1000){
"context_id": "ctx_c7e76567dd50fb8b108a",
"room_id": "7708619922263280397",
"chat": {
"cursor": "1794817461926_7708682297284804643_1_1_1794817420940_0",
"status_code": 0,
"fetch_interval": 1000,
"fetch_type": 1,
"internal_ext": "fetch_time:1794817461926|start_time:1794817434208|ack_ids:,,7708682176405375752_1a50,7708682194616648734_1a58,7708682165898300173_1a64,7708682246808158750_1a70,7708682237252274974_1a7e,770868225179790...",
"messages": [
{
"method": "WebcastRoomMessage",
"msg_id": "1794817461912729954",
"payload": "CioKDVN5c3RlbU1lc3NhZ2UQnZ/qr46fnvQYGI2Wgviin6H9aiCYndSbnjQSnAFXZWxjb21lIHRvIFRpa1RvayBMSVZFISBIYXZlIGZ1biBpbnRlcmFjdGluZyB3aXRoIG90aGVycyBpbiByZWFsIHRpbWUuIENyZWF0b3JzIG11c3QgYmUgMTggb3Igb2xkZXIgdG8g..."
},
{
"method": "WebcastLiveIntroMessage",
"msg_id": "7667769638348163853",
"payload": "CiMKF1dlYmNhc3RMaXZlSW50cm9NZXNzYWdlEI2WksrE+9i0ahCNlpLKxPvYtGoYASJGRXZlcnkgbmlnaHQgZnJvbSAxMVBNLTVBTSBFU1QgLSBMZXQncyB0ZWxsIGVhY2ggb3RoZXIgZ29vZG5pZ2h0ICNOQ1JQICqKCAiqiJqato/yzGUaB1NoZWxsaWVKogcKnwJo..."
}
],
"now": 1794817461926
}
}Step 4: gifts, top viewers and rankings
/v1/live/gifts returns every gift available in the room with its coin price (diamond_count) and its name, so you can turn gift events into coin totals for a leaderboard or an alert like “Moon Serenade, 400 coins”. /v1/live/audience returns the room’s online audience count and the ranked list of top viewers, which TikTok orders by gifting. /v1/live/ranking returns the creator’s position in the daily and hourly LIVE rankings.
{
"context_id": "ctx_ed3d642a9dd015c6bb36",
"room_id": "7708619922263280397",
"gifts": [
{
"batch_gift_info": {
"available_counts": [
5
],
"can_batch_send": true
},
"biz_extra": {},
"can_put_in_gift_box": false,
"color_infos": [],
"combo": true,
"describe": "sent Keyboard Tune",
"diamond_count": 199,
"disable_gallery_banner": false,
"duration": 1000,
"expiration_timestamp": 0
},
{
…
}Step 5: record or restream the video
/v1/live/stream returns the current stream URLs as lists under flv, hls and cmaf. Hand one to ffmpeg to save the stream to a file. The URLs are signed and expire, so if the recording drops, ask for fresh URLs and continue into a new file.
URL=$(curl -s "https://api.tikultra.com/v1/live/stream?room_id=$ROOM" \
-H "x-api-key: $TIKULTRA_KEY" | jq -r '.stream_urls.hls[0]')
ffmpeg -i "$URL" -c copy "live_${ROOM}_$(date +%s).mp4"Only record and republish streams you have the right to: your own, your clients’, or with the creator’s permission.
Log a stream for analytics
TikTok’s own LIVE analytics only exist for your own account. For any public stream, you can build a similar picture by sampling the room once a minute and storing every chat line. Afterwards you can chart viewers across the stream, find the minute chat peaked, and see which moments made people talk.
import sqlite3, time
from tikultra import TikUltra, NotFoundError
client = TikUltra()
db = sqlite3.connect("live.db")
db.execute("create table if not exists tick (room text, ts int, viewers int)")
db.execute("create table if not exists chat (room text, msg_id text primary key, ts int, user text, text text)")
cursor, last_tick = None, 0
while True:
try:
if time.time() - last_tick >= 60: # one audience sample a minute
aud = client.live.audience(room_id)
db.execute("insert into tick values (?, ?, ?)", (room_id, int(time.time()), aud["total"]))
last_tick = time.time()
page = client.live.chat(room_id, cursor=cursor)["chat"]
except NotFoundError:
break # the stream ended
for m in page["messages"]:
if m["method"] == "WebcastChatMessage":
db.execute("insert or ignore into chat values (?, ?, ?, ?, ?)",
(room_id, m["msg_id"], int(time.time()), m["user"]["nickname"], m["content"]))
db.commit()
cursor = page["cursor"]
time.sleep(2)| Metric | How to get it from the log |
|---|---|
| Peak and average viewers | max and avg of viewers in tick |
| Chat activity | Count chat rows per minute; the peak minute is the stream’s best moment |
| Most active viewers | Group chat by user and order by count |
| What people asked | Filter chat.text for question marks or words like “price” and “link” |
| Stream length | The first and last ts in tick |
LIVE shopping
Many LIVEs are sales events. /v1/live/bag-items returns every product pinned in a room’s shopping bag, with prices, discounts and stock, which is how sellers and agencies watch competitors’ LIVE promotions as they happen. It costs 2 reqs and is on Every plan. The TikTok Shop scraper guide covers the product side in depth.
Go LIVE on your own account
Reading LIVE is half of it. With a connected managed account, POST /v1/account/live/start creates a LIVE room on your account and returns its RTMP URL and stream key for OBS or ffmpeg. While you are live, /v1/account/live/moderate posts and pins comments and mutes viewers, and /v1/account/live/finish ends the stream. The stream key guide walks through it.
What people build with it
| Project | Endpoints | How it works |
|---|---|---|
| Chat overlay for OBS | room, chat | Poll chat, push new comments to a browser source over a WebSocket |
| Gift alerts and text-to-speech | chat, gifts | Match gift events to the gift catalog, play a sound or read the sender’s message |
| Go-live notifications | room by username | Check followed creators every few minutes, post to Discord or Telegram |
| LIVE analytics | room, audience, ranking, chat | Log viewers, comments per minute and gifts over time, chart each stream |
| Chat giveaways | chat | Collect everyone who typed a keyword, pick a random winner on stream |
| LIVE shopping monitor | bag-items, room | Snapshot competitors’ LIVE bags and prices while they stream |
| Stream archive | stream | Record your own or your clients’ LIVEs automatically for clipping |
| Chat moderation bot | chat, account/live/moderate | Read chat, remove spam and links on your own LIVE |
Polling vs WebSocket libraries
The best-known open-source tools, TikTokLive for Python and TikTok-Live-Connector for Node.js, connect to TikTok’s LIVE WebSocket and decode every event as it arrives. They are excellent for hobby projects. The catch is the connection itself: opening it needs a signed URL, so both libraries rely on a third-party signing server with its own rate limits and paid tiers, and they break for a while whenever TikTok changes the protocol.
| Tikultra LIVE API | Open-source WebSocket libraries | |
|---|---|---|
| Delivery | Fetch with a cursor, about once a second | Push over a WebSocket |
| Latency | About 1 to 2 seconds | Under a second |
| Signing and devices | Handled for you | Third-party signing server |
| Room details, gifts, audience, stream URLs, LIVE bag | Yes, as REST endpoints | Partly, varies by library |
| Many rooms at once | Yes, one cursor per room | One connection per room |
| Going LIVE and moderating your own room | Yes, with managed accounts | No |
| Billing | Per call, failed calls free | Signing server plan, plus your servers |
What LIVE data costs
LIVE calls cost 2 reqs each. Polling one room’s chat every 2 seconds for an hour is 1,800 calls, 3,600 requests, about $3.27 on Growth. A gift catalog or room lookup at the start of a stream adds a few requests.
| Plan | Monthly price | Requests included | Per 1,000 calls | Rate limit |
|---|---|---|---|---|
| Starter | $49 | 40,000 | $2.45 | 20 req/s |
| Growth | $159 | 175,000 | $1.82 | 75 req/s |
| Scale | $499 | 750,000 | $1.33 | 250 req/s |
Errors
The LIVE-specific case is 404 room_not_found: the host is offline, the stream ended, or the room ID is wrong. It is never billed. Retry 429, 502 and 504 with a short backoff.
| Status | Code | Meaning | Retry? |
|---|---|---|---|
| 400 | invalid_request | A parameter is missing or malformed. | No. Fix the request. |
| 401 | unauthorized | The key is missing, wrong or revoked. | No. |
| 402 | out_of_credits | Your balance can’t cover this call. | After a top-up. |
| 403 | forbidden | Your plan doesn’t include this endpoint. | No. Upgrade. |
| 404 | not_found | The video, profile or product doesn’t exist or isn’t visible. | No. |
| 409 | session_expired | A connected account needs to sign in again. | After re-connecting. |
| 429 | rate_limited | Over your plan’s requests per second. | Yes, after retry-after. |
| 502 | upstream_error | TikTok returned an error after our retries. | Yes, with backoff. |
| 504 | upstream_timeout | TikTok didn’t answer in time. | Yes, with backoff. |
TikTok LIVE API options compared
| Capability | Tikultra | TikAPI | EnsembleData | ScrapeCreators |
|---|---|---|---|---|
| Host & interact in LIVE | RTMP start, moderate, co-host, battle | Read chat only | — | — |
| Failed or empty upstream calls | Never billed (0 reqs / $0) | — | Free | — |
| Free to start | 500 requests · 180 req/min (no card) | 5-day trial | 50 units / day | 100 requests |
Prices checked 19 Nov 2026 on each vendor’s public pricing page; capabilities from their public API docs. A dash means the vendor’s public docs don’t list it (checked 19 Nov 2026). Full comparison
TikAPI reads LIVE chat through a web session; EnsembleData, ScrapeCreators and Apify do not list LIVE chat in their public docs. Streamer tools such as TikFinity are finished apps for creators rather than APIs you build on.