Documenation

REST

The REST API Documentation is available here: https://jikan.docs.apiary.io/

Base URL: http://api.jikan.me/

Base URL (SSL): https://api.jikan.me/

Wrappers

Python - JikanPy

Installation

JikanPHP is available on Composer, so get started by requiring it.

composer require jikan-me/jikan

That's it! Now start using it.


$jikan = new Jikan\Jikan;
$anime = $jikan->Anime(1)->response;
$anime = $jikan->Anime(1)->response;
$manga = $jikan->Manga(1, [CHARACTERS])->response;
                                

More examples are available here

Methods

When no matches are found

If you use these methods to fetch a non-existent ID or query that doesn't parse any data, exceptions will be thrown

Anime

This method fetches anime data by ID from https://myanimelist.net/anime/

Parameter(s)
Name Type Description
ID integer The Anime ID on MyAnimeList
Extend Requests constant The available extended parameters for this are EPISODES and CHARACTERS_STAFF
Usage

Considering you've initialized Jikan as $jikan

$jikan->Anime(1);

This stores the parsed data in public $response. To access it: $jikan->response

Examples

$anime = $jikan->Anime(1)->response;

$anime = $jikan->Anime(1, EPISODES)->response;

$anime = $jikan->Anime(1, CHARACTERS_STAFF)->response;

$anime = $jikan->Anime(1, [EPISODES, CHARACTERS_STAFF])->response;

$anime = $jikan->Anime(1, [EPISODES => 2, CHARACTERS_STAFF])->response;

Note: If there's more than 100 episodes for an Anime, MyAnimeList paginates them. You can access that paginated list by their pages. Giving EPISOEDS => 2 will make it fetch the page from the 2nd page, starting from the 101th episode

.

Note 2: The episode_last_page field will tell you how many episodes there are.

Manga

This method fetches manga data by ID from https://myanimelist.net/manga/

Parameter(s)
Name Type Description
ID integer The Manga ID on MyAnimeList
Extend Requests constant The available extended parameters for this is CHARACTERS
Usage

Considering you've initialized Jikan as $jikan

$jikan->Manga(1);

This stores the parsed data in public $response. To access it: $jikan->response

Examples

$anime = $jikan->Manga(1)->response;

$anime = $jikan->Manga(1, CHARACTERS)->response;

Character

This method fetches character data by ID from https://myanimelist.net/character/

Parameter(s)
Name Type Description
ID integer The Character ID on MyAnimeList
Usage

Considering you've initialized Jikan as $jikan

$jikan->Character(1);

This stores the parsed data in public $response. To access it: $jikan->response

Examples

$anime = $jikan->Character(1)->response;

Person

This method fetches person data by ID from https://myanimelist.net/people/

Parameter(s)
Name Type Description
ID integer The Person ID on MyAnimeList
Usage

Considering you've initialized Jikan as $jikan

$jikan->Person(1);

This stores the parsed data in public $response. To access it: $jikan->response

Examples

$anime = $jikan->Person(1)->response;

Search

Unavailable

This feature is not available yet. It is planned to be added in the future.

This method fetches query data by ID from:

https://myanimelist.net/anime.php?q=

https://myanimelist.net/manga.php?q=

https://myanimelist.net/people.php?q=

https://myanimelist.net/character.php?q=

Parameter(s)
Name Type Description
type string anime, manga, character, person
query string The search string
page integer The page of the search result. Set to 1, by default. So you can omit this
Usage

Considering you've initialized Jikan as $jikan

$jikan->search('anime', 'Steins', 1);

This stores the parsed data in public $data. To access it: $jikan->data

Examples

$anime = $jikan->search('manga', 'Kimi No Nawa', 1)->data;

It'll automatically urlencode() the query!

Advanced

Note

Not all flags are added or available yet.

Extend Flags

You can request multiple data from multiple pages using Extend Flags

These are extended data responses to the anime, manga, character and person methods.



Available Flags

Anime
Parent Method Flag Returns
Anime EPISODES Returns the episodes parsed from an anime's episode page. e.g https://myanimelist.net/anime/1/Cowboy_Bebop/episode
Anime CHARACTERS_STAFF Returns the chracters and staff parsed from an anime's character and staff page. e.g https://myanimelist.net/anime/1/Cowboy_Bebop/characters
Anime VIDEOS Returns the videos parsed from an anime's video page. e.g https://myanimelist.net/anime/1/Cowboy_Bebop/video
Anime RECOMMENDATIONS Returns the recommendations parsed from an anime's user recommendation page. e.g https://myanimelist.net/anime/1/Cowboy_Bebop/userrecs
Anime STATS Returns the stats parsed from an anime's stats page. e.g https://myanimelist.net/anime/1/Cowboy_Bebop/stats
Anime PICTURES Returns the picture links parsed from an anime's pictures page. e.g https://myanimelist.net/anime/1/Cowboy_Bebop/pics
Anime MOREINFO Returns the more info data parsed from an anime's more info page. e.g https://myanimelist.net/anime/1/Cowboy_Bebop/moreinfo
Manga
Parent Method Flag Returns
Manga CHARACTERS Returns the chracters and staff parsed from an manga's character and staff page. e.g https://myanimelist.net/manga/1/Monster/characters
Manga RECOMMENDATIONS Returns the recommendations parsed from an manga's user recommendation page. e.g https://myanimelist.net/manga/1/Monster/userrecs
Manga STATS Returns the stats parsed from an manga's stats page. e.g https://myanimelist.net/manga/1/Monster/stats
Manga PICTURES Returns the picture links parsed from an manga's pictures page. e.g https://myanimelist.net/manga/1/Monster/pics
Character
Parent Method Flag Returns
Character PICTURES Returns the picture links parsed from an character's pictures page. e.g https://myanimelist.net/character/1/Spike_Spiegel/pictures
Person
Parent Method Flag Returns
Person PICTURES Returns the picture links parsed from an person's pictures page. e.g https://myanimelist.net/people/1/Tomokazu_Seki/pictures

Usage


$jikan = new Jikan\Jikan;
$anime_and_stats = $jikan->Anime(1, STATS)->data; // makes 2 requests
$anime_all = $jikan->Anime(1, [VIDEOS, EPISODES, RECOMMENDATIONS, STATS, CHARACTERS_STAFF, PICTURES, MOREINFO])->response; // 8 requests!
// This scrapes 8 pages! It will be much slower!
// The data from these chained methods are stored in $jikan->response
                                    

API Development

Did you know that Jikan is modular enough to allow developers to integrate their own search functions within the source? If you're a PHP developer and have substancial knowledge in ReGex then you can easily get started.

How does Jikan work?

It fetches and stores the HTML document of the page as an array. Then it proceeds to loop line-by-line through the array. With this implementation, it checks for searches that are appointed to the current call (e.g anime method). Search

Where do I get started?

I recently re-wrote the entire API. So this section is coming soon.







Happy Developing!