How Sonarr and Radarr Integrate with Torrent Clients

Automated media managers like Sonarr and Radarr integrate seamlessly with torrent downloaders by utilizing Application Programming Interfaces (APIs) to automate the entire media acquisition pipeline. By linking these platforms, users eliminate the manual work of finding releases, adding torrent files to a client, monitoring completion, and renaming or moving files to a designated media server directory. This article explains the technical workflow of how these managers communicate with torrent clients, track download states, and handle post-processing.

API Connection and Authentication

Integration begins at the configuration level where the media manager establishes communication with the torrent client’s WebUI or API. In the settings for Sonarr or Radarr, users add a “Download Client” by specifying:

The Search and Dispatch Workflow

When Sonarr or Radarr detects that a requested episode or movie is missing or meets an upgrade condition, it queries configured indexers. Once the best release is selected according to user-defined quality profiles, the media manager pushes the release directly to the download client via an API call.

The payload sent to the client includes either the .torrent file or a magnet link, along with instructions to apply the designated category/tag and save path.

Real-Time Monitoring and Polling

After dispatching the download, the media manager actively tracks its state through scheduled polling intervals:

  1. Status Tracking: The manager queries the torrent client’s API to check download speed, progress percentage, ETA, and client health.
  2. Activity Queue: The user interface reflects the active download in an “Activity” queue, matching the unique torrent hash provided by the client.
  3. Failure Handling: If a download stalls, fails to connect to peers, or reports corrupted data, the media manager can automatically remove the torrent, blacklist that specific release, and search for an alternative.

Post-Processing, Renaming, and Organizing

When the torrent client signals that the download reaches 100% completion, the automated manager begins post-processing:

Seeding Management and Cleanup

The integration also respects seeding rules defined in either the torrent client or the media manager. Once a torrent satisfies its configured seed ratio or time limit, Sonarr or Radarr can send an API command to remove the torrent from the client, with an option to delete the original downloaded payload if a hardlink or copy was successfully created.