PHPackages                             detain/phlix-plugin-myanimelist - 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. detain/phlix-plugin-myanimelist

ActivePhlix-plugin[API Development](/categories/api)

detain/phlix-plugin-myanimelist
===============================

MyAnimeList metadata provider — anime titles, descriptions, episodes, ratings via the MAL API v2.

v0.2.0(1mo ago)10MITPHPPHP &gt;=8.3CI passing

Since Jul 11Pushed 3w agoCompare

[ Source](https://github.com/detain/phlix-plugin-myanimelist)[ Packagist](https://packagist.org/packages/detain/phlix-plugin-myanimelist)[ Docs](https://github.com/detain/phlix-plugin-myanimelist)[ RSS](/packages/detain-phlix-plugin-myanimelist/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

phlix-plugin-myanimelist
========================

[](#phlix-plugin-myanimelist)

[![tests](https://github.com/detain/phlix-plugin-myanimelist/actions/workflows/test.yml/badge.svg)](https://github.com/detain/phlix-plugin-myanimelist/actions/workflows/test.yml)

> MyAnimeList metadata provider plugin for [Phlix](https://github.com/detain/phlix)— anime titles, descriptions, episodes, ratings via the MyAnimeList API v2.

Overview
--------

[](#overview)

This plugin fetches structured anime metadata from [MyAnimeList](https://myanimelist.net/)using the official **MAL API v2** (`https://api.myanimelist.net/v2`):

1. **Search** (`GET /anime?q=...`) — resolve a filename to a MAL anime ID
2. **Details** (`GET /anime/{id}?fields=...`) — fetch titles, synopsis, episodes, rating, studio

Every request carries an `X-MAL-CLIENT-ID` header with your MAL client ID.

Features
--------

[](#features)

- **Title search** — query MAL for the best-matching anime ID
- **Full metadata** — primary/English/Japanese titles, synonyms, genres, year, type, rating
- **Episode info** — episode count and average episode runtime
- **Synopsis** — long-form description text
- **No SDK** — plain HTTP/JSON over the PHP stream wrapper; no extra dependencies

Install
-------

[](#install)

The plugin is unsigned by design. Install via the Phlix admin UI:

1. Log in to your Phlix server as an admin user (`users.is_admin = 1`).
2. Browse to `/admin/plugins`.
3. Paste this URL into the **Install from URL** form:

    ```
    https://raw.githubusercontent.com/detain/phlix-plugin-myanimelist/main/plugin.json

    ```
4. The server downloads and validates the manifest, runs `composer install --no-dev`, and stores a row in the `plugins` table.
5. Configure your MyAnimeList client ID in the plugin settings form.
6. Enable the plugin.

### Getting a MAL Client ID

[](#getting-a-mal-client-id)

1. Sign in at [myanimelist.net](https://myanimelist.net/).
2. Go to [API → Create ID](https://myanimelist.net/apiconfig).
3. Create an app and copy the **Client ID** (the Client Secret is not needed for read-only metadata).

Configuration
-------------

[](#configuration)

Configure these in the Phlix admin **Plugins → Configure** dialog.

SettingTypeRequiredDefaultDescription`client_id`string (secret)**Yes**—Your MyAnimeList API Client ID, sent as the `X-MAL-CLIENT-ID` header.`use_ssl_verification`booleanNo`true`Verify TLS certificates when calling the MAL API.### Where to get your Client ID

[](#where-to-get-your-client-id)

Create an API application at [myanimelist.net/apiconfig](https://myanimelist.net/apiconfig)(App Type "web" or "other"), then copy its **Client ID** into `client_id`.

How It Works
------------

[](#how-it-works)

When the MetadataManager calls `lookup($filePath)`:

1. **Parse filename** — extract anime title from file path (strips S##E##, group tags, resolution suffixes)
2. **Search** — `GET /anime?q=&limit=10` and take the first result's ID
3. **Fetch details** — `GET /anime/{id}?fields=...` for full anime data
4. **Map response** — translate the MAL JSON layout to MetadataManager's expected return shape

MAL API Notes
-------------

[](#mal-api-notes)

- **Protocol**: REST/JSON over HTTPS to `https://api.myanimelist.net/v2`
- **Auth**: every request sends `X-MAL-CLIENT-ID: `
- **Search**: `GET /anime?q=&limit=10` → `{ "data": [ { "node": { "id", "title", ... } } ] }`
- **Details**: `GET /anime/{id}?fields=id,title,main_picture,alternative_titles,start_date,synopsis,mean,num_scoring_users,genres,num_episodes,media_type,status,studios,average_episode_duration,rating`

See the [MAL API v2 reference](https://myanimelist.net/apiconfig/references/api/v2) for full details.

Data Returned
-------------

[](#data-returned)

```
[
    'title'         => 'Cowboy Bebop',          // Primary title
    'original_name' => 'カウボーイビバップ',       // Japanese title (falls back to title)
    'overview'      => 'In the year 2071...',   // Synopsis
    'year'          => 1998,                     // First-aired year
    'genres'        => ['Action', 'Sci-Fi'],     // Genre names
    'rating'        => 8.75,                     // MAL mean score (0-10)
    'vote_count'    => 900000,                   // Number of scoring users
    'poster_url'    => 'https://cdn.myanimelist.net/images/anime/4/19644l.jpg',
    'fanart_url'    => null,                      // MAL has no fanart/backdrop
    'episodes'      => 26,                        // Episode count
    'type'          => 'tv',                      // tv / movie / ova / special / ona / music
    'mal_id'        => 1,                         // MyAnimeList anime ID
    'titles'        => ['Cowboy Bebop', 'カウボーイビバップ', 'Cowboy Bebop (1998)'],
    'status'        => 'Finished',               // Finished / Currently Airing / Upcoming
    'runtime_ticks' => 14400000000,              // Avg episode length in ticks (1s = 10,000,000)
    'studio'        => 'Sunrise',                // First studio name
]
```

A no-match returns `[]`.

Fork as a Starter
-----------------

[](#fork-as-a-starter)

This plugin is based on [`phlix-plugin-example`](https://github.com/detain/phlix-plugin-example). To create your own metadata provider:

1. Fork or copy this repository.
2. Edit `plugin.json` — pick a new `name` (must start with `phlix-plugin-`), bump `version` to `0.1.0`, change `entry` to your FQCN.
3. Edit `composer.json` — rename the package, update PSR-4 autoload prefix.
4. Replace `src/MyanimelistMetadataProvider.php` with your own implementation.
5. Run tests: `composer install && vendor/bin/phpunit`.

Testing
-------

[](#testing)

```
composer install
vendor/bin/phpunit
vendor/bin/phpunit --testdox  # verbose output
```

The unit tests exercise the parse/map helpers via Reflection with fixture JSON — no live network calls are made; the HTTP paths covered by `tests/Unit/MyanimelistTransportTest.php` and `tests/Unit/MyanimelistMetadataProviderAdapterTest.php` run through anonymous `\Workerman\Http\Client` subclasses instead.

`phpunit.xml` declares a Cobertura report, so a run with a coverage driver also writes `coverage.xml`; `.github/workflows/test.yml` runs the suite on PHP `8.3`and `8.4` and uploads that file to Codacy.

License
-------

[](#license)

MIT — see [`LICENSE`](LICENSE).

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance94

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

48d ago

### Community

Maintainers

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

---

Top Contributors

[![detain](https://avatars.githubusercontent.com/u/1364504?v=4)](https://github.com/detain "detain (47 commits)")

---

Tags

animecomposer-packageembyjellyfinmalmangamedia-servermetadata-providermyanimelistphlixphlix-pluginphpphp8plexanimemyanimelistmetadata-providerphlixphlix-pluginmal

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/detain-phlix-plugin-myanimelist/health.svg)

```
[![Health](https://phpackages.com/badges/detain-phlix-plugin-myanimelist/health.svg)](https://phpackages.com/packages/detain-phlix-plugin-myanimelist)
```

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k87.4M2.2k](/packages/symfony-symfony)[laravel/framework

The Laravel Framework.

34.9k556.2M21.6k](/packages/laravel-framework)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

568591.1k63](/packages/ecotone-ecotone)[wikimedia/parsoid

Parsoid, a bidirectional parser between wikitext and HTML5

200569.1k3](/packages/wikimedia-parsoid)[kimai/kimai

Kimai - Time Tracking

4.8k9.4k1](/packages/kimai-kimai)

PHPackages © 2026

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