pyanimeinfo.myanimelist.jikanv4

JikanV4Client

class pyanimeinfo.myanimelist.jikanv4.JikanV4Client(session: Session | None = None, website: str | None = None, user_agent: str | None = 'deepghs/pyanimeinfo')[source]

Client for interacting with the Jikan API (v4) to retrieve anime and character information.

Parameters:
  • session (Optional[requests.Session]) – Optional requests session. If not provided, a new session is created.

  • website (Optional[str]) – Optional Jikan API website URL. Defaults to the official Jikan v4 API.

  • user_agent (Optional[str]) – User agent to use in client. Defaults to deepghs/pyanimeinfo. Keep the original UA when assigned to empty value.

__init__(session: Session | None = None, website: str | None = None, user_agent: str | None = 'deepghs/pyanimeinfo')[source]
get_anime(anime_id)[source]

Get information about a specific anime by ID.

Parameters:

anime_id (int) – ID of the anime.

Returns:

Processed JSON data from the API response.

Return type:

dict

get_anime_characters(anime_id)[source]

Get information about characters in a specific anime by ID.

Parameters:

anime_id (int) – ID of the anime.

Returns:

Processed JSON data from the API response.

Return type:

dict

get_anime_full(anime_id)[source]

Get full information about a specific anime by ID.

Parameters:

anime_id (int) – ID of the anime.

Returns:

Processed JSON data from the API response.

Return type:

dict

get_anime_pictures(anime_id: int)[source]

Get pictures information of a specific anime by ID.

Parameters:

anime_id – ID of the anime

Type:

anime_id: int

Returns:

Processed JSON data for the API response.

Return type:

dict

get_character(character_id)[source]

Get information about a specific character by ID.

Parameters:

character_id (int) – ID of the character.

Returns:

Processed JSON data from the API response.

Return type:

dict

get_character_full(character_id)[source]

Get full information about a specific character by ID.

Parameters:

character_id (int) – ID of the character.

Returns:

Processed JSON data from the API response.

Return type:

dict

get_character_pictures(character_id)[source]

Get pictures of a specific character by ID.

This method retrieves a collection of images associated with the specified character.

Parameters:

character_id (int) – ID of the character.

Returns:

Processed JSON data from the API response, containing links to character pictures.

Return type:

dict

Example:

>>> client = JikanV4Client()
>>> pictures = client.get_character_pictures(1)
>>> print(pictures)

Get information about anime related to a specific character by ID.

Parameters:

character_id (int) – ID of the character.

Returns:

Processed JSON data from the API response.

Return type:

dict

Get information about manga related to a specific character by ID.

This method retrieves a list of manga titles that feature the specified character.

Parameters:

character_id (int) – ID of the character.

Returns:

Processed JSON data from the API response, containing information about related manga.

Return type:

dict

Example:

>>> client = JikanV4Client()
>>> related_manga = client.get_character_related_manga(1)
>>> print(related_manga)
get_character_voice_actors(character_id)[source]

Get information about voice actors for a specific character by ID.

This method retrieves a list of voice actors who have portrayed the specified character in various anime adaptations.

Parameters:

character_id (int) – ID of the character.

Returns:

Processed JSON data from the API response, containing information about voice actors.

Return type:

dict

Example:

>>> client = JikanV4Client()
>>> voice_actors = client.get_character_voice_actors(1)
>>> print(voice_actors)
get_manga(manga_id: int)[source]

Get basic information about a specific manga by ID.

This method retrieves basic details about the specified manga, such as title, author, and publication status.

Parameters:

manga_id (int) – ID of the manga.

Returns:

Processed JSON data from the API response, containing basic manga information.

Return type:

dict

Example:

>>> client = JikanV4Client()
>>> manga_info = client.get_manga(1)
>>> print(manga_info)
get_manga_full(manga_id: int)[source]

Get full information about a specific manga by ID.

This method retrieves comprehensive details about the specified manga, including synopsis, characters, and more.

Parameters:

manga_id (int) – ID of the manga.

Returns:

Processed JSON data from the API response, containing full manga information.

Return type:

dict

Example:

>>> client = JikanV4Client()
>>> manga_full_info = client.get_manga_full(1)
>>> print(manga_full_info)
get_manga_pictures(manga_id: int)[source]

Get pictures associated with a specific manga by ID.

This method retrieves a collection of images related to the specified manga, such as cover art and illustrations.

Parameters:

manga_id (int) – ID of the manga.

Returns:

Processed JSON data from the API response, containing links to manga pictures.

Return type:

dict

Example:

>>> client = JikanV4Client()
>>> manga_pictures = client.get_manga_pictures(1)
>>> print(manga_pictures)
get_people(people_id: int)[source]

Get basic information about a specific person by ID.

This method retrieves basic details about the specified person, such as name and role in the anime/manga industry.

Parameters:

people_id (int) – ID of the person.

Returns:

Processed JSON data from the API response, containing basic information about the person.

Return type:

dict

Example:

>>> client = JikanV4Client()
>>> person_info = client.get_people(1)
>>> print(person_info)
get_people_full(people_id: int)[source]

Get full information about a specific person by ID.

This method retrieves comprehensive details about the specified person, including their works and biography.

Parameters:

people_id (int) – ID of the person.

Returns:

Processed JSON data from the API response, containing full information about the person.

Return type:

dict

Example:

>>> client = JikanV4Client()
>>> person_full_info = client.get_people_full(1)
>>> print(person_full_info)
get_people_pictures(people_id: int)[source]

Get pictures of a specific person by ID.

This method retrieves a collection of images associated with the specified person.

Parameters:

people_id (int) – ID of the person.

Returns:

Processed JSON data from the API response, containing links to pictures of the person.

Return type:

dict

Example:

>>> client = JikanV4Client()
>>> person_pictures = client.get_people_pictures(1)
>>> print(person_pictures)
search_anime(query: str, type_: Literal['tv', 'movie', 'ova', 'special', 'ona', 'music'] | None = None, status: Literal['airing', 'complete', 'upcoming'] | None = None, rating: Literal['g', 'pg', 'pg13', 'r17', 'r', 'rx'] | None = None, order_by: Literal['mal_id', 'title', 'start_date', 'end_date', 'episodes', 'score', 'scored_by', 'rank', 'popularity', 'members', 'favorites'] | None = None, sort_: Literal['desc', 'asc'] | None = None, sfw: bool = False, unapproved: bool = False, start_date: str | None = None, end_date: str | None = None, page: int | None = None, limit: int | None = None)[source]

Search for anime on the Jikan API.

Parameters:
  • query (str) – Search query.

  • type (Optional[Literal["tv", "movie", "ova", "special", "ona", "music"]]) – Type of anime (e.g., “tv”, “movie”).

  • status (Optional[Literal["airing", "complete", "upcoming"]]) – Anime status (e.g., “airing”, “complete”).

  • rating (Optional[Literal["g", "pg", "pg13", "r17", "r", "rx"]]) – Age rating of the anime.

  • order_by (Optional[_SearchOrderByTyping]) – Attribute to order the results by.

  • sort (Optional[Literal["desc", "asc"]]) – Sort order (“desc” or “asc”).

  • sfw (bool) – Whether to include safe-for-work content.

  • unapproved (bool) – Whether to include unapproved content.

  • start_date (Optional[str]) – Start date filter for anime.

  • end_date (Optional[str]) – End date filter for anime.

  • page (Optional[int]) – Page number for paginated results.

  • limit (Optional[int]) – Limit on the number of results per page.

Returns:

Processed JSON data from the API response.

Return type:

dict

search_characters(query: str, order_by: Literal['mal_id', 'name', 'favorites'] | None = None, sort_: Literal['desc', 'asc'] | None = None, page: int | None = None, limit: int | None = None)[source]

Search for characters on the Jikan API.

Parameters:
  • query (str) – Search query.

  • order_by (Optional[Literal["mal_id", "name", "favorites"]]) – Attribute to order the results by.

  • sort (Optional[Literal["desc", "asc"]]) – Sort order (“desc” or “asc”).

  • page (Optional[int]) – Page number for paginated results.

  • limit (Optional[int]) – Limit on the number of results per page.

Returns:

Processed JSON data from the API response.

Return type:

dict

search_manga(query: str, order_by: Literal['mal_id', 'title', 'start_date', 'end_date', 'chapters', 'volumes', 'score', 'scored_by', 'rank', 'popularity', 'members', 'favorites'] | None = None, sort_: Literal['desc', 'asc'] | None = None, type_: Literal['manga', 'novel', 'lightnovel', 'oneshot', 'doujin', 'manhwa', 'manhua'] | None = None, unapproved: bool = False, score: float | None = None, min_score: float | None = None, max_score: float | None = None, status: Literal['publishing', 'complete', 'hiatus', 'discontinued', 'upcoming'] | None = None, sfw: bool = False, letter: str | None = None, magazines: List[int | str] | None = None, genres: List[int | str] | None = None, genres_exclude: List[int | str] | None = None, start_date: str | None = None, end_date: str | None = None, page: int | None = None, limit: int | None = None)[source]

Search for manga based on various criteria.

This method allows for a comprehensive search of manga titles with multiple filtering options.

Parameters:
  • query (str) – Search query string.

  • order_by (Optional[Literal["mal_id", "title", "start_date", "end_date", "chapters", "volumes", "score", "scored_by", "rank", "popularity", "members", "favorites"]]) – Property to order the results by.

  • sort (Optional[Literal["desc", "asc"]]) – Sort direction for the results.

  • type (Optional[Literal["manga", "novel", "lightnovel", "oneshot", "doujin", "manhwa", "manhua"]]) – Type of manga to search for.

  • unapproved (bool) – Include unapproved entries in the results.

  • score (Optional[float]) – Filter by exact score.

  • min_score (Optional[float]) – Filter by minimum score.

  • max_score (Optional[float]) – Filter by maximum score.

  • status (Optional[Literal["publishing", "complete", "hiatus", "discontinued", "upcoming"]]) – Filter by publication status.

  • sfw (bool) – Filter out adult content.

  • letter (Optional[str]) – Filter by starting letter of the title.

  • magazines (Optional[List[Union[int, str]]]) – Filter by magazine IDs.

  • genres (Optional[List[Union[int, str]]]) – Filter by genre IDs.

  • genres_exclude (Optional[List[Union[int, str]]]) – Exclude specific genre IDs.

  • start_date (Optional[str]) – Filter by start date (format: YYYY-MM-DD).

  • end_date (Optional[str]) – Filter by end date (format: YYYY-MM-DD).

  • page (Optional[int]) – Page number for pagination.

  • limit (Optional[int]) – Number of results per page.

Returns:

Processed JSON data from the API response, containing search results.

Return type:

dict

Example:

>>> client = JikanV4Client()
>>> search_results = client.search_manga("Naruto", order_by="popularity", sort_="desc", type_="manga", sfw=True)
>>> print(search_results)
search_people(query: str, order_by: Literal['mal_id', 'name', 'birthday', 'favorites'] | None = None, sort_: Literal['desc', 'asc'] | None = None, letter: str | None = None, page: int | None = None, limit: int | None = None)[source]

Search for people in the anime/manga industry based on various criteria.

This method allows for searching people such as voice actors, directors, and manga artists.

Parameters:
  • query (str) – Search query string.

  • order_by (Optional[Literal["mal_id", "name", "birthday", "favorites"]]) – Property to order the results by.

  • sort (Optional[Literal["desc", "asc"]]) – Sort direction for the results.

  • letter (Optional[str]) – Filter by starting letter of the name.

  • page (Optional[int]) – Page number for pagination.

  • limit (Optional[int]) – Number of results per page.

Returns:

Processed JSON data from the API response, containing search results.

Return type:

dict

Example:

>>> client = JikanV4Client()
>>> search_results = client.search_people("Miyazaki", order_by="favorites", sort_="desc")
>>> print(search_results)