Skip to main content

ArrAPI

GitHub release (latest by date) Build Testing GitHub commits since latest release (by date) for a branch PyPI Downloads

Wiki Discord Reddit GitHub Sponsors Sponsor or Donate

Overview

Unofficial Python bindings for the Sonarr and Radarr APIs. The goal is to make interaction with the API as easy as possible while emulating the Web Client as much as possible

Installation & Documentation

pip install arrapi

Documentation can be found at Read the Docs.

Connecting to Sonarr

Getting a SonarrAPI Instance

To connect to a Sonarr application you have to use the SonarrAPI object and provide it with the baseurl and apikey parameters.

The apikey can be found by going to Settings > General > Security > API Key

from arrapi import SonarrAPI

baseurl = "http://192.168.1.12:8989"
apikey = "0010843563404748808d3fc9c562c05e"

sonarr = SonarrAPI(baseurl, apikey)

Using the SonarrAPI Instance

Once you have a SonarrAPI instance you can use it to interact with the application.

To add, edit, or delete a singular Series you must first find the Series object.

Find a Series Object

There are three ways to find a Series object.

You can get a Series object using get_series and giving it a Sonarr Series ID or TVDb ID.

series = sonarr.get_series(tvdb_id=121361)

You can get a List of Series objects using search_series and giving it a search term.

search = sonarr.search_series("Game of Thrones")

You can get a List of all Series objects in Sonarr using all_series.

all_series = sonarr.all_series()

Using a Series Object

To add a series to Sonarr use add.

series.add("/shows/", "HD-1080p", "English")

To edit a series in Sonarr use edit.

series.edit(tags=["hd"])

To delete a series in Sonarr use delete.

series.delete()

Perform Operations on Multiple Series

To add multiple Series to Sonarr use add_multiple_series with the Series’ TVDb IDs.

series_ids = [83268, 283468, 385376]
added, exists, invalid = sonarr.add_multiple_series(series_ids, "/shows/", "HD-1080p", "English")

To edit multiple Series in Sonarr use edit_multiple_series with the Series’ TVDb IDs.

series_ids = [83268, 283468, 385376]
edited, not_exist = sonarr.edit_multiple_series(series_ids, monitor=False)

To delete multiple Series in Sonarr use delete_multiple_series with the Series’ TVDb IDs.

series_ids = [83268, 283468, 385376]
not_exist = sonarr.delete_multiple_series(series_ids)

Respect Sonarr List Exclusions

To respect Sonarr’s List Exclusions, before running add or add_multiple_series you can use sonarr_exclusions like so.

series_ids = [83268, 283468, 385376]
sonarr.respect_list_exclusions_when_adding()
added, exists, invalid = sonarr.add_multiple_series(series_ids, "/shows/", "HD-1080p", "English")

Connecting to Radarr

Getting a RadarrAPI Instance

To connect to a Radarr application you have to use the RadarrAPI object and provide it with the baseurl and apikey parameters.

The apikey can be found by going to Settings > General > Security > API Key

from arrapi import RadarrAPI

baseurl = "http://192.168.1.12:8989"
apikey = "0010843563404748808d3fc9c562c05e"

radarr = RadarrAPI(baseurl, apikey)

Using the RadarrAPI Instance

Once you have a RadarrAPI instance you can use it to interact with the application.

To add, edit, or delete a singular Movie you must first find the Movie object.

Find a Movie Object

There are three ways to find a Movie object.

You can get a Movie object using get_movie and giving it a Radarr Movie ID or TVDb ID.

movie = radarr.get_movie(tmdb_id=121361)

You can get a List of Movie objects using search_movies and giving it a search term.

search = radarr.search_movies("The Lord of the Rings: The Return of the King")

You can get a List of all Movie objects in Radarr using all_movies.

all_movies = radarr.all_movies()

Using a Movie Object

To add a movie to Radarr use add.

movie.add("/movies/", "HD-1080p")

To edit a movie in Radarr use edit.

movie.edit(tags=["hd"])

To delete a movie in Radarr use delete.

movie.delete()

Perform Operations on Multiple Movie

To add multiple Movies to Radarr use add_multiple_movies with the Movie’s TMDb IDs.

movie_ids = [11, 1891, 1892, 1893, 1894, 1895]
added, exists, invalid = radarr.add_multiple_movies(movie_ids, "/movies/", "HD-1080p")

To edit multiple Movies in Radarr use edit_multiple_movies with the Movie’s TMDb IDs.

movie_ids = [11, 1891, 1892, 1893, 1894, 1895]
edited, not_exist = radarr.edit_multiple_movies(movie_ids, monitor=False)

To delete multiple Movies in Radarr use delete_multiple_movies with the Movie’s TMDb IDs.

movie_ids = [11, 1891, 1892, 1893, 1894, 1895]
not_exist = radarr.delete_multiple_movies(movie_ids)

Respect Radarr List Exclusions

To respect Radarr’s List Exclusions, before running add or add_multiple_movies you can use radarr_exclusions like so.

movie_ids = [11, 1891, 1892, 1893, 1894, 1895]
radarr.respect_list_exclusions_when_adding()
added, exists, invalid = radarr.add_multiple_movies(movie_ids, "/movies/", "HD-1080p")

Usage Examples

Example 1: List all series in Sonarr.

series = sonarr.all_series()
for show in series:
    print(show.title)

Example 2: Search for a movie and add it to Radarr by name.

search = radarr.search_movies("The Lord of the Rings: The Return of the King")
if search:
    search[0].add("/movies/", "HD-1080p")

Example 3: Make every series in Sonarr Unmonitored.

edited, not_exist = sonarr.edit_multiple_series(sonarr.all_series(), monitor=False)

Example 4: Get all Quality Profiles Available.

for qp in sonarr.quality_profile():
    print(qp.name)

Metadata

Release files for arrapi 1.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for arrapi 1.5.1
File Size Uploaded
arrapi-1.5.1.tar.gz 32.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for arrapi 1.5.1
File Interpreter ABI Platform
arrapi-1.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 66.5 kB

Release files / arrapi-1.5.1.tar.gz

Download URL arrapi-1.5.1.tar.gz
Size 32.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0e21e96a943f61bda28ab66e6a5c11fd9ca0802bb7af1fe8782d705db018402a
BLAKE2b-256 checksum
How to use checksums
bfb517593a81a631992e144ff38229385ada999a25f290757d681a0eb3cef6db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / arrapi-1.5.1-py3-none-any.whl

Download URL arrapi-1.5.1-py3-none-any.whl
Size 33.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3abc265492e4e8909d66a9cf7c359224224146438df443f0c4114fd7fc4d29fb
BLAKE2b-256 checksum
How to use checksums
f5360ea46e501ae861b94e01b0d78a5cad36e98493598e78457622d22f787780
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release history Release notifications | RSS feed

This release

1.5.1 This release

2 release files

1.4.14

2 release files

1.4.13

2 release files

1.4.12

2 release files

1.4.11

2 release files

1.4.10

2 release files

1.4.9

2 release files

1.4.8

2 release files

1.4.7

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.1.0

1 release file

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page