obs-websocket-py
Python library to communicate with an obs-websocket server.
What it is and what it does
obs-websocket-py is a Python client library that communicates with OBS Studio's obs-websocket server over WebSocket, allowing you to send commands and receive events from OBS remotely. It supports both the modern v5 protocol (default port 4455) and the legacy v4 protocol (default port 4444). You instantiate a client with a host, port, and optional password, call connect(), then use the call() method to send requests and receive responses, or register callback functions to listen for OBS events.
The package depends only on websocket-client for the underlying WebSocket communication. It's designed for developers who want to automate OBS—controlling scenes, sources, recordings, and streaming—from Python scripts or applications. The library handles connection lifecycle, authentication, and event dispatch, with support for both synchronous request-response calls and asynchronous event callbacks.
Use it for:
- Automate OBS scene switching and source control from a Python application or bot.
- Build a custom control panel or dashboard that monitors and manages OBS streaming state.
- Create event-driven workflows that trigger actions in other tools when OBS events occur.
- Integrate OBS control into a larger broadcast or recording automation system.
- Write integration tests or monitoring scripts that verify OBS configuration and state.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Connects Python applications to OBS Studio via the obs-websocket protocol, enabling remote control of OBS through method calls and event callbacks.
Yes, if you need to control OBS Studio from Python. The package is stable (v1.0, MIT licensed, no known vulnerabilities) and has low install friction. However, maintenance is dormant—the last release was 2023-02-20—so if OBS Studio introduces breaking protocol changes, you may need to fork or wait for community updates. For active OBS automation projects, this is a solid choice; for long-term production systems, monitor the repository for compatibility.
Install
obs-websocket-py on PyPI
pip
pip install obs-websocket-pyuv
uv add obs-websocket-pypoetry
poetry add obs-websocket-pyInstalling obs-websocket-py
Before you install
Low friction install with a single runtime dependency (websocket-client). Maintenance is dormant—last release was 2023-02-20, but the repository remains active with a commit on 2024-08-09, suggesting occasional updates without formal releases.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute this package freely with minimal restrictions, provided you retain the license notice.
Quickstart
pip install obs-websocket-py
from obswebsocket import obsws, requests
client = obsws("localhost", 4455, "secret")
client.connect()
version = client.call(requests.GetVersion()).getObsVersion()
client.disconnect()
Requires a running OBS Studio instance with obs-websocket server enabled on the specified host and port (default 4455 for v5 API, 4444 for legacy v4 API).
Verify before relying
- Whether the package supports OBS Studio versions released after 2023-02-20 without manual updates.
- Compatibility with Python 3.11+ (classifiers list only up to 3.10).
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — websocket-client |
| Maintenance | dormant — 1,271 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 98,351/month — #13,090 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: obs_websocket_py-1.0-py3-none-any.whl
Keywords: obs, obs-studio, websocket
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
websocket-clientwebsocket-client provides a Python WebSocket…
permissive · top 1,000 on PyPI
observableObservable provides a lightweight event system…
permissive · top 15,000 on PyPI
esdk-obs-pythonPython SDK for interacting with Huawei OBS…
permissive · top 15,000 on PyPI
ws4pyws4py implements the WebSocket protocol (RFC…
permissive · top 15,000 on PyPI
PysherPysher is a Python client library for consuming…
permissive · top 5,000 on PyPI
sonos-websocketAsync Python library for communicating with…
permissive · top 15,000 on PyPI
python-engineioPython implementation of the Engine.IO realtime…
permissive · top 1,000 on PyPI
signalrcoreA Python client library for connecting to…
unclear · top 15,000 on PyPI
TikTokLiveConnect to TikTok livestreams and receive…
permissive · top 15,000 on PyPI
kanboardA Python client library that wraps the Kanboard…
permissive · top 15,000 on PyPI