Python torrent
Need help with python-qBittorrent?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.


Python wrapper for qBittorrent Web API (for versions above v3.1.x)

150 Stars 28 Forks MIT License 69 Commits 14 Opened issues

Services available

Need anything else?



.. image:: :target: :alt: Documentation Status

.. image:: :target:

Python wrapper for qBittorrent Web API (for versions above 4.1, for version below and above v3.1.x please use 0.3.1 version).

For qBittorrent clients with earlier versions, use mookfist's


This wrapper is based on the methods described in

qBittorrent's Official Web API Documentation 

Some methods are only supported in qBittorent's latest version (v3.3.1 when writing).

It'll be best if you upgrade your client to a latest version.


The best way is to install a stable release from PyPI::

$ pip install python-qbittorrent

You can also stay on the bleeding edge of the package::

$ git clone
$ cd python-qBittorrent
$ python install


qBittorent webUI must be enabled before using this API client.

How to enable the qBittorrent Web UI 

Quick usage guide

.. code-block:: python

from qbittorrent import Client

qb = Client('')

qb.login('admin', 'your-secret-password')

not required when 'Bypass from localhost' setting is active.

defaults to admin:admin.

to use defaults, just do qb.login()

torrents = qb.torrents()

for torrent in torrents: print torrent['name']

If you have enabled SSL and are using a self-signed certificate, you'd probably want to disable SSL verification. This can be done by passing

while initializing the

.. code-block:: python

from qbittorrent import Client

qb = Client('', verify=False)

API methods

Getting torrents

  • Get all



  • Filter torrents::

    qb.torrents(filter='downloading', category='my category')

    This will return all torrents which are currently

    downloading and are labeled as
    my category

    qb.torrents(filter='paused', sort='ratio')

    This will return all paused torrents sorted by their Leech:Seed ratio.

Refer qBittorents WEB API documentation for all possible filters.

Downloading torrents

  • Download torrents by link::

    magnetlink = "magnet:?xt=urn:btih:e334ab9ddd91c10938a7....." qb.downloadfromlink(magnetlink)

    No matter the link is correct or not,

    method will always return empty JSON object.

  • Download multipe torrents by list of links::

    linklist = [link1, link2, link3] qb.downloadfromlink(linklist)

  • Downloading torrents by file::

    torrentfile = open('my-torrent-file.torrent', 'rb') qb.downloadfromfile(torrentfile)

  • Downloading multiple torrents by using files::

    torrentfilelist = [open('1.torrent', 'rb'), open('2.torrent', 'rb')] qb.downloadfromfile(torrentfilelist)

  • Specifing save path for downloads::

    dlpath = '/home/user/Downloads/special-dir/' qb.downloadfromfile(myfile, savepath=dlpath)

    same for links.

    qb.downloadfromlink(mymagneturi, savepath=dl_path)

  • Applying labels to downloads::

    qb.downloadfromfile(myfile, label='secret-files ;) ')

    same for links.

    qb.downloadfromlink(mymagneturi, category='anime')

Pause / Resume torrents

  • Pausing/ Resuming all torrents::

    qb.pauseall() qb.resumeall()

  • Pausing/ Resuming a speicific torrent::

    infohash = 'e334ab9ddd....infohash....5d7fff526cb4' qb.pause(infohash) qb.resume(info_hash)

  • Pausing/ Resuming multiple torrents::

    infohashlist = ['e334ab9ddd9......infohash......fff526cb4', 'c9dc36f46d9......infohash......90ebebc46', '4c859243615......infohash......8b1f20108']

    qb.pausemultiple(infohashlist) qb.resumemultipe(infohashlist)

Full API method documentation

All API methods of qBittorrent are mentioned @

Read the docs 



  • Vikas Yadav (v1k45) 


By chronological order

  • Matt Smith (psykzz) 
  • Nicolas Wright (dozedoff) 
  • sbivol 
  • Christophe Ha (Shaance) 
  • Your name here :)


  • Write tests

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.