qbittorrent-api is a Python client library for interacting with the qBittorrent v4.1+ Web API. It provides a programmatic interface to manage torrents, retrieve application status, and control various aspects of the qBittorrent client. The library releases frequently, often mirroring updates in qBittorrent server versions or adding new API features, with the current version being 2025.11.1.
pip install qbittorrent-apiVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to connect to a qBittorrent instance using the client library, authenticate, and retrieve basic information like the application version and current transfer speeds. It uses environment variables for sensitive connection details.
Upgrade your Python environment to 3.9 or newer. Alternatively, pin the `qbittorrent-api` library to a version prior to `2024.11.69` if you must use Python 3.8.
Always check the official qBittorrent Web API documentation and the `qbittorrent-api` changelog for features introduced with specific qBittorrent server versions. Ensure your qBittorrent server is up-to-date for the desired functionality.
Verify that qBittorrent is running, its Web UI is enabled, and the host/port are correctly configured and accessible from where the Python script is executed. Double-check your username and password in the qBittorrent Web UI settings.
Change your import statement to `from qbittorrentapi import Client`.
Ensure the qBittorrent application is running, the Web UI is enabled in its settings, and the `host` and `port` parameters passed to `qbittorrentapi.Client` match your qBittorrent configuration and network accessibility.
Verify your qBittorrent Web UI username and password in qBittorrent's settings (Tools > Options > Web UI). Update the `username` and `password` parameters in your `qbittorrentapi.Client` constructor accordingly.