Skip to content

Clients

AniList

AniList(api_url: str = 'https://graphql.anilist.co', retries: PositiveInt = 5, **kwargs: Any)

AniList API client.

Parameters:

Name Type Description Default
api_url str

The URL of the AniList API. Default is https://graphql.anilist.co.

'https://graphql.anilist.co'
retries PositiveInt

Number of times to retry a failed request before raising an error. Default is 5. Set this to 1 to disable retrying.

5
kwargs Any

Keyword arguments to pass to the underlying httpx.Client used to make the POST request.

{}
Source code in src/pyanilist/_clients/_sync.py
@validate_call
def __init__(self, api_url: str = "https://graphql.anilist.co", retries: PositiveInt = 5, **kwargs: Any) -> None:
    """
    AniList API client.

    Parameters
    ----------
    api_url : str, optional
        The URL of the AniList API. Default is `https://graphql.anilist.co`.
    retries : PositiveInt, optional
        Number of times to retry a failed request before raising an error. Default is 5.
        Set this to 1 to disable retrying.
    kwargs : Any, optional
        Keyword arguments to pass to the underlying [`httpx.Client`](https://www.python-httpx.org/api/#client)
        used to make the POST request.
    """
    self.api_url = api_url
    self.retries = retries
    self.kwargs = kwargs

get

get(search: str | None = None, *, id: int | None = None, id_mal: int | None = None, start_date: FuzzyDateInt | None = None, end_date: FuzzyDateInt | None = None, season: MediaSeason | None = None, season_year: int | None = None, type: MediaType | None = None, format: MediaFormat | None = None, status: MediaStatus | None = None, episodes: int | None = None, chapters: int | None = None, duration: int | None = None, volumes: int | None = None, is_adult: bool | None = None, genre: str | None = None, tag: str | None = None, minimum_tag_rank: int | None = None, tag_category: str | None = None, licensed_by: str | None = None, licensed_by_id: int | None = None, average_score: int | None = None, popularity: int | None = None, source: MediaSource | None = None, country_of_origin: str | None = None, is_licensed: bool | None = None, id_not: int | None = None, id_in: CollectionOf[int] | None = None, id_not_in: CollectionOf[int] | None = None, id_mal_not: int | None = None, id_mal_in: CollectionOf[int] | None = None, id_mal_not_in: CollectionOf[int] | None = None, start_date_greater: FuzzyDateInt | None = None, start_date_lesser: FuzzyDateInt | None = None, start_date_like: str | None = None, end_date_greater: FuzzyDateInt | None = None, end_date_lesser: FuzzyDateInt | None = None, end_date_like: str | None = None, format_in: CollectionOf[MediaFormat] | None = None, format_not: MediaFormat | None = None, format_not_in: CollectionOf[MediaFormat] | None = None, status_in: CollectionOf[MediaStatus] | None = None, status_not: MediaStatus | None = None, status_not_in: CollectionOf[MediaStatus] | None = None, episodes_greater: int | None = None, episodes_lesser: int | None = None, duration_greater: int | None = None, duration_lesser: int | None = None, chapters_greater: int | None = None, chapters_lesser: int | None = None, volumes_greater: int | None = None, volumes_lesser: int | None = None, genre_in: CollectionOf[str] | None = None, genre_not_in: CollectionOf[str] | None = None, tag_in: CollectionOf[str] | None = None, tag_not_in: CollectionOf[str] | None = None, tag_category_in: CollectionOf[str] | None = None, tag_category_not_in: CollectionOf[str] | None = None, licensed_by_in: CollectionOf[str] | None = None, licensed_by_id_in: CollectionOf[int] | None = None, average_score_not: int | None = None, average_score_greater: int | None = None, average_score_lesser: int | None = None, popularity_not: int | None = None, popularity_greater: int | None = None, popularity_lesser: int | None = None, source_in: CollectionOf[MediaSource] | None = None, sort: CollectionOf[MediaSort] | None = None) -> Media

Search for media on AniList based on the provided parameters.

Parameters:

Name Type Description Default
search str

Filter by search query

None
id int

Filter by the media id

None
id_mal int

Filter by the media's MyAnimeList id

None
start_date FuzzyDateInt

Filter by the start date of the media

None
end_date FuzzyDateInt

Filter by the end date of the media

None
season MediaSeason

Filter by the season the media was released in

None
season_year int

The year of the season (Winter 2017 would also include December 2016 releases). Requires season argument

None
type MediaType

Filter by the media's type

None
format MediaFormat

Filter by the media's format

None
status MediaStatus

Filter by the media's current release status

None
episodes int

Filter by amount of episodes the media has

None
chapters int

Filter by the media's episode length

None
duration int

Filter by the media's chapter count

None
volumes int

Filter by the media's volume count

None
is_adult bool

Filter by if the media's intended for 18+ adult audiences

None
genre str

Filter by the media's genres

None
tag str

Filter by the media's tags

None
minimum_tag_rank int

Only apply the tags filter argument to tags above this rank. Default: 18

None
tag_category str

Filter by the media's tags within a tag category

None
licensed_by str

Filter media by sites name with a online streaming or reading license

None
licensed_by_id int

Filter media by sites id with a online streaming or reading license

None
average_score int

Filter by the media's average score

None
popularity int

Filter by the number of users with this media on their list

None
source MediaSource

Filter by the source type of the media

None
country_of_origin str

Filter by the media's country of origin

None
is_licensed bool

If the media is officially licensed or a self-published doujin release

None
id_not int

Filter by the media id

None
id_in CollectionOf[int]

Filter by the media id

None
id_not_in CollectionOf[int]

Filter by the media id

None
id_mal_not int

Filter by the media's MyAnimeList id

None
id_mal_in CollectionOf[int]

Filter by the media's MyAnimeList id

None
id_mal_not_in CollectionOf[int]

Filter by the media's MyAnimeList id

None
start_date_greater FuzzyDateInt

Filter by the start date of the media

None
start_date_lesser FuzzyDateInt

Filter by the start date of the media

None
start_date_like str

Filter by the start date of the media

None
end_date_greater FuzzyDateInt

Filter by the end date of the media

None
end_date_lesser FuzzyDateInt

Filter by the end date of the media

None
end_date_like str

Filter by the end date of the media

None
format_in CollectionOf[MediaFormat]

Filter by the media's format

None
format_not MediaFormat

Filter by the media's format

None
format_not_in CollectionOf[MediaFormat]

Filter by the media's format

None
status_in CollectionOf[MediaStatus]

Filter by the media's current release status

None
status_not MediaStatus

Filter by the media's current release status

None
status_not_in CollectionOf[MediaStatus]

Filter by the media's current release status

None
episodes_greater int

Filter by amount of episodes the media has

None
episodes_lesser int

Filter by amount of episodes the media has

None
duration_greater int

Filter by the media's episode length

None
duration_lesser int

Filter by the media's episode length

None
chapters_greater int

Filter by the media's chapter count

None
chapters_lesser int

Filter by the media's chapter count

None
volumes_greater int

Filter by the media's volume count

None
volumes_lesser int

Filter by the media's volume count

None
genre_in CollectionOf[str]

Filter by the media's genres

None
genre_not_in CollectionOf[str]

Filter by the media's genres

None
tag_in CollectionOf[str]

Filter by the media's tags

None
tag_not_in CollectionOf[str]

Filter by the media's tags

None
tag_category_in CollectionOf[str]

Filter by the media's tags within a tag category

None
tag_category_not_in CollectionOf[str]

Filter by the media's tags within a tag category

None
licensed_by_in CollectionOf[str]

Filter media by sites name with a online streaming or reading license

None
licensed_by_id_in CollectionOf[int]

Filter media by sites id with a online streaming or reading license

None
average_score_not int

Filter by the media's average score

None
average_score_greater int

Filter by the media's average score

None
average_score_lesser int

Filter by the media's average score

None
popularity_not int

Filter by the number of users with this media on their list

None
popularity_greater int

Filter by the number of users with this media on their list

None
popularity_lesser int

Filter by the number of users with this media on their list

None
source_in CollectionOf[MediaSource]

Filter by the source type of the media

None
sort CollectionOf[MediaSort]

The order the results will be returned in

None

Raises:

Type Description
ValidationError

Invalid input

HTTPStatusError

AniList returned a non 2xx response.

Returns:

Type Description
Media

A Media object representing the retrieved media information.

Source code in src/pyanilist/_clients/_sync.py
@validate_call
def get(
    self,
    search: str | None = None,
    *,
    id: int | None = None,
    id_mal: int | None = None,
    start_date: FuzzyDateInt | None = None,
    end_date: FuzzyDateInt | None = None,
    season: MediaSeason | None = None,
    season_year: int | None = None,
    type: MediaType | None = None,
    format: MediaFormat | None = None,
    status: MediaStatus | None = None,
    episodes: int | None = None,
    chapters: int | None = None,
    duration: int | None = None,
    volumes: int | None = None,
    is_adult: bool | None = None,
    genre: str | None = None,
    tag: str | None = None,
    minimum_tag_rank: int | None = None,
    tag_category: str | None = None,
    licensed_by: str | None = None,
    licensed_by_id: int | None = None,
    average_score: int | None = None,
    popularity: int | None = None,
    source: MediaSource | None = None,
    country_of_origin: str | None = None,
    is_licensed: bool | None = None,
    id_not: int | None = None,
    id_in: CollectionOf[int] | None = None,
    id_not_in: CollectionOf[int] | None = None,
    id_mal_not: int | None = None,
    id_mal_in: CollectionOf[int] | None = None,
    id_mal_not_in: CollectionOf[int] | None = None,
    start_date_greater: FuzzyDateInt | None = None,
    start_date_lesser: FuzzyDateInt | None = None,
    start_date_like: str | None = None,
    end_date_greater: FuzzyDateInt | None = None,
    end_date_lesser: FuzzyDateInt | None = None,
    end_date_like: str | None = None,
    format_in: CollectionOf[MediaFormat] | None = None,
    format_not: MediaFormat | None = None,
    format_not_in: CollectionOf[MediaFormat] | None = None,
    status_in: CollectionOf[MediaStatus] | None = None,
    status_not: MediaStatus | None = None,
    status_not_in: CollectionOf[MediaStatus] | None = None,
    episodes_greater: int | None = None,
    episodes_lesser: int | None = None,
    duration_greater: int | None = None,
    duration_lesser: int | None = None,
    chapters_greater: int | None = None,
    chapters_lesser: int | None = None,
    volumes_greater: int | None = None,
    volumes_lesser: int | None = None,
    genre_in: CollectionOf[str] | None = None,
    genre_not_in: CollectionOf[str] | None = None,
    tag_in: CollectionOf[str] | None = None,
    tag_not_in: CollectionOf[str] | None = None,
    tag_category_in: CollectionOf[str] | None = None,
    tag_category_not_in: CollectionOf[str] | None = None,
    licensed_by_in: CollectionOf[str] | None = None,
    licensed_by_id_in: CollectionOf[int] | None = None,
    average_score_not: int | None = None,
    average_score_greater: int | None = None,
    average_score_lesser: int | None = None,
    popularity_not: int | None = None,
    popularity_greater: int | None = None,
    popularity_lesser: int | None = None,
    source_in: CollectionOf[MediaSource] | None = None,
    sort: CollectionOf[MediaSort] | None = None,
) -> Media:
    """
    Search for media on AniList based on the provided parameters.

    Parameters
    ----------
    search : str, optional
        Filter by search query
    id : int, optional
        Filter by the media id
    id_mal : int, optional
        Filter by the media's MyAnimeList id
    start_date : FuzzyDateInt, optional
        Filter by the start date of the media
    end_date : FuzzyDateInt, optional
        Filter by the end date of the media
    season : MediaSeason, optional
        Filter by the season the media was released in
    season_year : int, optional
        The year of the season (Winter 2017 would also include December 2016 releases). Requires season argument
    type : MediaType, optional
        Filter by the media's type
    format : MediaFormat, optional
        Filter by the media's format
    status : MediaStatus, optional
        Filter by the media's current release status
    episodes : int, optional
        Filter by amount of episodes the media has
    chapters : int, optional
        Filter by the media's episode length
    duration : int, optional
        Filter by the media's chapter count
    volumes : int, optional
        Filter by the media's volume count
    is_adult : bool, optional
        Filter by if the media's intended for 18+ adult audiences
    genre : str, optional
        Filter by the media's genres
    tag : str, optional
        Filter by the media's tags
    minimum_tag_rank : int, optional
        Only apply the tags filter argument to tags above this rank. Default: 18
    tag_category : str, optional
        Filter by the media's tags within a tag category
    licensed_by : str, optional
        Filter media by sites name with a online streaming or reading license
    licensed_by_id : int, optional
        Filter media by sites id with a online streaming or reading license
    average_score : int, optional
        Filter by the media's average score
    popularity : int, optional
        Filter by the number of users with this media on their list
    source : MediaSource, optional
        Filter by the source type of the media
    country_of_origin : str, optional
        Filter by the media's country of origin
    is_licensed : bool, optional
        If the media is officially licensed or a self-published doujin release
    id_not : int, optional
        Filter by the media id
    id_in : CollectionOf[int], optional
        Filter by the media id
    id_not_in : CollectionOf[int], optional
        Filter by the media id
    id_mal_not : int, optional
        Filter by the media's MyAnimeList id
    id_mal_in : CollectionOf[int], optional
        Filter by the media's MyAnimeList id
    id_mal_not_in : CollectionOf[int], optional
        Filter by the media's MyAnimeList id
    start_date_greater : FuzzyDateInt, optional
        Filter by the start date of the media
    start_date_lesser : FuzzyDateInt, optional
        Filter by the start date of the media
    start_date_like : str, optional
        Filter by the start date of the media
    end_date_greater : FuzzyDateInt, optional
        Filter by the end date of the media
    end_date_lesser : FuzzyDateInt, optional
        Filter by the end date of the media
    end_date_like : str, optional
        Filter by the end date of the media
    format_in : CollectionOf[MediaFormat], optional
        Filter by the media's format
    format_not : MediaFormat, optional
        Filter by the media's format
    format_not_in : CollectionOf[MediaFormat], optional
        Filter by the media's format
    status_in : CollectionOf[MediaStatus], optional
        Filter by the media's current release status
    status_not : MediaStatus, optional
        Filter by the media's current release status
    status_not_in : CollectionOf[MediaStatus], optional
        Filter by the media's current release status
    episodes_greater : int, optional
        Filter by amount of episodes the media has
    episodes_lesser : int, optional
        Filter by amount of episodes the media has
    duration_greater : int, optional
        Filter by the media's episode length
    duration_lesser : int, optional
        Filter by the media's episode length
    chapters_greater : int, optional
        Filter by the media's chapter count
    chapters_lesser : int, optional
        Filter by the media's chapter count
    volumes_greater : int, optional
        Filter by the media's volume count
    volumes_lesser : int, optional
        Filter by the media's volume count
    genre_in : CollectionOf[str], optional
        Filter by the media's genres
    genre_not_in : CollectionOf[str], optional
        Filter by the media's genres
    tag_in : CollectionOf[str], optional
        Filter by the media's tags
    tag_not_in : CollectionOf[str], optional
        Filter by the media's tags
    tag_category_in : CollectionOf[str], optional
        Filter by the media's tags within a tag category
    tag_category_not_in : CollectionOf[str], optional
        Filter by the media's tags within a tag category
    licensed_by_in : CollectionOf[str], optional
        Filter media by sites name with a online streaming or reading license
    licensed_by_id_in : CollectionOf[int], optional
        Filter media by sites id with a online streaming or reading license
    average_score_not : int, optional
        Filter by the media's average score
    average_score_greater : int, optional
        Filter by the media's average score
    average_score_lesser : int, optional
        Filter by the media's average score
    popularity_not : int, optional
        Filter by the number of users with this media on their list
    popularity_greater : int, optional
        Filter by the number of users with this media on their list
    popularity_lesser : int, optional
        Filter by the number of users with this media on their list
    source_in : CollectionOf[MediaSource], optional
        Filter by the source type of the media
    sort : CollectionOf[MediaSort], optional
        The order the results will be returned in

    Raises
    ------
    ValidationError
        Invalid input
    HTTPStatusError
        AniList returned a non 2xx response.

    Returns
    -------
    Media
        A Media object representing the retrieved media information.
    """

    return Media.model_validate(
        post_process_response(
            self._post_request(
                id=id,
                id_mal=id_mal,
                start_date=start_date,
                end_date=end_date,
                season=season,
                season_year=season_year,
                type=type,
                format=format,
                status=status,
                episodes=episodes,
                chapters=chapters,
                duration=duration,
                volumes=volumes,
                is_adult=is_adult,
                genre=genre,
                tag=tag,
                minimum_tag_rank=minimum_tag_rank,
                tag_category=tag_category,
                licensed_by=licensed_by,
                licensed_by_id=licensed_by_id,
                average_score=average_score,
                popularity=popularity,
                source=source,
                country_of_origin=country_of_origin,
                is_licensed=is_licensed,
                search=search,
                id_not=id_not,
                id_in=id_in,
                id_not_in=id_not_in,
                id_mal_not=id_mal_not,
                id_mal_in=id_mal_in,
                id_mal_not_in=id_mal_not_in,
                start_date_greater=start_date_greater,
                start_date_lesser=start_date_lesser,
                start_date_like=start_date_like,
                end_date_greater=end_date_greater,
                end_date_lesser=end_date_lesser,
                end_date_like=end_date_like,
                format_in=format_in,
                format_not=format_not,
                format_not_in=format_not_in,
                status_in=status_in,
                status_not=status_not,
                status_not_in=status_not_in,
                episodes_greater=episodes_greater,
                episodes_lesser=episodes_lesser,
                duration_greater=duration_greater,
                duration_lesser=duration_lesser,
                chapters_greater=chapters_greater,
                chapters_lesser=chapters_lesser,
                volumes_greater=volumes_greater,
                volumes_lesser=volumes_lesser,
                genre_in=genre_in,
                genre_not_in=genre_not_in,
                tag_in=tag_in,
                tag_not_in=tag_not_in,
                tag_category_in=tag_category_in,
                tag_category_not_in=tag_category_not_in,
                licensed_by_in=licensed_by_in,
                licensed_by_id_in=licensed_by_id_in,
                average_score_not=average_score_not,
                average_score_greater=average_score_greater,
                average_score_lesser=average_score_lesser,
                popularity_not=popularity_not,
                popularity_greater=popularity_greater,
                popularity_lesser=popularity_lesser,
                source_in=source_in,
                sort=sort,
            )
        )
    )

AsyncAniList

AsyncAniList(api_url: str = 'https://graphql.anilist.co', retries: PositiveInt = 5, **kwargs: Any)

AniList API client.

Parameters:

Name Type Description Default
api_url str

The URL of the AniList API. Default is https://graphql.anilist.co.

'https://graphql.anilist.co'
retries PositiveInt

Number of times to retry a failed request before raising an error. Default is 5. Set this to 1 to disable retrying.

5
kwargs Any

Keyword arguments to pass to the underlying httpx.AsyncClient used to make the POST request.

{}
Source code in src/pyanilist/_clients/_async.py
@validate_call
def __init__(self, api_url: str = "https://graphql.anilist.co", retries: PositiveInt = 5, **kwargs: Any) -> None:
    """
    AniList API client.

    Parameters
    ----------
    api_url : str, optional
        The URL of the AniList API. Default is `https://graphql.anilist.co`.
    retries : PositiveInt, optional
        Number of times to retry a failed request before raising an error. Default is 5.
        Set this to 1 to disable retrying.
    kwargs : Any, optional
        Keyword arguments to pass to the underlying [`httpx.AsyncClient`](https://www.python-httpx.org/api/#asyncclient)
        used to make the POST request.
    """
    self.api_url = api_url
    self.retries = retries
    self.kwargs = kwargs

get async

get(search: str | None = None, *, id: int | None = None, id_mal: int | None = None, start_date: FuzzyDateInt | None = None, end_date: FuzzyDateInt | None = None, season: MediaSeason | None = None, season_year: int | None = None, type: MediaType | None = None, format: MediaFormat | None = None, status: MediaStatus | None = None, episodes: int | None = None, chapters: int | None = None, duration: int | None = None, volumes: int | None = None, is_adult: bool | None = None, genre: str | None = None, tag: str | None = None, minimum_tag_rank: int | None = None, tag_category: str | None = None, licensed_by: str | None = None, licensed_by_id: int | None = None, average_score: int | None = None, popularity: int | None = None, source: MediaSource | None = None, country_of_origin: str | None = None, is_licensed: bool | None = None, id_not: int | None = None, id_in: CollectionOf[int] | None = None, id_not_in: CollectionOf[int] | None = None, id_mal_not: int | None = None, id_mal_in: CollectionOf[int] | None = None, id_mal_not_in: CollectionOf[int] | None = None, start_date_greater: FuzzyDateInt | None = None, start_date_lesser: FuzzyDateInt | None = None, start_date_like: str | None = None, end_date_greater: FuzzyDateInt | None = None, end_date_lesser: FuzzyDateInt | None = None, end_date_like: str | None = None, format_in: CollectionOf[MediaFormat] | None = None, format_not: MediaFormat | None = None, format_not_in: CollectionOf[MediaFormat] | None = None, status_in: CollectionOf[MediaStatus] | None = None, status_not: MediaStatus | None = None, status_not_in: CollectionOf[MediaStatus] | None = None, episodes_greater: int | None = None, episodes_lesser: int | None = None, duration_greater: int | None = None, duration_lesser: int | None = None, chapters_greater: int | None = None, chapters_lesser: int | None = None, volumes_greater: int | None = None, volumes_lesser: int | None = None, genre_in: CollectionOf[str] | None = None, genre_not_in: CollectionOf[str] | None = None, tag_in: CollectionOf[str] | None = None, tag_not_in: CollectionOf[str] | None = None, tag_category_in: CollectionOf[str] | None = None, tag_category_not_in: CollectionOf[str] | None = None, licensed_by_in: CollectionOf[str] | None = None, licensed_by_id_in: CollectionOf[int] | None = None, average_score_not: int | None = None, average_score_greater: int | None = None, average_score_lesser: int | None = None, popularity_not: int | None = None, popularity_greater: int | None = None, popularity_lesser: int | None = None, source_in: CollectionOf[MediaSource] | None = None, sort: CollectionOf[MediaSort] | None = None) -> Media

Search for media on AniList based on the provided parameters.

Parameters:

Name Type Description Default
search str

Filter by search query

None
id int

Filter by the media id

None
id_mal int

Filter by the media's MyAnimeList id

None
start_date FuzzyDateInt

Filter by the start date of the media

None
end_date FuzzyDateInt

Filter by the end date of the media

None
season MediaSeason

Filter by the season the media was released in

None
season_year int

The year of the season (Winter 2017 would also include December 2016 releases). Requires season argument

None
type MediaType

Filter by the media's type

None
format MediaFormat

Filter by the media's format

None
status MediaStatus

Filter by the media's current release status

None
episodes int

Filter by amount of episodes the media has

None
chapters int

Filter by the media's episode length

None
duration int

Filter by the media's chapter count

None
volumes int

Filter by the media's volume count

None
is_adult bool

Filter by if the media's intended for 18+ adult audiences

None
genre str

Filter by the media's genres

None
tag str

Filter by the media's tags

None
minimum_tag_rank int

Only apply the tags filter argument to tags above this rank. Default: 18

None
tag_category str

Filter by the media's tags within a tag category

None
licensed_by str

Filter media by sites name with a online streaming or reading license

None
licensed_by_id int

Filter media by sites id with a online streaming or reading license

None
average_score int

Filter by the media's average score

None
popularity int

Filter by the number of users with this media on their list

None
source MediaSource

Filter by the source type of the media

None
country_of_origin str

Filter by the media's country of origin

None
is_licensed bool

If the media is officially licensed or a self-published doujin release

None
id_not int

Filter by the media id

None
id_in CollectionOf[int]

Filter by the media id

None
id_not_in CollectionOf[int]

Filter by the media id

None
id_mal_not int

Filter by the media's MyAnimeList id

None
id_mal_in CollectionOf[int]

Filter by the media's MyAnimeList id

None
id_mal_not_in CollectionOf[int]

Filter by the media's MyAnimeList id

None
start_date_greater FuzzyDateInt

Filter by the start date of the media

None
start_date_lesser FuzzyDateInt

Filter by the start date of the media

None
start_date_like str

Filter by the start date of the media

None
end_date_greater FuzzyDateInt

Filter by the end date of the media

None
end_date_lesser FuzzyDateInt

Filter by the end date of the media

None
end_date_like str

Filter by the end date of the media

None
format_in CollectionOf[MediaFormat]

Filter by the media's format

None
format_not MediaFormat

Filter by the media's format

None
format_not_in CollectionOf[MediaFormat]

Filter by the media's format

None
status_in CollectionOf[MediaStatus]

Filter by the media's current release status

None
status_not MediaStatus

Filter by the media's current release status

None
status_not_in CollectionOf[MediaStatus]

Filter by the media's current release status

None
episodes_greater int

Filter by amount of episodes the media has

None
episodes_lesser int

Filter by amount of episodes the media has

None
duration_greater int

Filter by the media's episode length

None
duration_lesser int

Filter by the media's episode length

None
chapters_greater int

Filter by the media's chapter count

None
chapters_lesser int

Filter by the media's chapter count

None
volumes_greater int

Filter by the media's volume count

None
volumes_lesser int

Filter by the media's volume count

None
genre_in CollectionOf[str]

Filter by the media's genres

None
genre_not_in CollectionOf[str]

Filter by the media's genres

None
tag_in CollectionOf[str]

Filter by the media's tags

None
tag_not_in CollectionOf[str]

Filter by the media's tags

None
tag_category_in CollectionOf[str]

Filter by the media's tags within a tag category

None
tag_category_not_in CollectionOf[str]

Filter by the media's tags within a tag category

None
licensed_by_in CollectionOf[str]

Filter media by sites name with a online streaming or reading license

None
licensed_by_id_in CollectionOf[int]

Filter media by sites id with a online streaming or reading license

None
average_score_not int

Filter by the media's average score

None
average_score_greater int

Filter by the media's average score

None
average_score_lesser int

Filter by the media's average score

None
popularity_not int

Filter by the number of users with this media on their list

None
popularity_greater int

Filter by the number of users with this media on their list

None
popularity_lesser int

Filter by the number of users with this media on their list

None
source_in CollectionOf[MediaSource]

Filter by the source type of the media

None
sort CollectionOf[MediaSort]

The order the results will be returned in

None

Raises:

Type Description
ValidationError

Invalid input

HTTPStatusError

AniList returned a non 2xx response.

Returns:

Type Description
Media

A Media object representing the retrieved media information.

Source code in src/pyanilist/_clients/_async.py
@validate_call
async def get(
    self,
    search: str | None = None,
    *,
    id: int | None = None,
    id_mal: int | None = None,
    start_date: FuzzyDateInt | None = None,
    end_date: FuzzyDateInt | None = None,
    season: MediaSeason | None = None,
    season_year: int | None = None,
    type: MediaType | None = None,
    format: MediaFormat | None = None,
    status: MediaStatus | None = None,
    episodes: int | None = None,
    chapters: int | None = None,
    duration: int | None = None,
    volumes: int | None = None,
    is_adult: bool | None = None,
    genre: str | None = None,
    tag: str | None = None,
    minimum_tag_rank: int | None = None,
    tag_category: str | None = None,
    licensed_by: str | None = None,
    licensed_by_id: int | None = None,
    average_score: int | None = None,
    popularity: int | None = None,
    source: MediaSource | None = None,
    country_of_origin: str | None = None,
    is_licensed: bool | None = None,
    id_not: int | None = None,
    id_in: CollectionOf[int] | None = None,
    id_not_in: CollectionOf[int] | None = None,
    id_mal_not: int | None = None,
    id_mal_in: CollectionOf[int] | None = None,
    id_mal_not_in: CollectionOf[int] | None = None,
    start_date_greater: FuzzyDateInt | None = None,
    start_date_lesser: FuzzyDateInt | None = None,
    start_date_like: str | None = None,
    end_date_greater: FuzzyDateInt | None = None,
    end_date_lesser: FuzzyDateInt | None = None,
    end_date_like: str | None = None,
    format_in: CollectionOf[MediaFormat] | None = None,
    format_not: MediaFormat | None = None,
    format_not_in: CollectionOf[MediaFormat] | None = None,
    status_in: CollectionOf[MediaStatus] | None = None,
    status_not: MediaStatus | None = None,
    status_not_in: CollectionOf[MediaStatus] | None = None,
    episodes_greater: int | None = None,
    episodes_lesser: int | None = None,
    duration_greater: int | None = None,
    duration_lesser: int | None = None,
    chapters_greater: int | None = None,
    chapters_lesser: int | None = None,
    volumes_greater: int | None = None,
    volumes_lesser: int | None = None,
    genre_in: CollectionOf[str] | None = None,
    genre_not_in: CollectionOf[str] | None = None,
    tag_in: CollectionOf[str] | None = None,
    tag_not_in: CollectionOf[str] | None = None,
    tag_category_in: CollectionOf[str] | None = None,
    tag_category_not_in: CollectionOf[str] | None = None,
    licensed_by_in: CollectionOf[str] | None = None,
    licensed_by_id_in: CollectionOf[int] | None = None,
    average_score_not: int | None = None,
    average_score_greater: int | None = None,
    average_score_lesser: int | None = None,
    popularity_not: int | None = None,
    popularity_greater: int | None = None,
    popularity_lesser: int | None = None,
    source_in: CollectionOf[MediaSource] | None = None,
    sort: CollectionOf[MediaSort] | None = None,
) -> Media:
    """
    Search for media on AniList based on the provided parameters.

    Parameters
    ----------
    search : str, optional
        Filter by search query
    id : int, optional
        Filter by the media id
    id_mal : int, optional
        Filter by the media's MyAnimeList id
    start_date : FuzzyDateInt, optional
        Filter by the start date of the media
    end_date : FuzzyDateInt, optional
        Filter by the end date of the media
    season : MediaSeason, optional
        Filter by the season the media was released in
    season_year : int, optional
        The year of the season (Winter 2017 would also include December 2016 releases). Requires season argument
    type : MediaType, optional
        Filter by the media's type
    format : MediaFormat, optional
        Filter by the media's format
    status : MediaStatus, optional
        Filter by the media's current release status
    episodes : int, optional
        Filter by amount of episodes the media has
    chapters : int, optional
        Filter by the media's episode length
    duration : int, optional
        Filter by the media's chapter count
    volumes : int, optional
        Filter by the media's volume count
    is_adult : bool, optional
        Filter by if the media's intended for 18+ adult audiences
    genre : str, optional
        Filter by the media's genres
    tag : str, optional
        Filter by the media's tags
    minimum_tag_rank : int, optional
        Only apply the tags filter argument to tags above this rank. Default: 18
    tag_category : str, optional
        Filter by the media's tags within a tag category
    licensed_by : str, optional
        Filter media by sites name with a online streaming or reading license
    licensed_by_id : int, optional
        Filter media by sites id with a online streaming or reading license
    average_score : int, optional
        Filter by the media's average score
    popularity : int, optional
        Filter by the number of users with this media on their list
    source : MediaSource, optional
        Filter by the source type of the media
    country_of_origin : str, optional
        Filter by the media's country of origin
    is_licensed : bool, optional
        If the media is officially licensed or a self-published doujin release
    id_not : int, optional
        Filter by the media id
    id_in : CollectionOf[int], optional
        Filter by the media id
    id_not_in : CollectionOf[int], optional
        Filter by the media id
    id_mal_not : int, optional
        Filter by the media's MyAnimeList id
    id_mal_in : CollectionOf[int], optional
        Filter by the media's MyAnimeList id
    id_mal_not_in : CollectionOf[int], optional
        Filter by the media's MyAnimeList id
    start_date_greater : FuzzyDateInt, optional
        Filter by the start date of the media
    start_date_lesser : FuzzyDateInt, optional
        Filter by the start date of the media
    start_date_like : str, optional
        Filter by the start date of the media
    end_date_greater : FuzzyDateInt, optional
        Filter by the end date of the media
    end_date_lesser : FuzzyDateInt, optional
        Filter by the end date of the media
    end_date_like : str, optional
        Filter by the end date of the media
    format_in : CollectionOf[MediaFormat], optional
        Filter by the media's format
    format_not : MediaFormat, optional
        Filter by the media's format
    format_not_in : CollectionOf[MediaFormat], optional
        Filter by the media's format
    status_in : CollectionOf[MediaStatus], optional
        Filter by the media's current release status
    status_not : MediaStatus, optional
        Filter by the media's current release status
    status_not_in : CollectionOf[MediaStatus], optional
        Filter by the media's current release status
    episodes_greater : int, optional
        Filter by amount of episodes the media has
    episodes_lesser : int, optional
        Filter by amount of episodes the media has
    duration_greater : int, optional
        Filter by the media's episode length
    duration_lesser : int, optional
        Filter by the media's episode length
    chapters_greater : int, optional
        Filter by the media's chapter count
    chapters_lesser : int, optional
        Filter by the media's chapter count
    volumes_greater : int, optional
        Filter by the media's volume count
    volumes_lesser : int, optional
        Filter by the media's volume count
    genre_in : CollectionOf[str], optional
        Filter by the media's genres
    genre_not_in : CollectionOf[str], optional
        Filter by the media's genres
    tag_in : CollectionOf[str], optional
        Filter by the media's tags
    tag_not_in : CollectionOf[str], optional
        Filter by the media's tags
    tag_category_in : CollectionOf[str], optional
        Filter by the media's tags within a tag category
    tag_category_not_in : CollectionOf[str], optional
        Filter by the media's tags within a tag category
    licensed_by_in : CollectionOf[str], optional
        Filter media by sites name with a online streaming or reading license
    licensed_by_id_in : CollectionOf[int], optional
        Filter media by sites id with a online streaming or reading license
    average_score_not : int, optional
        Filter by the media's average score
    average_score_greater : int, optional
        Filter by the media's average score
    average_score_lesser : int, optional
        Filter by the media's average score
    popularity_not : int, optional
        Filter by the number of users with this media on their list
    popularity_greater : int, optional
        Filter by the number of users with this media on their list
    popularity_lesser : int, optional
        Filter by the number of users with this media on their list
    source_in : CollectionOf[MediaSource], optional
        Filter by the source type of the media
    sort : CollectionOf[MediaSort], optional
        The order the results will be returned in

    Raises
    ------
    ValidationError
        Invalid input
    HTTPStatusError
        AniList returned a non 2xx response.

    Returns
    -------
    Media
        A Media object representing the retrieved media information.
    """

    return Media.model_validate(
        post_process_response(
            await self._post_request(
                id=id,
                id_mal=id_mal,
                start_date=start_date,
                end_date=end_date,
                season=season,
                season_year=season_year,
                type=type,
                format=format,
                status=status,
                episodes=episodes,
                chapters=chapters,
                duration=duration,
                volumes=volumes,
                is_adult=is_adult,
                genre=genre,
                tag=tag,
                minimum_tag_rank=minimum_tag_rank,
                tag_category=tag_category,
                licensed_by=licensed_by,
                licensed_by_id=licensed_by_id,
                average_score=average_score,
                popularity=popularity,
                source=source,
                country_of_origin=country_of_origin,
                is_licensed=is_licensed,
                search=search,
                id_not=id_not,
                id_in=id_in,
                id_not_in=id_not_in,
                id_mal_not=id_mal_not,
                id_mal_in=id_mal_in,
                id_mal_not_in=id_mal_not_in,
                start_date_greater=start_date_greater,
                start_date_lesser=start_date_lesser,
                start_date_like=start_date_like,
                end_date_greater=end_date_greater,
                end_date_lesser=end_date_lesser,
                end_date_like=end_date_like,
                format_in=format_in,
                format_not=format_not,
                format_not_in=format_not_in,
                status_in=status_in,
                status_not=status_not,
                status_not_in=status_not_in,
                episodes_greater=episodes_greater,
                episodes_lesser=episodes_lesser,
                duration_greater=duration_greater,
                duration_lesser=duration_lesser,
                chapters_greater=chapters_greater,
                chapters_lesser=chapters_lesser,
                volumes_greater=volumes_greater,
                volumes_lesser=volumes_lesser,
                genre_in=genre_in,
                genre_not_in=genre_not_in,
                tag_in=tag_in,
                tag_not_in=tag_not_in,
                tag_category_in=tag_category_in,
                tag_category_not_in=tag_category_not_in,
                licensed_by_in=licensed_by_in,
                licensed_by_id_in=licensed_by_id_in,
                average_score_not=average_score_not,
                average_score_greater=average_score_greater,
                average_score_lesser=average_score_lesser,
                popularity_not=popularity_not,
                popularity_greater=popularity_greater,
                popularity_lesser=popularity_lesser,
                source_in=source_in,
                sort=sort,
            )
        )
    )