General

Edit

Send OBS Request #

Allows you to request data from OBS websocket and save it in a variable.

The requested value will always be inside an object called responseData (for OBSws 5), but may be inside a second object. You can access it with object dot notation.
For example, if you want to retrieve the Brightness value from a Colour Correction filter, you will notice that it is inside an object called filterSettings. { "filterEnabled": true, "filterKind": "color_filter_v2", "filterSettings": { "brightness": 0.078 }, "filterIndex": 0.0 }. In this case, the Fetch Value will be responseData.filterSettings.brightness.

Use JSON string validator if you want to make sure your formatting is correct.
Be mindful of any trailing commas in your request that will cause OBS to disconnect, such as:

{
  "op": 6,
  "d": {
    "requestType": "GetVersion",  // this trailing commma must be removed
  }
}

Use the dropdown arrow next to the OBS Command (JSON) box to make use of the premade templates to assist you (OBSws 5 only).

Box Name Type Description
OBS Dropdown OBS to send this command to (if using multiple OBS connections).
OBS Command (JSON) JSON String JSON String to send to OBS Websocket. You can use the dropdown to select a JSON template for each request (OBSws 5 only).
Fetch Value String or object Name of a value you wish to get. Leave blank to fetch the whole object.
For values inside another object use object dot notation. For values inside an array use index position.
Save Variable As (optional) String Name of a variable to save the data under.

Send OBS Request Examples (OBSws 5)

What to retrieve OBS Command Fetch Value
current CPU usage {"op":6,"d":{
"requestType":"GetStats",
"requestData":{}
}}
responseData.cpuUsage
Time elapsed since streaming started {"op":6,"d":{
"requestType":"GetStreamStatus",
"requestData":{}
}}
responseData.outputTimecode
Scene Item ID of a source {"op":6,"d":{
"requestType":"GetSceneItemId",
"requestData":{"sceneName":"YOUR SCENE NAME","sourceName":"YOUR SOURCE NAME"}
}}
responseData.sceneItemId
Current width of a source {"op":6,"d":{
"requestType":"GetSceneItemTransform",
"requestData":{"sceneName":"YOUR SCENE NAME","sceneItemId":"YOUR SCENE ITEM ID"}
}}
responseData.sceneItemTransform.width
Current text in a GDI source {"op":6,"d":{
"requestType":"GetInputSettings",
"requestData":{"inputName":"YOUR SOURCE NAME"}
}}
responseData.inputSettings.text
Brightness value of a Colour Correction filter {"op":6,"d":{
"requestType":"GetSourceFilter",
"requestData":{"sourceName":"YOUR SOURCE NAME","filterName":"YOUR FILTER NAME"}
}}
responseData.filterSettings.brightness
First source name in a specified scene {"op":6,"d":{
"requestType":"GetSceneItemList",
"requestData":{"sceneName":"YOUR SCENE NAME"}
}}
responseData.sceneItems[0].sourceName


Edit

Event Pull #

Similar to ‘Trigger Pull Data’ command, but for OBS Websocket 5 Events.
This command will return a response from the OBS Event Trigger that was used.
More information about all possible OBS events can be found in Official OBS Websocket Documentation.

Box Name Type Description
Save Variable As String Variable name where the value will be saved to.
Pull Value Dropdown Select value from the dropdown list. Typing all will return the full response object.


Edit

Change Studio Mode #

Enables or disables studio mode in your OBS.

Box Name Type Description
OBS Dropdown OBS to send this command to (if using multiple OBS)
Enable Checkbox Checked = enable studio mode, unchecked = disable studio mode

OBS WebSocket 5 Request: SetStudioModeEnabled

Request Field Type Description
studioModeEnabled Boolean true to enable Studio Mode, false to disable it.


Edit

Trigger OBS Hotkey Name #

Activates any OBS hotkey without having to manually press it.
You can find the unique name of a hotkey in one of these two locations:

  1. For general hotkeys: basic.ini file in C:/Users/USERNAME/AppData/Roaming/obs-studio/basic/profiles/YOUR_CURRENT_PROFILE
  2. For source-specific hotkeys: YOURSCENENAME.JSON file in C:/Users/USERNAME/AppData/Roaming/obs-studio/basic/scenes
    Once you open the file, look for HOTKEYS under each source which should have all your unique hotkey names listed.

Box Name Type Description
OBS Dropdown OBS to send this command to (if using multiple OBS)
Hotkey Name String Unique name of the hotkey

OBS WebSocket 5 Request: TriggerHotkeyByName

Request Field Type Description
hotkeyName String The internal OBS hotkey name (e.g. libobs.mute).
contextName String (optional) The name of the input/scene context to trigger the hotkey for (required for source-specific hotkeys).


Edit

Trigger OBS Hotkey Sequence #

Executes hotkey routine.
Does not actually perform the key presses, it simply activates any hotkey action you’ve set.

Box Name Type Description
OBS Dropdown OBS to send this command to (if using multiple OBS)
Key ID String Main key ID. It must be the OBS name for it, such as OBS_KEY_A.
All OBS hotkeys can be found in OBS Studio’s documentation.
Ctrl Checkbox Whether to include Ctrl key
Alt Checkbox Whether to include Alt key
Shift Checkbox Whether to include Shift key

OBS WebSocket 5 Request: TriggerHotkeyByKeySequence

Request Field Type Description
keyId String OBS key identifier (e.g. OBS_KEY_A, OBS_KEY_F1). Full list at obs-hotkeys.h.
keyModifiers Object {"shift": false, "control": false, "alt": false, "command": false} — modifier key state.

Example: keyId = "OBS_KEY_F5" with keyModifiers = {"shift": true} triggers Shift+F5.


Edit

Control Virtual Camera #

Controls the OBS Virtual Camera — Start, Stop, or Toggle it using the dropdown.

Box Name Type Description
OBS Dropdown OBS to send this command to, if using multiple OBS connections.
Action Dropdown Whether to Start, Stop, or Toggle the Virtual Camera.

The OBS Virtual Camera creates a virtual webcam device that other applications (Zoom, Discord, Teams, etc.) can use as a camera input. It is included by default in OBS 26.1 and later — no additional plugin required.

OBS WebSocket 5 Request: StartVirtualCam / StopVirtualCam / ToggleVirtualCam

Action Request Sent
Start StartVirtualCam
Stop StopVirtualCam
Toggle ToggleVirtualCam

ToggleVirtualCam returns an outputActive boolean indicating whether the Virtual Camera is now active. Use Get Virtual Camera Status to check the current state before toggling.


Edit

Get Virtual Camera Status #

Gets the current active state of the OBS Virtual Camera and saves it as a boolean.

Box Name Type Description
OBS Dropdown OBS to send this command to, if using multiple OBS connections.
Save Variable As String Variable name to save the status.

Use this to check whether the Virtual Camera is currently running before toggling it, or to update a button’s appearance based on the camera state.

Saved Value:

Value Type Description
true Boolean Virtual Camera is currently active.
false Boolean Virtual Camera is stopped.
undefined Undefined Saved if OBS is not connected or ws5 is not in use.

OBS WebSocket 5 Request: GetVirtualCamStatus

No request fields.

Response Field Type Description
outputActive Boolean Whether the Virtual Camera is currently active. Saved directly to your variable.

Example SAMMI Response:

false


Edit

Get Stats #

Gets OBS performance statistics (CPU, memory, FPS, disk space, etc.) and saves them as an object.

Box Name Type Description
OBS Dropdown OBS to send this command to, if using multiple OBS connections.
Save Variable As String Variable name to save the stats object.

Use Object Get Variable to read individual fields from the returned object.

Saved Payload:

Variable Name Type Description
cpuUsage Number Current OBS CPU usage as a percentage (e.g. 2.5 = 2.5%).
memoryUsage Number Current OBS RAM usage in megabytes.
availableDiskSpace Number Available disk space on the recording drive in megabytes.
activeFps Number Current output framerate (e.g. 60.0).
averageFrameRenderTime Number Average time in milliseconds to render one frame.
renderSkippedFrames Number Number of frames skipped/lagged by the renderer.
renderTotalFrames Number Total frames rendered since OBS started.
outputSkippedFrames Number Number of frames skipped in the output (stream/recording).
outputTotalFrames Number Total frames sent to the output since OBS started.
webSocketSessionIncomingMessages Number Number of WebSocket messages received.
webSocketSessionOutgoingMessages Number Number of WebSocket messages sent.

OBS WebSocket 5 Request: GetStats

No request fields.

Example SAMMI Response Object:

{
  "cpuUsage": 2.5,
  "memoryUsage": 1024.5,
  "availableDiskSpace": 102400.0,
  "activeFps": 60.0,
  "averageFrameRenderTime": 5.2,
  "renderSkippedFrames": 0,
  "renderTotalFrames": 36000,
  "outputSkippedFrames": 0,
  "outputTotalFrames": 36000,
  "webSocketSessionIncomingMessages": 5,
  "webSocketSessionOutgoingMessages": 5
}


Edit

Event Subscription #

By default, all OBS events marked as ‘high volume’ are disabled. High volume events must be explicitly subscribed to. This command must be used each time you connect to OBS.

Box Name Type Description
Base Events Int Default base events to listen to using a bitmask. Best to not modify.
Volume Meters Checkbox A high-volume event providing volume levels of all active inputs every 50 milliseconds.
Active State Checkbox An input’s active state has changed. When an input is active, it means it’s being shown by the program feed.
State Changed Checkbox An input’s show state has changed. When an input is showing, it means it’s being shown by the preview or a dialog.
Transform Changed Checkbox The transform/crop of a scene item has changed. Enabled in SAMMI by default.

OBS WebSocket 5: Event Subscriptions (sent during Identify handshake, op code 1)

When SAMMI connects to OBS, it sends an Identify message with an eventSubscriptions bitmask. This command lets you enable additional high-volume subscriptions at runtime using a Reidentify request (op code 3).

Subscription Bitmask Value Description
InputVolumeMeters 65536 Volume levels of all active inputs, emitted every ~50ms.
InputActiveStateChanged 131072 Fires when an input becomes active (visible in the program output).
InputShowStateChanged 262144 Fires when an input becomes visible in preview or a dialog.
SceneItemTransformChanged 524288 Fires when a source’s transform or crop changes.

Use OBS Event Pull command in an OBS Trigger button to receive data from these events.