Skip to main content

Event Types

Every WebSocket message contains an event field and a data object. Below is the complete list of events.

chat

A viewer sends a chat message.
{
  "event": "chat",
  "data": {
    "type": "chat",
    "comment": "Hello streamer!",
    "user": {
      "uniqueId": "viewer123",
      "nickname": "Cool Viewer",
      "userId": "6892636847263982593",
      "profilePictureUrl": "https://...",
      "followRole": 0,
      "userBadges": [],
      "isModerator": false,
      "isSubscriber": false
    },
    "emotes": []
  }
}
FieldTypeDescription
commentstringThe chat message text
userobjectSender’s profile info
user.uniqueIdstringTikTok username
user.nicknamestringDisplay name
user.userIdstringNumeric user ID
user.isModeratorbooleanWhether user is a moderator
user.isSubscriberbooleanWhether user is a subscriber
emotesarrayCustom emotes used in the message

gift

A viewer sends a virtual gift.
{
  "event": "gift",
  "data": {
    "type": "gift",
    "giftName": "Rose",
    "giftId": 5655,
    "diamondCount": 1,
    "repeatCount": 5,
    "repeatEnd": true,
    "giftType": 1,
    "giftPictureUrl": "https://...",
    "user": {
      "uniqueId": "gifter",
      "nickname": "Gift Sender",
      "userId": "123456"
    }
  }
}
FieldTypeDescription
giftNamestringName of the gift
giftIdnumberGift identifier
diamondCountnumberDiamond value of the gift
repeatCountnumberHow many times this gift was sent in a streak
repeatEndbooleantrue when the gift streak ends (final count)
giftTypenumber1 = repeatable, 2 = non-repeatable
giftPictureUrlstringURL of the gift image
For streak gifts (giftType: 1), wait for repeatEnd: true to get the final count. Intermediate events show the running count.

like

A viewer sends likes.
{
  "event": "like",
  "data": {
    "type": "like",
    "likeCount": 15,
    "totalLikeCount": 5678,
    "user": { "uniqueId": "liker", "nickname": "Like Fan" }
  }
}
FieldTypeDescription
likeCountnumberLikes sent in this batch
totalLikeCountnumberTotal likes in the stream

member

A viewer joins the live stream.
{
  "event": "member",
  "data": {
    "type": "member",
    "user": { "uniqueId": "new_viewer", "nickname": "New Viewer" },
    "actionId": 1
  }
}

follow

A viewer follows the streamer.
{
  "event": "follow",
  "data": {
    "type": "follow",
    "user": { "uniqueId": "new_follower", "nickname": "New Follower" }
  }
}

share

A viewer shares the live stream.
{
  "event": "share",
  "data": {
    "type": "share",
    "user": { "uniqueId": "sharer", "nickname": "Share User" }
  }
}

roomUserSeq

Periodic viewer count update.
{
  "event": "roomUserSeq",
  "data": {
    "type": "roomUserSeq",
    "viewerCount": 1234,
    "topViewers": [
      { "user": { "uniqueId": "top1" }, "coinCount": 500 }
    ]
  }
}
FieldTypeDescription
viewerCountnumberCurrent viewer count
topViewersarrayTop gifters with coin counts

subscribe

A viewer subscribes to the streamer.
{
  "event": "subscribe",
  "data": {
    "type": "subscribe",
    "user": { "uniqueId": "subscriber", "nickname": "Subscriber" }
  }
}

linkMicBattle

Battle status update — when two streamers enter a live battle.
{
  "event": "linkMicBattle",
  "data": {
    "type": "linkMicBattle",
    "battleUsers": [
      { "uniqueId": "streamer1", "score": 150 },
      { "uniqueId": "streamer2", "score": 120 }
    ],
    "battleStatus": 1
  }
}
FieldTypeDescription
battleUsersarrayBattling streamers with scores
battleStatusnumber1 = started, 2 = in progress, 3 = ended

roomPin

A message is pinned in the live room.
{
  "event": "roomPin",
  "data": {
    "type": "roomPin",
    "pinnedMessage": "Welcome to the stream!",
    "user": { "uniqueId": "streamer" }
  }
}

emote

An animated emote is sent.
{
  "event": "emote",
  "data": {
    "type": "emote",
    "emoteId": "7012345",
    "emoteUrl": "https://...",
    "user": { "uniqueId": "emoter" }
  }
}

envelope

A treasure box / envelope event.
{
  "event": "envelope",
  "data": {
    "type": "envelope",
    "coins": 100,
    "canOpen": 5,
    "timestamp": 1234567890
  }
}

questionNew

A Q&A question is submitted.
{
  "event": "questionNew",
  "data": {
    "type": "questionNew",
    "questionText": "When did you start streaming?",
    "user": { "uniqueId": "curious_viewer" }
  }
}

roomInfo

Initial room metadata sent immediately after connecting.
{
  "event": "roomInfo",
  "roomId": "71234567890",
  "uniqueId": "streamer",
  "roomInfo": {
    "title": "Stream Title",
    "user_count": 1234,
    "like_count": 5678,
    "owner": { "nickname": "Streamer Name", "uniqueId": "streamer" }
  }
}

User Object

Most events include a user object with this structure:
{
  "uniqueId": "username",
  "nickname": "Display Name",
  "userId": "6892636847263982593",
  "profilePictureUrl": "https://...",
  "followRole": 0,
  "userBadges": [],
  "isModerator": false,
  "isSubscriber": false,
  "isNewGifter": false,
  "topGifterRank": null
}
FieldTypeDescription
uniqueIdstringTikTok username
nicknamestringDisplay name
userIdstringNumeric user ID
profilePictureUrlstringAvatar URL
followRolenumber0 = not following, 1 = following, 2 = friend
isModeratorbooleanWhether user is a room moderator
isSubscriberbooleanWhether user is a subscriber
topGifterRanknumber|nullRank in top gifter leaderboard