Skip to content

mahmudindev/openapi-jikan-python

Repository files navigation

jikan-openapi

Jikan is an Unofficial MyAnimeList API. It scrapes the website to satisfy the need for a complete API - which MyAnimeList lacks.

Information

⚡ Jikan is powered by its awesome backers - 🙏 Become a backer

Rate Limiting

Duration Requests
Daily Unlimited
Per Minute 60 requests
Per Second 3 requests

Note: It's still possible to get rate limited from MyAnimeList.net instead.

JSON Notes

  • Any property (except arrays or objects) whose value does not exist or is undetermined, will be null.
  • Any array or object property whose value does not exist or is undetermined, will be empty.
  • Any score property whose value does not exist or is undetermined, will be 0.
  • All dates and timestamps are returned in ISO8601 format and in UTC timezone

Caching

By CACHING, we refer to the data parsed from MyAnimeList which is stored temporarily on our servers to provide better API performance.

All requests are cached for 24 hours.

The following response headers will detail cache information.

Header Remarks
Expires Cache expiry date
Last-Modified Cache set date
X-Request-Fingerprint Unique request fingerprint (only for cachable requests, not queries)

Note: X-Request-Fingerprint will only be available on single resource requests and their child endpoints. e.g /anime/1, /anime/1/relations. They won't be available on pages which perform queries, like /anime, or /top/anime, etc.

Allowed HTTP(s) requests

Jikan REST API does not provide authenticated requests for MyAnimeList. This means you can not use it to update your anime/manga list. Only GET requests are supported which return READ-ONLY data.

HTTP Responses

All error responses are accompanied by a JSON Error response.

Exception HTTP Status Remarks
N/A 200 - OK The request was successful
N/A 304 - Not Modified You have the latest data (Cache Validation response)
BadRequestException,ValidationException 400 - Bad Request You've made an invalid request. Recheck documentation
BadResponseException 404 - Not Found The resource was not found or MyAnimeList responded with a 404
BadRequestException 405 - Method Not Allowed Requested Method is not supported for resource. Only GET requests are allowed
RateLimitException 429 - Too Many Request You are being rate limited by Jikan or MyAnimeList is rate-limiting our servers (specified in the error response)
UpstreamException,ParserException,etc. 500 - Internal Server Error Something didn't work. Try again later. If you see an error response with a report_url URL, please click on it to open an auto-generated GitHub issue
ServiceUnavailableException 503 - Service Unavailable In most cases this is intentionally done if the service is down for maintenance.

JSON Error Response

 {
     \"status\": 500,
     \"type\": \"InternalException\",
     \"message\": \"Exception Message\",
     \"error\": \"Exception Trace\",
     \"report_url\": \"https://github.com...\"
  }
Property Remarks
status Returned HTTP Status Code
type Thrown Exception
message Human-readable error message
error Error response and trace from the API
report_url Clicking this would redirect you to a generated GitHub issue

Cache Validation

  • All requests return a ETag header which is an MD5 hash of the response
  • You can use this hash to verify if there's new or updated content by suppliying it as the value for the If-None-Match in your next request header
  • You will get a HTTP 304 - Not Modified response if the content has not changed
  • If the content has changed, you'll get a HTTP 200 - OK response with the updated JSON response

Cache Validation

Disclaimer

  • Jikan is not affiliated with MyAnimeList.net.
  • Jikan is a free, open-source API. Please use it responsibly.

By using the API, you are agreeing to Jikan's terms of use policy.

v3 Documentation - Wrappers/SDKs - Report an issue - Host your own server

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 4.0.0
  • Package version: 4.0.0
  • Generator version: 7.4.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit http://discord.jikan.moe

Requirements.

Python 3.7+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import jikan_openapi

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import jikan_openapi

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import jikan_openapi
from jikan_openapi.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.jikan.moe/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = jikan_openapi.Configuration(
    host = "https://api.jikan.moe/v4"
)



# Enter a context with an instance of the API client
with jikan_openapi.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = jikan_openapi.AnimeApi(api_client)
    id = 56 # int | 

    try:
        api_response = api_instance.get_anime_by_id(id)
        print("The response of AnimeApi->get_anime_by_id:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AnimeApi->get_anime_by_id: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.jikan.moe/v4

Class Method HTTP request Description
AnimeApi get_anime_by_id GET /anime/{id}
AnimeApi get_anime_characters GET /anime/{id}/characters
AnimeApi get_anime_episode_by_id GET /anime/{id}/episodes/{episode}
AnimeApi get_anime_episodes GET /anime/{id}/episodes
AnimeApi get_anime_external GET /anime/{id}/external
AnimeApi get_anime_forum GET /anime/{id}/forum
AnimeApi get_anime_full_by_id GET /anime/{id}/full
AnimeApi get_anime_more_info GET /anime/{id}/moreinfo
AnimeApi get_anime_news GET /anime/{id}/news
AnimeApi get_anime_pictures GET /anime/{id}/pictures
AnimeApi get_anime_recommendations GET /anime/{id}/recommendations
AnimeApi get_anime_relations GET /anime/{id}/relations
AnimeApi get_anime_reviews GET /anime/{id}/reviews
AnimeApi get_anime_search GET /anime
AnimeApi get_anime_staff GET /anime/{id}/staff
AnimeApi get_anime_statistics GET /anime/{id}/statistics
AnimeApi get_anime_streaming GET /anime/{id}/streaming
AnimeApi get_anime_themes GET /anime/{id}/themes
AnimeApi get_anime_user_updates GET /anime/{id}/userupdates
AnimeApi get_anime_videos GET /anime/{id}/videos
AnimeApi get_anime_videos_episodes GET /anime/{id}/videos/episodes
CharactersApi get_character_anime GET /characters/{id}/anime
CharactersApi get_character_by_id GET /characters/{id}
CharactersApi get_character_full_by_id GET /characters/{id}/full
CharactersApi get_character_manga GET /characters/{id}/manga
CharactersApi get_character_pictures GET /characters/{id}/pictures
CharactersApi get_character_voice_actors GET /characters/{id}/voices
CharactersApi get_characters_search GET /characters
ClubsApi get_club_members GET /clubs/{id}/members
ClubsApi get_club_relations GET /clubs/{id}/relations
ClubsApi get_club_staff GET /clubs/{id}/staff
ClubsApi get_clubs_by_id GET /clubs/{id}
ClubsApi get_clubs_search GET /clubs
GenresApi get_anime_genres GET /genres/anime
GenresApi get_manga_genres GET /genres/manga
MagazinesApi get_magazines GET /magazines
MangaApi get_manga_by_id GET /manga/{id}
MangaApi get_manga_characters GET /manga/{id}/characters
MangaApi get_manga_external GET /manga/{id}/external
MangaApi get_manga_full_by_id GET /manga/{id}/full
MangaApi get_manga_more_info GET /manga/{id}/moreinfo
MangaApi get_manga_news GET /manga/{id}/news
MangaApi get_manga_pictures GET /manga/{id}/pictures
MangaApi get_manga_recommendations GET /manga/{id}/recommendations
MangaApi get_manga_relations GET /manga/{id}/relations
MangaApi get_manga_reviews GET /manga/{id}/reviews
MangaApi get_manga_search GET /manga
MangaApi get_manga_statistics GET /manga/{id}/statistics
MangaApi get_manga_topics GET /manga/{id}/forum
MangaApi get_manga_user_updates GET /manga/{id}/userupdates
PeopleApi get_people_search GET /people
PeopleApi get_person_anime GET /people/{id}/anime
PeopleApi get_person_by_id GET /people/{id}
PeopleApi get_person_full_by_id GET /people/{id}/full
PeopleApi get_person_manga GET /people/{id}/manga
PeopleApi get_person_pictures GET /people/{id}/pictures
PeopleApi get_person_voices GET /people/{id}/voices
ProducersApi get_producer_by_id GET /producers/{id}
ProducersApi get_producer_external GET /producers/{id}/external
ProducersApi get_producer_full_by_id GET /producers/{id}/full
ProducersApi get_producers GET /producers
RandomApi get_random_anime GET /random/anime
RandomApi get_random_characters GET /random/characters
RandomApi get_random_manga GET /random/manga
RandomApi get_random_people GET /random/people
RandomApi get_random_users GET /random/users
RecommendationsApi get_recent_anime_recommendations GET /recommendations/anime
RecommendationsApi get_recent_manga_recommendations GET /recommendations/manga
ReviewsApi get_recent_anime_reviews GET /reviews/anime
ReviewsApi get_recent_manga_reviews GET /reviews/manga
SchedulesApi get_schedules GET /schedules
SeasonsApi get_season GET /seasons/{year}/{season}
SeasonsApi get_season_now GET /seasons/now
SeasonsApi get_season_upcoming GET /seasons/upcoming
SeasonsApi get_seasons_list GET /seasons
TopApi get_top_anime GET /top/anime
TopApi get_top_characters GET /top/characters
TopApi get_top_manga GET /top/manga
TopApi get_top_people GET /top/people
TopApi get_top_reviews GET /top/reviews
UsersApi get_user_about GET /users/{username}/about
UsersApi get_user_animelist GET /users/{username}/animelist
UsersApi get_user_by_id GET /users/userbyid/{id}
UsersApi get_user_clubs GET /users/{username}/clubs
UsersApi get_user_external GET /users/{username}/external
UsersApi get_user_favorites GET /users/{username}/favorites
UsersApi get_user_friends GET /users/{username}/friends
UsersApi get_user_full_profile GET /users/{username}/full
UsersApi get_user_history GET /users/{username}/history
UsersApi get_user_manga_list GET /users/{username}/mangalist
UsersApi get_user_profile GET /users/{username}
UsersApi get_user_recommendations GET /users/{username}/recommendations
UsersApi get_user_reviews GET /users/{username}/reviews
UsersApi get_user_statistics GET /users/{username}/statistics
UsersApi get_user_updates GET /users/{username}/userupdates
UsersApi get_users_search GET /users
WatchApi get_watch_popular_episodes GET /watch/episodes/popular
WatchApi get_watch_popular_promos GET /watch/promos/popular
WatchApi get_watch_recent_episodes GET /watch/episodes
WatchApi get_watch_recent_promos GET /watch/promos

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

Author

About

Python-based generated Jikan (MyAnimeList) OpenAPI client (Unofficial).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages