A Python client for Streamlabs Socket API
For an outline of past/future changes refer to: CHANGELOG
Requirements
-
A Streamlabs Socket API key.
- You can acquire this by logging into your Streamlabs.com dashboard then
Settings->Api Settings->API Tokens
- You can acquire this by logging into your Streamlabs.com dashboard then
-
Python 3.10 or greater
Install
pip install streamlabsio
Use
import streamlabsio
def on_streamlabs_event(event, data):
print(f'{event}: {data.attrs()}')
def on_twitch_event(event, data):
if event == 'follow':
print(f'{data.name} just followed!')
def main():
with streamlabsio.connect(token="<API token>") as client:
client.obs.on('streamlabs', on_streamlabs_event)
client.obs.on('twitch_account', on_twitch_event)
# run for 30 seconds then disconnect client from server
client.wait(30)
if __name__ == '__main__':
main()
Client class
streamlabsio.connect(*, token: str, raw: bool = False) -> Client
The following keyword arguments may be passed:
- token: Streamlabs SocketIO api token.
- raw: Receive raw data messages as json objects.
methods
wait(self, seconds: float | None = None) -> None
- float: Time in seconds to block the main thread
- If None, the method will block indefinitely.
Event Data Attributes
For event data you may inspect the available attributes using attrs().
example:
def on_twitch_event(event, data):
print(f'{event}: {data.attrs()}')
Errors
SteamlabsSIOError: Base StreamlabsSIO error classSteamlabsSIOConnectionError: Exception raised when connection errors occur
Logging
To view the logs emitted by the streamlabsio library simply add the following to your code:
from loguru import logger
logger.enable('streamlabsio')
Official Documentation
Metadata
Release files for streamlabsio 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| streamlabsio-2.0.0.tar.gz | 5.1 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| streamlabsio-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.7 kB
Release files / streamlabsio-2.0.0.tar.gz
| Download URL | streamlabsio-2.0.0.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
92041acf4d1863db3a2439b02f61625e8c80fc55b416a36a21a7fc16d0f8e847
|
|
BLAKE2b-256 checksum How to use checksums |
d505f45b50586fb04bb3491583dc04a79e77b090fec152c4f3edf5c7c11f6323
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.
Transparency logRelease files / streamlabsio-2.0.0-py3-none-any.whl
| Download URL | streamlabsio-2.0.0-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ff952e7e9e4e7a90f87fc15bf7eef27c59bc68e87bb0de6f14d2910e1869be5b
|
|
BLAKE2b-256 checksum How to use checksums |
b276246ed370a55838110cd12e69161c3af39f84cf8c75740ba9778e6e7b3d27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.
Transparency logSecurity for streamlabsio 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for streamlabsio-2.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.