Complete Guide

TikTok LIVE API

The complete developer guide to TikTok LIVE API. Real-time WebSocket access to chat messages, virtual gifts, viewer counts, battles, and engagement data. Node.js, Python, and raw WebSocket — free tier available.

tiktok.com/@
Stream offlineEnter a live TikTok username above
Connecting to @ live
Offline
Live Stream Monitor
@
<50msLatency
99.9%Uptime
FreeTo Test

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:

1

Your App Connects

Your app opens a WebSocket to wss://api.tik.tools with a TikTok username and your API key.

2

TikTool Resolves

TikTool resolves the room ID, handles authentication, bypasses CAPTCHAs, and joins the live stream.

3

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-api

Connect 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-api

Connect 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_KEY

Every 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:

chat

Chat message from a viewer. Includes user info, comment text, emotes, and badges.

gift

Virtual gift sent by a viewer. Includes gift name, diamond value, repeat count, and combo status.

like

A viewer liked the stream. Includes per-event count and total likes.

member

A viewer joined the live room. Fires when users enter the stream.

follow

A viewer followed the streamer during the live stream.

share

A viewer shared the live stream with their friends.

subscribe

A viewer subscribed to the streamer.

roomUserSeq

Viewer count update. Current viewer count and top viewers list.

battle

Battle/LinkMic event. Battle status, teams, scores, and participants.

battleArmies

Battle armies update with team scores and participant rankings.

roomPin

A chat message was pinned or starred by the streamer.

caption

AI-powered live caption. Real-time speech-to-text with translation support.

envelope

Treasure chest or envelope event in the stream.

emote

Custom emote sent in chat by a viewer.

liveIntro

Stream intro update — title and description changes.

streamEnd

The live stream has ended. Includes the reason code.

connected

Successfully connected to the TikTok live stream.

error

Connection 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.

See more use cases →

TikTok LIVE API Comparison

How does TikTool compare to other TikTok LIVE API solutions?

FeatureTikToolTikTokLive (Python)tiktok-live-connectorEuler Stream
Stability✓ 99.9% uptime✗ Breaks on updates✗ Unmaintained✓ Managed
Node.js SDK✓ Official✓ (outdated)
Python SDK✓ Official
AI Live Captions✓ Speech-to-text
Free Tier✓ Free forever✓ Free (unstable)✓ Free (broken)✗ Paid only
WebSocket API✓ Any languagePython onlyNode.js only
CAPTCHA Handling✓ Built-in✗ Manual✗ Manual

See the full comparison →

Pricing & Free Tier

Start building with the TikTok LIVE API for free. No credit card required.

TierWebSocketRESTPrice
Sandbox1 connection50/dayFree forever
Basic10 connections10,000/day$7/week
Pro50 connections75,000/day$15/week
Ultra200 connections300,000/day$45/week

Frequently Asked Questions

Does TikTok have an official LIVE API?

Is the TikTok LIVE API free?

What programming languages does the TikTok LIVE API support?

How is TikTool different from TikTokLive or tiktok-live-connector?

What data can I get from TikTok LIVE streams?

What is the latency?

Can I build a TikTok LIVE chat bot?

How many streams can I monitor simultaneously?