WebSocket Requests

Reference of all requests that can be made to the Streamer.bot WebSocket Server

Check out the Streamer.bot Client library if you are using JavaScript or TypeScript!

Requests can be made to the server in stringified JSON format.

Requests and responses follow the following base schema:

{
  "request": "<request>",
  "id": "<id>"
}
id can be any string value you want, and can be used to identify request/response pairs.

Subscribe to a set of events from the connected Streamer.bot instance.

Events are not sent unless a subscription is requested
  • If you are using the @streamerbot/client library, subscriptions are automatically added when using the .on() event handler
  • If you are interacting directly with the WebSocket Server, you must send a Subscribe request
{
  "request": "Subscribe",
  "id": "<id>",
  "events": {
    "<event category>": ["<event name>", "<event name>", "..."]
  }
}

Unsubscribe from any events you are currently subscribed to.

{
  "request": "UnSubscribe",
  "id": "<id>",
  "events": {
    "<event category>": ["<event name>", "<event name>", "..."]
  }
}

Fetch a list of all events that can be subscribed to on the connected Streamer.bot instance.

{
  "request": "GetEvents",
  "id": "<id>"
}

Fetch a list of all actions in the connected Streamer.bot instance.

{
  "request": "GetActions",
  "id": "<id>"
}

Execute an action on the connected Streamer.bot instance.

{
  "request": "DoAction",
  "action": {
    "id": "<guid>",
    "name": "<name>"
  },
  "args": {
    "key": "value"
  },
  "id": "<id>"
}
{
  "request": "DoAction",
  "id": "sb:client:req:1753224740175-3103164791"
  "action": {
    "name": "example action"
  },
  "args": {
    "stringArg": "abcdef",
    "numArg": 1234
  },
}

Fetch information about the connected broadcaster account(s)

{
  "request": "GetBroadcaster",
  "id": "<id>"
}

Fetch the current credits system data.

{
  "request": "GetCredits",
  "id": "<id>"
}

Fill credits system with test data for testing.

{
  "request": "TestCredits",
  "id": "<id>"
}

Reset the current credits system data.

{
  "request": "ClearCredits",
  "id": "<id>"
}

Fetch information about the connected Streamer.bot instance.

{
  "request": "GetInfo",
  "id": "<id>"
}

Fetch a list of all active viewers for connected broadcaster accounts.

{
  "request": "GetActiveViewers",
  "id": "<id>"
}

Returns the list of code triggers available to be invoked by ExecuteCodeTrigger.

{
  "request": "GetCodeTriggers",
  "id": "<id>"
}

Triggers a code trigger, causing any associated actions to be executed.

{
  "request": "ExecuteCodeTrigger",
  "id": "<id>",
  "triggerName": "<triggerName>",
  "args": {
    "key": "value"
  }
}

Returns the list of defined commands.

{
  "request": "GetCommands",
  "id": "<id>"
}

Fetches a list of emotes for Twitch.

{
  "request": "TwitchGetEmotes",
  "id": "<id>"
}

Fetches a list of emotes for YouTube.

{
  "request": "YouTubeGetEmotes",
  "id": "<id>"
}

Returns all the global variables, either persisted or temporary.

{
  "request": "GetGlobals",
  "id": "<id>",
  "persisted": <bool>
}

Gets a single persisted or temporary global variable. Returns an error if the variable doesn't exist.

{
  "request": "GetGlobal",
  "id": "<id>",
  "variable": "<name>",
  "persisted": <bool>,
}

Fetches the values of a given user variable across all Twitch users.

{
  "request": "TwitchGetUserGlobals",
  "id": "<id>",
  "variable": "<name>",
  "persisted": <bool>,
}

Gets either a single user variable for a given user, or all variables for that user.

{
  "request": "TwitchGetUserGlobal",
  "id": "<id>",
  "userId": "<userId>",
  "persisted": <bool>,
  }
{
  "request": "TwitchGetUserGlobal",
  "id": "my-subscribe-id",
  "userId": "136079477",
  "variable": "tuna",
  "persisted": true
}

Sends a message to the broadcaster's chat.

Authentication Required
{
  "request": "SendMessage",
  "id": "<id>",
  "platform": "twitch | kick | youtube",
  "bot": "true/false",
  "internal": "true/false",
  "message": "<message>"
}

Fetches the pronouns for a given user.

{
  "request": "GetUserPronouns",
  "id": "<id>",
  "platform": "twitch",
  "userLogin": "<login>"
}