How to Change OBS Scenes Remotely with HTTP Requests

This article explains how to remotely trigger scene changes in OBS Studio using standard HTTP requests. Since OBS Studio natively communicates via WebSockets, you will learn how to set up a lightweight HTTP-to-WebSocket bridge, configure OBS, and send GET or POST requests from any network-enabled device—such as a stream deck, phone, or smart home controller—to switch your scenes instantly.


Step 1: Enable OBS WebSocket Server

OBS Studio (version 28 and above) includes a built-in WebSocket server. Before sending HTTP requests, you must enable this server.

  1. Open OBS Studio.
  2. Navigate to Tools in the top menu and select WebSocket Server Settings.
  3. Check the box to Enable WebSocket server.
  4. Note the Server Port (the default is 4455).
  5. Check Enable Authentication and set a secure Server Password. Click Apply and OK.

Step 2: Set Up an HTTP-to-WebSocket Bridge

Because OBS accepts WebSockets rather than direct HTTP requests, you need a lightweight translator. The easiest way to achieve this is by using a pre-built tool like obs-websocket-http or running a simple local Python script.

Here is a simple Python script that acts as an HTTP server on your local network, listens for HTTP GET requests, and forwards them to your OBS WebSocket server.

The Python Bridge Script:

  1. Install the required library in your command line:

    pip install obs-websocket-py
  2. Save the following code as obs_bridge.py:

from http.server import BaseHTTPRequestHandler, HTTPServer
import urllib.parse
from obswebsocket import obsws, requests

# OBS WebSocket Configuration
OBS_HOST = "localhost"
OBS_PORT = 4455
OBS_PASSWORD = "your_obs_password_here"  # Replace with your OBS password

class OBSHTTPRequestHandler(BaseHTTPRequestHandler):
    def do_GET(self):
        # Parse the URL query parameters
        parsed_path = urllib.parse.urlparse(self.path)
        query_params = urllib.parse.parse_qs(parsed_path.query)
        
        # Check for the "scene" parameter in the URL
        if "scene" in query_params:
            scene_name = query_params["scene"][0]
            try:
                # Connect to OBS WebSocket
                ws = obsws(OBS_HOST, OBS_PORT, OBS_PASSWORD)
                ws.connect()
                # Send the scene change request
                ws.call(requests.SetCurrentProgramScene(sceneName=scene_name))
                ws.disconnect()
                
                # Send HTTP Success Response
                self.send_response(200)
                self.end_headers()
                self.wfile.write(f"Success: Changed scene to {scene_name}".encode())
                return
            except Exception as e:
                self.send_response(500)
                self.end_headers()
                self.wfile.write(f"Error: {str(e)}".encode())
                return
                
        self.send_response(400)
        self.end_headers()
        self.wfile.write(b"Missing 'scene' parameter.")

def run(server_class=HTTPServer, handler_class=OBSHTTPRequestHandler, port=8000):
    server_address = ('', port)
    httpd = server_class(server_address, handler_class)
    print(f"HTTP Bridge running on port {port}...")
    httpd.serve_forever()

if __name__ == "__main__":
    run()
  1. Run the script:

    python obs_bridge.py

Step 3: Send the HTTP Request to Change Scenes

With the Python bridge running, you can now change OBS scenes by sending a standard HTTP GET request from any web browser, terminal, DIY hardware (like an ESP32), or automation tool on the same network.

Option A: Using a Web Browser

Open your web browser and type the following URL (replace localhost with the IP address of the computer running OBS if triggering from another device on your network):

http://localhost:8000/?scene=YourSceneName

(Replace YourSceneName with the exact, case-sensitive name of the scene in OBS.)

Option B: Using cURL (Command Line)

Open your terminal and run:

curl "http://localhost:8000/?scene=YourSceneName"

Option C: Integrating with Stream Decks or Smart Home Hubs

Most smart home controllers (like Home Assistant) or network-enabled macros allow you to configure “Webhooks” or “HTTP Requests.” Set the target URL to your bridge’s IP address and port, select the GET method, and append the target scene name as the parameter.