Quick Reference


First make sure you’re using WebUI and WebAPI plugin is active under “Preferences -> Plugins”.


  1. WebAPI exists alongside with Deluge built-in JSON API, so all HTTP requests should proceed to
http://localhost:8112/json (or what ever you’ve got instead of localhost)
  1. Use POST method for HTTP requests.

  2. Make requests with valid JSON (including Accept: application/json and Content-Type: application/json HTTP headers).

  3. JSON must include the following fields:

    id - message number for identity (could be any, increment it freely)

    method - API method name. E.g.: auth.login, webapi.get_torrents

    params - API method parameters (depend on method)

  4. Login beforehand.

    • Send {"id": 1, "method": "auth.login", "params": ["your_password_here"]} and receive cookies with auth information.
    • Use those cookies for every request.
  5. API answers with an error with the following JSON:

    {"error": {"message": "Some error description."}, "id": 1, "result": False}

    Check responses for error field.

  6. Make sure Deluge WebUI is connected to Deluge daemon that makes actual torrent processing.

    • Send {"id": 1, "method": "auth.check_session", "params": []} and verify no error.
  7. WebAPI method names start with webapi.. (E.g.: webapi.add_torrent to call add_torrent function).

  8. See https://github.com/idlesign/deluge-webapi/blob/master/webapi/test.py for code sample. Run it for basic debug.


If you have problems with plugin activation, you can get log with useful information (look for string containing webapi).

For deluged:

$ deluged -d -L info

For deluged-web:

$ deluge-web -L info

You can run https://github.com/idlesign/deluge-webapi/blob/master/webapi/test.py for basic test.

API Methods


WebAPI uses torrent hashes to identify torrents, so torrent ID is the same as hash.

Get torrents info

get_torrents(ids=None, params=None)

Returns information about all or a definite torrent. Returned information can be filtered by supplying wanted parameter names.

Add torrent

add_torrent(metainfo, options=None)

Adds a torrent with the given options. metainfo could either be base64 torrent data or a magnet link.

Remove torrent

remove_torrent(torrent_id, remove_data=False)

Removes a given torrent. Optionally can remove data.

Get API version


Returns WebAPI plugin version.