What Is the TikTok LIVE API?
TikTok does not offer a public API for live stream data like chat, gifts, or viewer counts. The TikTok Business API only covers ads and shop analytics. To access real-time LIVE data, developers use third-party APIs.
The open-source libraries tiktok-live-connector (Node.js) and TikTokLive (Python) are MIT-licensed and free to use. They delegate TikTok signing to a backend - the default is Euler Stream, the paid signing service built by the same team that maintains those libraries. Euler Stream has its own free tier and paid plans for higher volumes.
TikTool is an independent alternative with its own signing infrastructure. It's a fully managed API where signature generation, CAPTCHA solving, and Public Broadcast Telemetry rotation are all included. One WebSocket connection delivers 18+ event types - chat, gifts, likes, follows, viewers, battles, and more. Official SDKs for Node.js and Python. Free Community tier, no credit card required.
How Does the TikTok LIVE API Work?
TikTool sits between your application and TikTok's live streaming infrastructure. Here's the architecture:
Your App Connects
Your app opens a WebSocket to wss://api.tik.tools with a TikTok username and your API key.
TikTool Resolves
TikTool resolves the room ID, handles authentication, solves challenges, and joins the live stream.
Events Flow
Real-time events (chat, gifts, viewers, etc.) stream to your app as clean JSON - parsed, structured, and typed.
You never deal with TikTok's protocol directly. When TikTok changes their internal systems (which happens frequently), TikTool adapts - your code keeps working unchanged.
Quick Start - Node.js / TypeScript
Install the official SDK from npm:
npm install tiktok-live-apiConnect to a live stream and receive events:
import { TikTokLive } from 'tiktok-live-api';
const client = new TikTokLive('streamer_username', {
apiKey: 'YOUR_API_KEY' // Get free key → https://tik.tools
});
client.on('chat', (event) => {
console.log(`${event.user.uniqueId}: ${event.comment}`);
});
client.on('gift', (event) => {
console.log(`🎁 ${event.user.uniqueId} sent ${event.giftName} (${event.diamondCount} 💎)`);
});
client.on('roomUserSeq', (event) => {
console.log(`👀 ${event.viewerCount} viewers watching`);
});
client.connect();Full TypeScript support - every event type, field, and parameter is fully typed with autocompletion in your IDE. Read the complete Node.js guide →
Quick Start - Python
Install from PyPI:
pip install tiktok-live-apiConnect and receive events:
import asyncio, websockets, json
async def connect():
uri = "wss://api.tik.tools?uniqueId=streamer_username&apiKey=YOUR_API_KEY"
async with websockets.connect(uri) as ws:
async for message in ws:
event = json.loads(message)
if event["event"] == "chat":
user = event["data"]["user"]["uniqueId"]
comment = event["data"]["comment"]
print(f"{user}: {comment}")
elif event["event"] == "gift":
user = event["data"]["user"]["uniqueId"]
gift = event["data"]["giftName"]
print(f"🎁 {user} sent {gift}")
asyncio.run(connect())Read the complete Python guide →
Quick Start - Raw WebSocket (Any Language)
Any language with WebSocket support works - Go, Rust, Java, C#, Ruby, PHP, Dart, Kotlin, Swift. Just connect to:
wss://api.tik.tools?uniqueId=TIKTOK_USERNAME&apiKey=YOUR_API_KEYEvery message is a JSON object with event and data fields. Clean, structured data - no binary parsing needed. Full WebSocket API reference →
All Event Types
The TikTok LIVE API streams 18+ real-time events from any live stream:
chatChat message from a viewer. Includes user info, comment text, emotes, and badges.
giftVirtual gift sent by a viewer. Includes gift name, diamond value, repeat count, and combo status.
likeA viewer liked the stream. Includes per-event count and total likes.
memberA viewer joined the live room. Fires when users enter the stream.
followA viewer followed the streamer during the live stream.
shareA viewer shared the live stream with their friends.
subscribeA viewer subscribed to the streamer.
roomUserSeqViewer count update. Current viewer count and top viewers list.
battleBattle/LinkMic event. Battle status, teams, scores, and participants.
battleArmiesBattle armies update with team scores and participant rankings.
roomPinA chat message was pinned or starred by the streamer.
captionAI-powered live caption. Real-time speech-to-text with translation support.
envelopeTreasure chest or envelope event in the stream.
emoteCustom emote sent in chat by a viewer.
liveIntroStream intro update - title and description changes.
streamEndThe live stream has ended. Includes the reason code.
connectedSuccessfully connected to the TikTok live stream.
errorConnection error occurred. Includes error details.
See full event reference with example payloads →
What Can You Build?
Chat Assistants
Build automated chat assistants that respond to viewer messages, commands, and gifts in real-time.
Analytics
Track viewer counts, engagement rates, gift revenue, and chat activity across streams.
Interactive Games
Let viewers control game elements with gifts, chat commands, and likes.
Stream Overlays
Create OBS/Streamlabs overlays showing chat, gift alerts, and viewer stats.
Live Captions
AI-powered speech-to-text transcription and real-time translation in 50+ languages.
Mobile Apps
Build mobile apps that monitor and interact with TikTok LIVE streams.
TikTool vs Euler Stream vs tiktok-live-connector
The open-source tiktok-live-connector (Node.js) and TikTokLive (Python) libraries are maintained by the same team that runs Euler Stream. Together they form a well-supported ecosystem with MIT-licensed clients and a managed signing backend. TikTool is an independent managed alternative with its own signing infrastructure and a different feature focus.
eulerstreamPricing & Free Tier
Start building with the TikTok LIVE API for free. No credit card required.