Documenation

Last updated: May 19th, 2017

REST

The REST requests are GET based and you can process them without any authentication. It's simple and direct.

Rate Limiting

To maintain bandwidth, there's a rate-limiting of 2,000 requests per IP per day. Be sure to cache your data!

Documentation Is WIP

The documentation is still in works!

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

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

Usage

Anime

Anime information can be fetched through the following request

GET

GET anime/:id

Parameters
Name Type Description
ID integer The Anime ID on MyAnimeList
Response

Example: GET anime/1


Status: 200 OK


{  
   "link_canonical":"https:\/\/myanimelist.net\/anime\/1\/Cowboy_Bebop",
   "synopsis":"In the year 2071, humanity has colonized several of the planets and moons of the solar system leaving the now uninhabitable surface of planet Earth behind. The Inter Solar System Police attempts to keep peace in the galaxy, aided in part by outlaw bounty hunters, referred to as "Cowboys". The ragtag team aboard the spaceship Bebop are two such individuals. Mellow and carefree Spike Spiegel is balanced by his boisterous, pragmatic partner Jet Black as the pair makes a living chasing bounties and collecting rewards. Thrown off course by the addition of new members that they meet in their travels\u2014Ein, a genetically engineered, highly intelligent Welsh Corgi; femme fatale Faye Valentine, an enigmatic trickster with memory loss; and the strange computer whiz kid Edward Wong\u2014the crew embarks on thrilling adventures that unravel each member's dark and mysterious past little by little. Well-balanced with high density action and light-hearted comedy, Cowboy Bebop is a space Western classic and an homage to the smooth and improvised music it is named after. [Written by MAL Rewrite]",
   "title":"Cowboy Bebop",
   "image":"https:\/\/myanimelist.cdn-dena.com\/images\/anime\/4\/19644.jpg",
   "japanese":"\u30ab\u30a6\u30dc\u30fc\u30a4\u30d3\u30d0\u30c3\u30d7",
   "episodes":26,
   "status":"Finished Airing",
   "aired":"Apr 3, 1998 to Apr 24, 1999",
   "premiered":"Spring 1998",
   "broadcast":"Saturdays at 01:00 (JST)",
   "producers":[  
      "23\/Bandai_Visual",
      "Bandai Visual"
   ],
   "licensors":[  
      [  
         "102\/FUNimation_Entertainment",
         "FUNimation Entertainment"
      ],
      [  
         "233\/Bandai_Entertainment",
         "Bandai Entertainment"
      ]
   ],
   "studios":[  
      "14\/Sunrise",
      "Sunrise"
   ],
   "source":"Original",
   "genres":[  
      [  
         "1\/Action",
         "Action"
      ],
      [  
         "24\/Sci-Fi",
         "Sci-Fi"
      ],
      [  
         "2\/Adventure",
         "Adventure"
      ],
      [  
         "29\/Space",
         "Space"
      ],
      [  
         "4\/Comedy",
         "Comedy"
      ],
      [  
         "8\/Drama",
         "Drama"
      ]
   ],
   "duration":"24 min. per ep.",
   "rating":"R - 17+ (violence & profanity)",
   "score":[  
      8.82,
      291224
   ],
   "ranked":21,
   "popularity":33,
   "members":544586,
   "favorites":32183,
   "related":{  
      "Adaptation":[  
         [  
            "Cowboy Bebop",
            "\/manga\/173\/Cowboy_Bebop"
         ],
         [  
            "Shooting Star Bebop: Cowboy Bebop",
            "\/manga\/174\/Shooting_Star_Bebop__Cowboy_Bebop"
         ]
      ],
      "Side story":[  
         [  
            "Cowboy Bebop: Tengoku no Tobira",
            "\/anime\/5\/Cowboy_Bebop__Tengoku_no_Tobira"
         ],
         [  
            "Cowboy Bebop: Ein no Natsuyasumi",
            "\/anime\/17205\/Cowboy_Bebop__Ein_no_Natsuyasumi"
         ]
      ],
      "Summary":[  
         "Cowboy Bebop: Yose Atsume Blues",
         "\/anime\/4037\/Cowboy_Bebop__Yose_Atsume_Blues"
      ]
   }
}
                                            

Manga

Manga information can be fetched through the following request

GET

GET manga/:id

Parameters
Name Type Description
ID integer The Manga ID on MyAnimeList
Response

GET manga/1


Status: 200 OK


{  
   "link_canonical":"https:\/\/myanimelist.net\/manga\/1\/Monster",
   "title":"Monster",
   "japanese":"MONSTER",
   "image":"https:\/\/myanimelist.cdn-dena.com\/images\/manga\/3\/54525.jpg",
   "volumes":18,
   "chapters":162,
   "published":"Dec  5, 1994 to Dec  20, 2001",
   "genres":[  
      [  
         "7\/Mystery",
         "Mystery"
      ],
      [  
         "8\/Drama",
         "Drama"
      ],
      [  
         "40\/Psychological",
         "Psychological"
      ],
      [  
         "41\/Seinen",
         "Seinen"
      ]
   ],
   "authors":[  
      "\/people\/1867\/Naoki_Urasawa",
      "Urasawa, Naoki",
      "(Story & Art)"
   ],
   "serialization":[  
      "\/manga\/magazine\/1\/Big_Comic_Original\" title=\"Big Comic Original",
      "Big Comic Original"
   ],
   "ranked":5,
   "popularity":61,
   "members":50749,
   "related":{  
      "Side story":[  
         "Mou Hitotsu no Monster: The Investigative Report",
         "\/manga\/10968\/Mou_Hitotsu_no_Monster__The_Investigative_Report"
      ],
      "Adaptation":[  
         "Monster",
         "\/anime\/19\/Monster"
      ]
   }
}
                                            

Character

Character information can be fetched through the following request

GET

GET character/:id

Parameters
Name Type Description
ID integer The Character ID on MyAnimeList
Response

GET character/1


Status: 200 OK


{  
   "animeography":[  
      {  
         "name":"Cowboy Bebop",
         "link":"\/anime\/1\/Cowboy_Bebop",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/anime\/4\/19644.jpg?s=8f2f27c5fab61dac8caf24fe37651c9a"
      },
      {  
         "name":"Cowboy Bebop: Tengoku no Tobira",
         "link":"\/anime\/5\/Cowboy_Bebop__Tengoku_no_Tobira",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/anime\/6\/14331.jpg?s=1f1f288401369f02a729919dc37b017b"
      },
      {  
         "name":"Cowboy Bebop: Yose Atsume Blues",
         "link":"\/anime\/4037\/Cowboy_Bebop__Yose_Atsume_Blues",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/anime\/10\/54341.jpg?s=ad2fb8157adfaa6c67008ef66200e004"
      }
   ],
   "mangaography":[  
      {  
         "name":"Cowboy Bebop",
         "link":"\/manga\/173\/Cowboy_Bebop",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/manga\/5\/166652.jpg?s=84a3e1d5fff9652418f224a81ae8b042"
      },
      {  
         "name":"Shooting Star Bebop: Cowboy Bebop",
         "link":"\/manga\/174\/Shooting_Star_Bebop__Cowboy_Bebop",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/manga\/3\/176770.jpg?s=27a6072c91cf6e34e2388734c4089f56"
      }
   ],
   "member-favorites":20278,
   "name":"Spike Spiegel",
   "name-japanese":"(\u30b9\u30d1\u30a4\u30af\u30fb\u30b9\u30d4\u30fc\u30b2\u30eb)",
   "about":"Birthdate: June 26, 2044\n Height: 185 cm (6' 1\")\n Weight: 70 kg (155 lbs)\n Blood type: O\n Planet of Origin: Mars\n \n Spike Spiegel is a tall and lean 27-year-old bounty hunter born on Mars. The inspiration for Spike is found in martial artist Bruce Lee who uses the martial arts style of Jeet Kune Do as depicted in Session 8, \"Waltz For Venus\". He has fluffy, dark green hair (which is inspired by Yusaku Matsuda's) and reddish brown eyes, one of which is artificial and lighter than the other. He is usually dressed in a blue leisure suit, with a yellow shirt and Lupin III inspired boots. A flashback in Session 6 revealed it was his fully functioning right eye which was surgically replaced by the cybernetic one (although Spike himself may not have conscious recollection of the procedure since he claims to have lost his natural eye in an \"accident\"). One theory is that his natural eye may have been lost during the pre-series massacre in which he supposedly \"died\". The purpose of this cybernetic eye is never explicitly stated, though it apparently gives him exceptional hand-eye coordination - particularly with firearms (Spike's gun of choice is a Jericho 941, as seen throughout the series). In the first episode, when facing a bounty-head using Red Eye, Spike mocks him, calling his moves \"too slow\". At first, this seems like posturing on Spike's part, but even with his senses and reflexes accelerated to superhuman levels by the drug, the bounty cannot even touch Spike. A recurring device throughout the entire show is a closeup on Spike's fully-natural left eye before dissolving to a flashback of his life as part of the syndicate. As said by Spike himself in the last episode, his right eye \"only sees the present\" and his left eye \"only sees the past.\" Spike often has a bent cigarette between his lips, sometimes despite rain or \"No Smoking\" signs.\n\n",
   "voice-actors":[  
      {  
         "name":"Yamadera, Kouichi",
         "link":"\/people\/11\/Kouichi_Yamadera",
         "image":"https:\/\/myanimelist.cdn-dena.com\/images\/voiceactors\/3\/44674v.jpg",
         "language":"Japanese"
      },
      {  
         "name":"Blum, Steven",
         "link":"\/people\/12\/Steven_Blum",
         "image":"https:\/\/myanimelist.cdn-dena.com\/images\/voiceactors\/3\/45741v.jpg",
         "language":"English"
      },
      {  
         "name":"De ambrosis, Massimo",
         "link":"\/people\/781\/Massimo_De_ambrosis",
         "image":"https:\/\/myanimelist.cdn-dena.com\/images\/voiceactors\/2\/834v.jpg",
         "language":"Italian"
      },
      {  
         "name":"Briggs, Guilherme",
         "link":"\/people\/1099\/Guilherme_Briggs",
         "image":"https:\/\/myanimelist.cdn-dena.com\/images\/voiceactors\/1\/40583v.jpg",
         "language":"Brazilian"
      },
      {  
         "name":"Neumann, Viktor",
         "link":"\/people\/1638\/Viktor_Neumann",
         "image":"https:\/\/myanimelist.cdn-dena.com\/images\/voiceactors\/3\/1545v.jpg",
         "language":"German"
      },
      {  
         "name":"Juh\u00e1sz, Zolt\u00e1n",
         "link":"\/people\/7787\/Zolt\u00e1n_Juh\u00e1sz",
         "image":"https:\/\/myanimelist.cdn-dena.com\/images\/voiceactors\/2\/39244v.jpg",
         "language":"Hungarian"
      },
      {  
         "name":"Pichon, Yann",
         "link":"\/people\/9237\/Yann_Pichon",
         "image":"https:\/\/myanimelist.cdn-dena.com\/images\/voiceactors\/3\/21161v.jpg",
         "language":"French"
      },
      {  
         "name":"Atala, Yamil",
         "link":"\/people\/10028\/Yamil_Atala",
         "image":"https:\/\/myanimelist.cdn-dena.com\/images\/voiceactors\/3\/14505v.jpg",
         "language":"Spanish"
      },
      {  
         "name":"Gu, Ja hyeong",
         "link":"\/people\/14781\/Ja_hyeong_Gu",
         "image":"https:\/\/myanimelist.cdn-dena.com\/images\/voiceactors\/1\/18217v.jpg",
         "language":"Korean"
      },
      {  
         "name":"Halm, Martin",
         "link":"\/people\/23627\/Martin_Halm",
         "image":"https:\/\/myanimelist.cdn-dena.com\/images\/voiceactors\/2\/26401v.jpg",
         "language":"German"
      },
      {  
         "name":"Pera, Joan",
         "link":"\/people\/24991\/Joan_Pera",
         "image":"https:\/\/myanimelist.cdn-dena.com\/images\/voiceactors\/3\/27593v.jpg",
         "language":"Spanish"
      },
      {  
         "name":"Mullenaerts, Bruno",
         "link":"\/people\/25903\/Bruno_Mullenaerts",
         "image":"https:\/\/myanimelist.cdn-dena.com\/images\/questionmark_23.gif",
         "language":"French"
      }
   ]
}
                                            

Person

Person information can be fetched through the following request

GET

GET person/:id

Parameters
Name Type Description
ID integer The Person ID on MyAnimeList
Response

GET person/35252


Status: 200 OK

{  
   "animeography":[  
      {  
         "name":"Steins;Gate",
         "link":"\/anime\/9253\/Steins_Gate",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/anime\/5\/73199.jpg?s=55684557b3d8bf741757d84d768beb29"
      },
      {  
         "name":"Steins;Gate: Oukoubakko no Poriomania",
         "link":"\/anime\/10863\/Steins_Gate__Oukoubakko_no_Poriomania",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/anime\/7\/36531.jpg?s=c2adf71f17ff2563175268064765e747"
      },
      {  
         "name":"Steins;Gate Movie: Fuka Ryouiki no D\u00e9j\u00e0 vu",
         "link":"\/anime\/11577\/Steins_Gate_Movie__Fuka_Ryouiki_no_D\u00e9j\u00e0_vu",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/anime\/3\/50317.jpg?s=4ca635a9e67f3c25cbba115b171a4cd5"
      },
      {  
         "name":"Steins;Gate: Soumei Eichi no Cognitive Computing",
         "link":"\/anime\/27957\/Steins_Gate__Soumei_Eichi_no_Cognitive_Computing",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/anime\/10\/71319.jpg?s=f03a1484e5c49afa157bd3875781dc8f"
      },
      {  
         "name":"Steins;Gate 0",
         "link":"\/anime\/30484\/Steins_Gate_0",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/anime\/4\/77633.jpg?s=e494cb89e0c9056698be3f29ed50e54e"
      },
      {  
         "name":"Steins;Gate: Kyoukaimenjou no Missing Link - Divide By Zero",
         "link":"\/anime\/32188\/Steins_Gate__Kyoukaimenjou_no_Missing_Link_-_Divide_By_Zero",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/anime\/7\/77324.jpg?s=1ef80202a3d120f192111b695e389cf3"
      }
   ],
   "mangaography":[  
      {  
         "name":"Steins;Gate",
         "link":"\/manga\/17517\/Steins_Gate",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/manga\/1\/121341.jpg?s=b32b5faf9e172d303f2e06a291d392dd"
      },
      {  
         "name":"Steins;Gate: Boukan no Rebellion",
         "link":"\/manga\/20699\/Steins_Gate__Boukan_no_Rebellion",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/manga\/1\/41878.jpg?s=082f2e8a7606b5d940aee64dcaf90e51"
      },
      {  
         "name":"Steins;Gate: Hiyoku Renri no Sweets Honey",
         "link":"\/manga\/27965\/Steins_Gate__Hiyoku_Renri_no_Sweets_Honey",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/manga\/2\/150465.jpg?s=0f2f341a36103cd6c1b2e32f3dffdfa5"
      },
      {  
         "name":"Steins;Gate: Shijou Saikyou no Slight Fever",
         "link":"\/manga\/28897\/Steins_Gate__Shijou_Saikyou_no_Slight_Fever",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/manga\/3\/46369.jpg?s=aaa7cd54b1da8ddc980befb67090a4d1"
      },
      {  
         "name":"Steins;Gate: Onshuu no Brownian Motion",
         "link":"\/manga\/28899\/Steins_Gate__Onshuu_no_Brownian_Motion",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/manga\/1\/149165.jpg?s=f4cfe00590a4445549b721e685035d96"
      },
      {  
         "name":"Steins;Gate",
         "link":"\/manga\/39859\/Steins_Gate",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/manga\/3\/72649.jpg?s=09ad3cf91fcd54a85a4cacb76986236e"
      },
      {  
         "name":"Steins;Gate: Youen no Valhalla",
         "link":"\/manga\/47417\/Steins_Gate__Youen_no_Valhalla",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/manga\/2\/83621.jpg?s=0e4115028876a9134797a7f5845f58d6"
      },
      {  
         "name":"Steins;Gate: Aishin Meizu no Babel",
         "link":"\/manga\/47825\/Steins_Gate__Aishin_Meizu_no_Babel",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/manga\/2\/84307.jpg?s=7c91513590cfe6d1b2111e770e0bb759"
      },
      {  
         "name":"Steins;Gate: Heiji Kyokusen no Epigraph",
         "link":"\/manga\/49381\/Steins_Gate__Heiji_Kyokusen_no_Epigraph",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/manga\/1\/121181.jpg?s=8cd345c7c95413bdc6d2558c4109562d"
      },
      {  
         "name":"Steins;Gate: Heni Kuukan no Octet",
         "link":"\/manga\/51945\/Steins_Gate__Heni_Kuukan_no_Octet",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/manga\/1\/91575.jpg?s=b34e3e144847ed210bee8bf5e9d49955"
      },
      {  
         "name":"Steins;Gate: Eigou Kaiki no Pandora",
         "link":"\/manga\/59669\/Steins_Gate__Eigou_Kaiki_no_Pandora",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/manga\/1\/175916.jpg?s=f9734bda3bd9fa29ccfece9cfbb2847d"
      },
      {  
         "name":"Gekijouban Steins;Gate: Fuka Ryouiki no D\u00e9j\u00e0 vu",
         "link":"\/manga\/62951\/Gekijouban_Steins_Gate__Fuka_Ryouiki_no_D\u00e9j\u00e0_vu",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/manga\/3\/108051.jpg?s=98485f7ee75fe57f47dcae174a7bc52e"
      },
      {  
         "name":"Steins;Gate: Hiyoku Renri no Future Honey",
         "link":"\/manga\/74595\/Steins_Gate__Hiyoku_Renri_no_Future_Honey",
         "image":"https:\/\/myanimelist.cdn-dena.com\/r\/23x32\/images\/manga\/3\/129319.jpg?s=17e5b9ef6b3af605cf94adfb780f7114"
      }
   ],
   "member-favorites":32071,
   "name":"Rintarou Okabe",
   "name-japanese":"(\u5ca1\u90e8 \u502b\u592a\u90ce)",
   "about":"Age: 18\n Birthdate: December 14\n Height: 177 cm (5'10\")\n Weight: 60 kg\n \n Okabe Rintarou is the main protagonist of Steins;Gate. He is a first year student attending Tokyo Denki University, and calls himself a Crazy Mad Scientist. He acts like a villain, but is rather immature as he frequently shows traits of Chunibyou (\u4e2d\u4e8c\u75c5) syndrome despite being a grown-up man. After enrolling in university, he went to Akihabara to open up a laboratory called the \"Future Gadget Research Establishment,\" where he invents gadgets that are rather useless. He also talks to himself on the cellphone, his words not making much sense. Supposedly, he has very few friends that can understand what he's talking about.\n \n Okabe often refers to himself as, \"Hououin Kyouma\" (\u9cf3\u51f0\u9662\u51f6\u771f).\n \n However, Mayuri and Daru just call him \"Okarin\" (\u30aa\u30ab\u30ea\u30f3), abbreviated after his name.\n \n The phrase he uses to end conversations, particularly with himself, is \"El Psy Congroo\" (\u30a8\u30eb\u30fb\u30d7\u30b5\u30a4\u30fb\u30b3\u30f3\u30b0\u30eb\u30a5).\n \n Eventually, he falls in love with, and confesses to Makise Kurisu.\n In the future of the Alpha world line, Okabe became the leader of the resistance against SERN's rule, and was known as an international terrorist (in the side story \"\"The Far Valhalla,\"\" it's revealed that SERN released Okabe and Daru so that they could found the resistance, thus completing the cycle of fate). Okabe got captured by SERN's Rounder unit in 2025 and was tortured to death.\n In the events of Deja Vu, Makise Kurisu is the one who gives Okabe the backstory and name of Hououin Kyouma.\n (Source: naomi.thewafflehouse.net)\n\n",
   "voice-actors":[  
      {  
         "name":"Miyano, Mamoru",
         "link":"\/people\/65\/Mamoru_Miyano",
         "image":"https:\/\/myanimelist.cdn-dena.com\/images\/voiceactors\/1\/42141v.jpg",
         "language":"Japanese"
      },
      {  
         "name":"Tatum, John Michael",
         "link":"\/people\/1602\/John_Michael_Tatum",
         "image":"https:\/\/myanimelist.cdn-dena.com\/images\/voiceactors\/3\/48126v.jpg",
         "language":"English"
      },
      {  
         "name":"Chevalier, Davide",
         "link":"\/people\/1678\/Davide_Chevalier",
         "image":"https:\/\/myanimelist.cdn-dena.com\/images\/voiceactors\/2\/1577v.jpg",
         "language":"Italian"
      },
      {  
         "name":"Hong, Si Ho",
         "link":"\/people\/15099\/Si_Ho_Hong",
         "image":"https:\/\/myanimelist.cdn-dena.com\/images\/voiceactors\/1\/32273v.jpg",
         "language":"Korean"
      },
      {  
         "name":"Wilhelm, Marc",
         "link":"\/people\/26419\/Marc_Wilhelm",
         "image":"https:\/\/myanimelist.cdn-dena.com\/images\/questionmark_23.gif",
         "language":"French"
      },
      {  
         "name":"Gavrilis, Marios",
         "link":"\/people\/40188\/Marios_Gavrilis",
         "image":"https:\/\/myanimelist.cdn-dena.com\/images\/voiceactors\/1\/41146v.jpg",
         "language":"German"
      }
   ]
}
                                            

Extended

Adding a few more parameters to your anime/manga/character/person requests to have them fetch more details from dedicated pages such as the Videos, Episodes, Reviews, Recommendations, Stats, Characters, Staff, Pictures and More Info pages!

Unavailable

This feature is unavailable right now, it's planned to be released by Jikan Source ver 0.2

Download

Download the Jikan PHP Library and start using it with your PHP applications!

Download Source

Installation

Step 1

After you've finished downloading/cloning from GitHub, extract the zip and you'll see jikan.php. This is the main library/class and you can get started by including it in your project!

Add it to your project

require_once 'jikan.php';

Step Two

Create the object via the namespace


$jikan = new \Jikan\Get;
                                    

Step Three

Start using it!

Example

$anime = $jikan->anime(1)->data;
$manga = $jikan->manga(1)->reviews()->characters()->data;
                                    

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, then the return value is false

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
Usage

Considering you've initialized Jikan as $jikan

$jikan->anime(1);

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

Examples

$anime = $jikan->anime(1)->data;

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
Usage

Considering you've initialized Jikan as $jikan

$jikan->manga(1);

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

Examples

$anime = $jikan->manga(1)->data;

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 $data. To access it: $jikan->data

Examples

$anime = $jikan->character(1)->data;

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 $data. To access it: $jikan->data

Examples

$anime = $jikan->person(1)->data;

Search

Unavailable

This feature is not available yet. It's planned to be released by Jikan Source ver.1.0.0

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

Unavailable

This feature is not available yet. It's planned to be completely released by Jikan Source ver.1.0.0

Chaining Methods

Chaining methods is the source alternative to extended search in the REST API. This is the backbone of it, basically.

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



Available Chains

Anime
Parent Method Chain Returns
anime videos Returns the videos parsed from an anime's video page. e.g https://myanimelist.net/anime/1/Cowboy_Bebop/video
anime episodes Returns the episodes parsed from an anime's episode page. e.g https://myanimelist.net/anime/1/Cowboy_Bebop/episode
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 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 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 Chain Returns
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 characters_staff Returns the chracters and staff parsed from an manga's character and staff page. e.g https://myanimelist.net/manga/1/Monster/characters
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 Chain 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 Chain 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\Get;
$anime_and_stats = $jikan->anime(1)->stats()->data; // makes 2 requests
$anime_most = $jikan->anime(1)->videos()->episodes()->recommendations()->stats()->characters_staff()->pictures()->moreinfo()->data; // 8 requests!
// This scrapes 8 pages! It will be much slower!
// The data from these chained methods are stored in $jikan->data

// Improper usage
$character = $jikan->character(1)->episodes(); // won't work obviously. It will return false for the the data stored in $jikan->data['episodes']
                                    

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?

If you check the methods, you'll find that a similar lining of codes start after this line in each of the main methods.


if (!empty($this->data)) {
  unset($this->data);
  $this->data = array();
}
                                    

The similar lines of code I'm talking about would be something like this


$this->setSearch("link-canonical", "//", function(){
  return $this->matches[1];
});
                                    

And after all these patterns, the method ends like this


$this->data = array();

foreach ($this->link_arr as $lineNo => $line) {
  $this->line = $line;
  $this->lineNo = $lineNo;
  
  $this->find();
}

unset($this->matches);
$this->matches = array();

$this->data = (empty($this->data)) ? false : $this->data;

return $this;
                                    

The $this->setSearch allots something we're looking for to the search array. And Jikan finds looks line-by-line to find that. It does this using ReGex patterns. Once that pattern is found, it's considered as a 'found' item and the loop doesn't include it in the next search.

Setting the search

The method for this is $this->setSearch($index, $regex, $func, $args=null)

$index is a name you can give to the thing you're looking for. It needs to be unique. If this search is for the anime's title then I'd set $index as 'anime-title'. Be sure to use - or _ as replacement for spaces as it gets stored as the array key. This needs to be a string.

$regex is the pattern you want it to find within the document. This needs to be a valid ReGex string

$function is the function that is executed if the pattern is matched. This needs to be a function.

$args are the arguments you need to pass incase your function has any. This doesn't have much of use, I'll tell you why.

Usually, you would want to pass the current line's argument or something but that's not needed.

Internal Variables

These are internal variables you can access for returning functions of search matches.

$this->link_arr is the array full of the HTML document line by line.

$this->lineNo is the current line the loop is on.

So, if I wanted to get the next line on a certain match, I would do this

$nextLine = $this->link_arr[$this->lineNo+1]

And finally, the main part.

$this->matches contains all the (*) grouped searches the pattern consists. Everything is returned to this variable.

An example

Lets consider the line we're on is:

< blah id="someContainer">Some Data< /blah>


$this->setSearch('foo', '~id="someContainer">(.*)<~', function() {
  return $this->matches[1];
});
                                    

This search parameter would return Some Data to $this->data keyed as foo

You'd be able to access it via $this->data['foo']


echo $this->data['foo']; // "Some Data"
                                    

JSONify

You can JSONify the returned array through a built in method json


$jikan = new \Jikan\Get;
$jikan->anime(1);
$data = $jikan->data;
$data_json = $jikan->json(); // no parameters need to be passed as it jsonifys $this->data
                                    

Although, you can do the same thing through PHP via json_encode, which is the same procedure in the json method.

Caching

So, you've got a 2,000 daily request limit and this is needed to maintain bandwidth. You need to cache the data you request to have a faster application or perhaps you have a lot of users on your end. Therefore it's required to cache the data you request. Even the Jikan REST API does this.


I have made a small PHP class that does this. It caches PHP arrays into serialized JSON and stores them. You can download it and learn how to use it right from its repository.

Download






Happy Developing!