TikTok-is-Live is an unofficial TikTok API that allows you to check if a TikTok user is live and retrieve live stream and user details.
- NPM
npm install tiktok-is-live
import TikTok from "tiktok-is-live";
const username = 'USERNAME';
TikTok.getUser(username)
.then(result => {
console.log('User data: ', result);
})
ApiResponse
{
isLive: boolean
data: {
user: {
avatarLarger: string | URL
avatarMedium: string | URL
avatarThumb: string | URL
id: string
nickname: string
secUid: string
secret: boolean
uniqueId: string
verified: boolean
roomId: string
signature: string
status: number
followStatus: number
}
stats: {
followingCount: number
followerCount: number
}
liveRoom: {
coverUrl: string | URL
title: string
startTime: number
status: number
paidEvent: {
event_id: number
paid_type: number
}
liveSubOnly: number
liveRoomMode: number
hashTagId: number
gameTagId: number
liveRoomStats: {
userCount: number
}
streamData: {
pull_data: {
options: {
default_quality: {
icon_type: number
level: number
name: string
resolution: string
sdk_key: string
v_codec: string
}
qualities: {
icon_type: number
level: number
name: string
resolution: string
sdk_key: string
v_codec: string
}[]
show_quality_button: boolean
}
stream_data: string
}
}
streamId: string
multiStreamScene: number
multiStreamSource: number
hevcStreamData: {
pull_data: {
options: {
default_quality: {
icon_type: number
level: number
name: string
resolution: string
sdk_key: string
v_codec: string
}
qualities: {
icon_type: number
level: number
name: string
resolution: string
sdk_key: string
v_codec: string
}[]
show_quality_button: boolean
}
stream_data: string
}
}
}
}
message: string
extra: {
id: string
}
statusCode: number
}