Skip to main content

Calling APIs

This was an example of a call requested from the LSIO discord to add a tag on completion of a torrent. This is a working example of authenticating to the API and then calling it to add the "done" tag.

curl -i -XPOST http://localhost:8080/api/v2/torrents/addTags \
  --data 'hashes=%I&tags=done' \
  --cookie \
    $(curl -i \
        --header 'Referer: http://localhost:8080' \
        --data 'username=admin&password=<YOURPASSWORDHERE>' \
        http://localhost:8080/api/v2/auth/login | grep set-cookie | tr ";" " " | awk '{print $2}')

 

https://github.com/qbittorrent/qBittorrent/wiki/External-programs:-How-to https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#authentication https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#add-torrent-tags