PHPackages                             magnum357i/myanimelist-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. magnum357i/myanimelist-api

ActiveLibrary[API Development](/categories/api)

magnum357i/myanimelist-api
==========================

Api for MyAnimeList. It contains: anime, manga, character and people.

v1.0.0.6(5y ago)8472[1 issues](https://github.com/magnum357i/myanimelist-api/issues)MITPHPPHP &gt;=7.0CI failing

Since Jan 25Pushed 5y ago3 watchersCompare

[ Source](https://github.com/magnum357i/myanimelist-api)[ Packagist](https://packagist.org/packages/magnum357i/myanimelist-api)[ RSS](/packages/magnum357i-myanimelist-api/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (1)Versions (11)Used By (0)

myanimelist-api
===============

[](#myanimelist-api)

[![Packagist Version](https://camo.githubusercontent.com/adbf9e96f4484e3d3aff3e2990131d07f717a6dd71a73d2db28dcea49621b1da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61676e756d333537692f6d79616e696d656c6973742d6170692e737667)](https://camo.githubusercontent.com/adbf9e96f4484e3d3aff3e2990131d07f717a6dd71a73d2db28dcea49621b1da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61676e756d333537692f6d79616e696d656c6973742d6170692e737667)[![Codacy Badge](https://camo.githubusercontent.com/693d7562b153df73f34eccfe887c0b6938cf90fc82444398e75801038fee5934/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3632663632613265343365313430656662306661313730326536663137316335)](https://app.codacy.com/app/magnum357i/myanimelist-api?utm_source=github.com&utm_medium=referral&utm_content=magnum357i/myanimelist-api&utm_campaign=Badge_Grade_Dashboard)[![](https://camo.githubusercontent.com/7a6c14db78cc74d3046d477eddac7a2e1feb445bd4b733fddbb5879cf96eb79b/68747470733a2f2f7472617669732d63692e6f72672f6d61676e756d333537692f6d79616e696d656c6973742d6170692e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/7a6c14db78cc74d3046d477eddac7a2e1feb445bd4b733fddbb5879cf96eb79b/68747470733a2f2f7472617669732d63692e6f72672f6d61676e756d333537692f6d79616e696d656c6973742d6170692e7376673f6272616e63683d6d6173746572)[![](https://camo.githubusercontent.com/08055d6cbff6f789627a716c66f0f2551bb677ca58947adedb41b7d9b4c604b8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f6d61676e756d333537692f6d79616e696d656c6973742d6170692e737667)](https://camo.githubusercontent.com/08055d6cbff6f789627a716c66f0f2551bb677ca58947adedb41b7d9b4c604b8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f6d61676e756d333537692f6d79616e696d656c6973742d6170692e737667)[![](https://camo.githubusercontent.com/4c5999eb9e86926a9e8a663692a1747e6ca0077a457c13052c8f2a5495c05396/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d61676e756d333537692f6d79616e696d656c6973742d6170692e737667)](https://camo.githubusercontent.com/4c5999eb9e86926a9e8a663692a1747e6ca0077a457c13052c8f2a5495c05396/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d61676e756d333537692f6d79616e696d656c6973742d6170692e737667)

This is an api developed to get information from MyAnimelist. It works by scanning the html code of the page requested, so this library crashes when it changes.

Required
========

[](#required)

- CURL
- PHP 7

Supported Pages
===============

[](#supported-pages)

- Page
    - [**anime**](#anime-page)
    - [**manga**](#manga-page)
    - [**character**](#character-page)
    - [**people**](#people-page)
- Search
    - [**anime**](#anime-search)
    - [**manga**](#manga-search)
    - [**character**](#character-search)
    - [**people**](#people-search)
- Widget
    - [**new anime**](#new-anime-widget)
    - [**upcoming anime**](#upcoming-anime-widget)
    - [**anime calendar**](#anime-calendar-widget)

How to Install?
===============

[](#how-to-install)

### Via composer

[](#via-composer)

```
$ composer require magnum357i/myanimelist-api
```

### Via git

[](#via-git)

```
$ git clone --depth=50 --branch=master https://github.com/magnum357i/myanimelist-api.git magnum357i/myanimelist-api
```

How to Use?
===========

[](#how-to-use)

### Anime Page

[](#anime-page)

###### Example

[](#example)

```
// Create object
$mal = new \MyAnimeList\Page\Anime( 20 );

// Send request
$mal->sendRequestOrGetData();

// Is not 404 page or (cache enabled) cache file exists
if ( $mal->isSuccess() ) {

   echo $mal->titleOriginal;
   echo $mal->titleEnglish;
   echo $mal->titleJapanese;
   echo $mal->titleOthers;
   echo $mal->poster;
   echo $mal->description;
   echo $mal->category;
   echo $mal->status;
   echo $mal->broadcast;
   echo $mal->statisticRank;
   echo $mal->statisticMember;
   echo $mal->statisticMemberraw;
   echo $mal->statisticPopularity;
   echo $mal->statisticFavorite;
   echo $mal->statisticFavoriteraw;
   echo $mal->rating;
   echo $mal->scoreVote;
   echo $mal->scoreVoteraw;
   echo $mal->scorePoint;
   echo $mal->genres;
   echo $mal->source;
   echo $mal->airedFirst;
   echo $mal->airedLast;
   echo $mal->episode;
   echo $mal->studios;
   echo $mal->duration;
   echo $mal->producers;
   echo $mal->licensors;
   echo $mal->premiered;
   echo $mal->year;
   echo $mal->voice;
   echo $mal->staff;
   echo $mal->songOpening;
   echo $mal->songEnding;
   echo $mal->relatedAdaptation;
   echo $mal->relatedPrequel;
   echo $mal->relatedSequel;
   echo $mal->relatedParentstory;
   echo $mal->relatedSidestory;
   echo $mal->relatedSpinoff;
   echo $mal->relatedAlternativeversion;
   echo $mal->relatedOther;
   echo $mal->relatedSummary;
   echo $mal->relatedAlternativesetting;
   echo $mal->trailer;
   echo $mal->tabBase;
   echo $mal->tabItems;
   echo $mal->link();
}
else {

   echo 'No data.';
}
```

### Manga Page

[](#manga-page)

###### Example

[](#example-1)

```
// Create object
$mal = new \MyAnimeList\Page\Manga( 2 );

// Send request
$mal->sendRequestOrGetData();

// Is not 404 page or (cache enabled) cache file exists
if ( $mal->isSuccess() ) {

   echo $mal->titleOriginal;
   echo $mal->titleEnglish;
   echo $mal->titleJapanese;
   echo $mal->titleOthers;
   echo $mal->poster;
   echo $mal->description;
   echo $mal->type;
   echo $mal->scoreVote;
   echo $mal->scoreVoteraw;
   echo $mal->scorePoint;
   echo $mal->genres;
   echo $mal->statisticRank;
   echo $mal->statisticPopularity;
   echo $mal->statisticMember;
   echo $mal->statisticMemberraw;
   echo $mal->statisticFavorite;
   echo $mal->statisticFavoriteraw;
   echo $mal->status;
   echo $mal->publishedFirst;
   echo $mal->publishedLast;
   echo $mal->authors;
   echo $mal->volume;
   echo $mal->chapter;
   echo $mal->serialization;
   echo $mal->year;
   echo $mal->characters;
   echo $mal->relatedAdaptation;
   echo $mal->relatedSequel;
   echo $mal->relatedPrequel;
   echo $mal->relatedParentstory;
   echo $mal->relatedSidestory;
   echo $mal->relatedOther;
   echo $mal->relatedSpinoff;
   echo $mal->relatedAlternativeversion;
   echo $mal->relatedSummary;
   echo $mal->relatedAlternativesetting;
   echo $mal->tabBase;
   echo $mal->tabItems;
   echo $mal->link();
}
else {

   echo 'No data.';
}
```

### Character Page

[](#character-page)

###### Example

[](#example-2)

```
// Create object
$mal = new \MyAnimeList\Page\Character( 40 );

// Send request
$mal->sendRequestOrGetData();

// Is not 404 page or (cache enabled) cache file exists
if ( $mal->isSuccess() ) {

   echo $mal->titleSelf;
   echo $mal->titleNickname;
   echo $mal->poster;
   echo $mal->description;
   echo $mal->statisticFavorite;
   echo $mal->statisticFavoriteraw;
   echo $mal->recentAnime;
   echo $mal->recentManga;
   echo $mal->voiceactors;
   echo $mal->age;
   echo $mal->height;
   echo $mal->weight;
   echo $mal->tabBase;
   echo $mal->tabItems;
   echo $mal->link();
}
else {

   echo 'No data.';
}
```

### People Page

[](#people-page)

###### Example

[](#example-3)

```
// Create object
$mal = new \MyAnimeList\Page\People( 80 );

// Send request
$mal->sendRequestOrGetData();

// Is not 404 page or (cache enabled) cache file exists
if ( $mal->isSuccess() ) {

   echo $mal->name;
   echo $mal->poster;
   echo $mal->description;
   echo $mal->statisticFavorite;
   echo $mal->statisticFavoriteraw;
   echo $mal->recentVoice;
   echo $mal->recentWork;
   echo $mal->birth;
   echo $mal->death;
   echo $mal->height;
   echo $mal->weight;
   echo $mal->age;
   echo $mal->socialFacebook;
   echo $mal->socialTwitter;
   echo $mal->socialWebsite;
   echo $mal->tabBase;
   echo $mal->tabItems;
   echo $mal->link();
}
else {

   echo 'No data.';
}
```

### Anime Search

[](#anime-search)

###### Example

[](#example-4)

```
// Create object
$mal = new \MyAnimeList\Search\Anime( 'bleach' );

// Send request
$mal->sendRequestOrGetData();

// Is not 404 page or (cache enabled) cache file exists
if ( $mal->isSuccess() ) {

   echo $mal->results;
   echo $mal->link();
}
else {

   echo 'No data.';
}
```

### Manga Search

[](#manga-search)

###### Example

[](#example-5)

```
// Create object
$mal = new \MyAnimeList\Search\Manga( 'baka to test to shoukanjuu' );

// Send request
$mal->sendRequestOrGetData();

// Is not 404 page or (cache enabled) cache file exists
if ( $mal->isSuccess() ) {

   echo $mal->results;
   echo $mal->link();
}
else {

   echo 'No data.';
}
```

### Character Search

[](#character-search)

###### Example

[](#example-6)

```
// Create object
$mal = new \MyAnimeList\Search\Character( 'yugi' );

// Send request
$mal->sendRequestOrGetData();

// Is not 404 page or (cache enabled) cache file exists
if ( $mal->isSuccess() ) {

   echo $mal->results;
   echo $mal->link();
}
else {

   echo 'No data.';
}
```

### People Search

[](#people-search)

###### Example

[](#example-7)

```
// Create object
$mal = new \MyAnimeList\Search\People( 'yui' );

// Send request
$mal->sendRequestOrGetData();

// Is not 404 page or (cache enabled) cache file exists
if ( $mal->isSuccess() ) {

   echo $mal->results;
   echo $mal->link();
}
else {

   echo 'No data.';
}
```

### New Anime Widget

[](#new-anime-widget)

###### Example

[](#example-8)

```
// Create object
$mal = new \MyAnimeList\Widget\NewAnime;

// Send request
$mal->sendRequestOrGetData();

// Is not 404 page or (cache enabled) cache file exists
if ( $mal->isSuccess() ) {

   echo $mal->tvnew;
   echo $mal->tvcontinuing;
   echo $mal->ona;
   echo $mal->ova;
   echo $mal->movie;
   echo $mal->special;
   echo $mal->link();
}
else {

   echo 'No data.';
}
```

### Upcoming Anime Widget

[](#upcoming-anime-widget)

###### Example

[](#example-9)

```
// Create object
$mal = new \MyAnimeList\Widget\UpcomingAnime;

// Send request
$mal->sendRequestOrGetData();

// Is not 404 page or (cache enabled) cache file exists
if ( $mal->isSuccess() ) {

   echo $mal->tv;
   echo $mal->ona;
   echo $mal->ova;
   echo $mal->movie;
   echo $mal->special;
   echo $mal->unknown;
   echo $mal->link();
}
else {

   echo 'No data.';
}
```

### Anime Calendar Widget

[](#anime-calendar-widget)

###### Example

[](#example-10)

```
// Create object
$mal = new \MyAnimeList\Widget\AnimeCalendar;

// Send request
$mal->sendRequestOrGetData();

// Is not 404 page or (cache enabled) cache file exists
if ( $mal->isSuccess() ) {

   echo $mal->monday;
   echo $mal->tuesday;
   echo $mal->wednesday;
   echo $mal->thursday;
   echo $mal->friday;
   echo $mal->saturday;
   echo $mal->sunday;
   echo $mal->link();
}
else {

   echo 'No data.';
}
```

Configuration
=============

[](#configuration)

### Override Default Cache Class

[](#override-default-cache-class)

If needed, you can use your own cache class. Type your cache object to the constructor your cache class which has Cache Interface (MyAnimeList/Cache/CacheInterface).

```
// Page

$folders = \MyAnimeList\Builder\AbstractPage::$folders
$type    = 'anime'
$mal     = new \MyAnimeList\Page\Anime( 20, new \MyCustomCache( $type, $folders ) );

// Search

$folders = \MyAnimeList\Builder\AbstractSearch::$folders
$type    = 'anime'
$mal     = new \MyAnimeList\Search\Anime( 'naruto', new \MyCustomCache( $type, $folders ) );

// Widget

$folders = \MyAnimeList\Builder\AbstractWidget::$folders
$type    = 'animecalendar'
$mal     = new \MyAnimeList\Widget\AnimeCalendar( new \MyCustomCache( $type, $folders ) );
```

### Reverse Names

[](#reverse-names)

```
// Create object
$mal = new \MyAnimeList\Page\Manga( 1 );

// Reverse
$mal->config()->reversename = TRUE;

// Send request
$mal->sendRequestOrGetData();

// Test
echo $mal->authors;

// Output
// reverse name option is true: Naoki Urasawa
// reverse name option is false: Urasawa, Naoki
```

### Bigger Images

[](#bigger-images)

```
// Create object
$mal = new \MyAnimeList\Page\Manga( 1 );

// Use bigger images
$mal->config()->bigimages = TRUE;

// Send request
$mal->sendRequestOrGetData();

// Test
var_dump( $mal->staff );
```

### Enable Cache

[](#enable-cache)

```
// Create object
$mal = new \MyAnimeList\Page\Anime( 1 );

// Enable cache
$mal->config()->enablecache  = TRUE;
$mal->config()->expiredbyday = 5;
$mal->cache()->setPath( ROOT_PATH . '/upload' );

// Send request
$mal->sendRequestOrGetData();

// Test
echo $mal->titleEnglish;
echo $mal->poster;

// Note
// Backs up the values you use.
// So, based on the above values, this will be create a file named 1.json
// and inside of the file writes the english title of the anime.
// Also a poster named 1.jpg is saved.
// After all, it will return false even if you call another value until the cache expires.
// Please don't forget this.
```

### Capture All Data at Once

[](#capture-all-data-at-once)

```
// Create object
$mal = new \MyAnimeList\Page\Manga( 20 );

// Send request
$mal->sendRequestOrGetData();

// Get all data
$mal->scanAvailableValues();

// Print data
var_dump( $mal->output() );
```

### cURL Settings

[](#curl-settings)

```
// Create object
$mal = new \MyAnimeList\Page\People( 1 );

// A sample setting
$mal->config()->setCurlOption( 'Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0', 'USERAGENT' );

// Send request
$mal->sendRequestOrGetData();
```

### Limitation

[](#limitation)

```
// Create object
$mal = new \MyAnimeList\Page\Anime( 285 );

// Send request
$mal->sendRequestOrGetData();

$mal->setLimit( 3 ); // works for all indexed arrays

var_dump( $mal->voice );
```

### Timezone for Broadcast

[](#timezone-for-broadcast)

```
// Create object
$mal = new \MyAnimeList\Page\Anime( 34134 );

// Send request
$mal->sendRequestOrGetData();

// Print untoched broadcast
var_dump( $mal->broadcast ); // [ "timezone" => "Asia/Tokyo", "dayIndex" => "3", "dayTitle" => "Wednesdays", "hour" => "01", "minute" => "35"

// Print broadcast with default timezone
// my default timezone: 'Europe/Berlin'
$mal->timezone();
var_dump( $mal->broadcast ); // [ "timezone" => "Europe/Berlin", "dayIndex" => "2", "dayTitle" => "Tuesdays", "hour" => "18", "minute" => "35"

// Print broadcast with custom timezone
$mal->timezone( 'America/Los_Angeles' );
var_dump( $mal->broadcast ); // [ "timezone" => "America/Los_Angeles", "dayIndex" => "2", "dayTitle" => "Tuesdays", "hour" => "09", "minute" => "35"
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 97.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~67 days

Recently: every ~118 days

Total

10

Last Release

2056d ago

Major Versions

v0.9.9 → v1.0.0.02019-05-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/a92c9ee58e652067c658a0796cae80afb869c4b5bc4670d7b19ea4689677fd04?d=identicon)[magnum357i](/maintainers/magnum357i)

---

Top Contributors

[![magnum357i](https://avatars.githubusercontent.com/u/19434964?v=4)](https://github.com/magnum357i "magnum357i (39 commits)")[![codacy-badger](https://avatars.githubusercontent.com/u/23704769?v=4)](https://github.com/codacy-badger "codacy-badger (1 commits)")

---

Tags

animeapicharactermalmangamyanimelistpeoplescrapersearchwidget

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/magnum357i-myanimelist-api/health.svg)

```
[![Health](https://phpackages.com/badges/magnum357i-myanimelist-api/health.svg)](https://phpackages.com/packages/magnum357i-myanimelist-api)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
