PHP code example of jikan-me / jikan

1. Go to this page and download the library: Download jikan-me/jikan library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jikan-me / jikan example snippets


use Jikan\MyAnimeList\MalClient;
use Jikan\Request\Anime\AnimeRequest;
use Jikan\Request\Search\AnimeSearchRequest;

$client = new MalClient(); // or new MalClient(HttpClientInterface $http) to inject the client

$anime = $client->getAnime(new AnimeRequest(1));          // Cowboy Bebop
$results = $client->getAnimeSearch(new AnimeSearchRequest())->getResults();