Skip to content

AniList API Documentation

AniList

AniList(auth_token: Union[str, None])

This class represents the AniList API.

ATTRIBUTE DESCRIPTION
query

An instance of the Query class.

TYPE: Query

mutation

An instance of the Mutation class.

TYPE: Mutation

custom_query

An instance of the CustomRequest class.

TYPE: CustomRequest

PARAMETER DESCRIPTION
auth_token

The authentication token.

TYPE: str

Source code in AniLinkPy/apis/anilist/anilist.py
def __init__(self, auth_token: Union[str, None]) -> None:
    """
    The constructor for AniList class.

    Args:
        auth_token (str): The authentication token.
    """
    self.query = Query(auth_token)
    self.mutation = Mutation()
    self.custom_query = CustomRequest(auth_token)

custom_query instance-attribute

custom_query = CustomRequest(auth_token)

mutation instance-attribute

mutation = Mutation()

query instance-attribute

query = Query(auth_token)

custom

custom(query: str, variables: Union[Dict[str, Union[str, int, bool]]]) -> dict

This method is used to send a custom Query or Mutation.

PARAMETER DESCRIPTION
query

The Query string.

TYPE: str

variables

The variables for the Query.

TYPE: dict

RETURNS DESCRIPTION
dict

The response from the custom Query.

TYPE: dict

Source code in AniLinkPy/apis/anilist/anilist.py
def custom(
    self, query: str, variables: Union[Dict[str, Union[str, int, bool]]]
) -> dict:
    """
    This method is used to send a custom Query or Mutation.

    Args:
        query (str): The Query string.
        variables (dict): The variables for the Query.

    Returns:
        dict: The response from the custom Query.
    """
    return self.custom_query.custom(query, variables)