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_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.
- Parameters:
character_id (int) – ID of the character.
- Returns:
Processed JSON data from the API response.
- Return type:
dict
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.
- Parameters:
character_id (int) – ID of the character.
- Returns:
Processed JSON data from the API response.
- Return type:
dict
- get_character_voice_actors(character_id)[source]
Get information about voice actors for a specific character by ID.
- Parameters:
character_id (int) – ID of the character.
- Returns:
Processed JSON data from the API response.
- Return type:
dict
- 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