Skip to content

Anilist Query Documentation

Query

Query(auth_token: Union[str, None])

This class represents a Query in the AniLink API.

ATTRIBUTE DESCRIPTION
page

An instance of the Page class.

TYPE: Page

user_query

An instance of the UserQuery class.

TYPE: UserQuery

PARAMETER DESCRIPTION
auth_token

The authentication token.

TYPE: str

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

    Args:
        auth_token (str): The authentication token.
    """
    self.page = Page(auth_token)
    self.user_query = UserQuery(auth_token)
    self.media_query = MediaQuery(auth_token)

media_query instance-attribute

media_query = MediaQuery(auth_token)

page instance-attribute

page = Page(auth_token)

user_query instance-attribute

user_query = UserQuery(auth_token)

media

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

This method is used to get a media.

PARAMETER DESCRIPTION
variables

The variables for the Query.

TYPE: dict

RETURNS DESCRIPTION
dict

The response from the media Query.

TYPE: dict

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

    Args:
        variables (dict): The variables for the Query.

    Returns:
        dict: The response from the media Query.
    """
    return self.media_query.media(variables)

user

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

This method is used to get a user.

PARAMETER DESCRIPTION
variables

The variables for the Query.

TYPE: dict

RETURNS DESCRIPTION
dict

The response from the user Query.

TYPE: dict

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

    Args:
        variables (dict): The variables for the Query.

    Returns:
        dict: The response from the user Query.
    """
    return self.user_query.user(variables)