What Is the TikTok LIVE API?
The TikTok LIVE API allows developers to connect to any TikTok live stream and receive real-time data — chat messages, virtual gifts, viewer counts, likes, follows, shares, battles, and more. Unlike web scraping or reverse-engineering TikTok's internal protocols, a managed TikTok LIVE API provides a stable, production-ready connection that doesn't break when TikTok updates their platform.
TikTool provides the most reliable TikTok LIVE API available. It offers 99.9% uptime, sub-50ms latency, official SDKs for Node.js and Python, and a raw WebSocket endpoint that works with any programming language. Get started for free — no credit card required.
How It Works
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, bypasses CAPTCHAs, 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. No protobuf, no binary parsing, no custom protocol. 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 Bots
Build automated chat bots 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.
TikTok LIVE API Comparison
How does TikTool compare to other TikTok LIVE API solutions?
Pricing & Free Tier
Start building with the TikTok LIVE API for free. No credit card required.