PHPackages                             yangusik/shikimori-api-php - 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. yangusik/shikimori-api-php

ActiveLibrary[API Development](/categories/api)

yangusik/shikimori-api-php
==========================

A PHP wrapper for Shikimori API

v0.5.2(3y ago)34MITPHPPHP ^7.4 || ^8.0

Since Aug 11Pushed 3y ago1 watchersCompare

[ Source](https://github.com/YanGusik/ShikimoriApiPHP)[ Packagist](https://packagist.org/packages/yangusik/shikimori-api-php)[ RSS](/packages/yangusik-shikimori-api-php/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Shikimori API PHP
=================

[](#shikimori-api-php)

🔌 A PHP wrapper for the  API

[![Packagist](https://camo.githubusercontent.com/da0b7a9a3246833d1b989cf019e730f0f6a0cb9a3063b91aed6c0d0eec2e5315/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f79616e677573696b2f7368696b696d6f72692d6170692d7068702e737667)](https://packagist.org/packages/yangusik/shikimori-api-php)[![build](https://github.com/YanGusik/ShikimoriApiPHP/workflows/build/badge.svg)](https://github.com/YanGusik/ShikimoriApiPHP/workflows/build/badge.svg)[![Coverage Status](https://camo.githubusercontent.com/1e8a849bb8e64be92cacba8e354d84af47a29a855e477538c166bccca675047e/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f59616e477573696b2f5368696b696d6f72694170695048502f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/YanGusik/ShikimoriApiPHP?branch=master)

This is a PHP wrapper for [Shikimori Web API](https://shikimori.one/api/doc/1.0). It includes the following:

- Helper methods for all API endpoints
- Authorization Code.
- Automatic refreshing of access tokens.
- Automatic retry of rate limited requests.
- PSR-4 autoloading support.

Requirements
------------

[](#requirements)

- PHP 7.4 or later.
- PHP [cURL extension](http://php.net/manual/en/book.curl.php) (Usually included with PHP).
- PHP [Json extension](https://www.php.net/manual/en/book.json) (Usually included with PHP).

Installation
------------

[](#installation)

Install it using [Composer](https://getcomposer.org/):

```
composer require yangusik/shikimori-api-php
```

Usage
-----

[](#usage)

Before using the Shikimori API, you'll need to create an app at [Shikimori app](https://shikimori.one/oauth/applications).

Simple example displaying a user's profile:

```
require 'vendor/autoload.php';

$session = new ShikimoriAPI\Session(
    'CLIENT_ID',
    'CLIENT_SECRET',
    'REDIRECT_URI'
);

$api = new ShikimoriAPI\ShikimoriAPI(['auto_refresh' => false]);

if (isset($_GET['code'])) {
    $session->requestAccessToken($_GET['code']);

    // use session to make auto-refresh token auto_refresh = true
    $api->setSession($session);
    // or just a token if you don't need auto-refresh token
    $api->setAccessToken($session->getAccessToken());

    print_r($api->whoami());
} else {
    $options = [
        'scope' => [
            'user-read-email',
        ],
    ];

    header('Location: ' . $session->getAuthorizeUrl($options));
    die();
}
```

### Some resources do not require a token, such as anime

[](#some-resources-do-not-require-a-token-such-as-anime)

```
require 'vendor/autoload.php';

$animes = new \ShikimoriAPI\Resources\Animes();

$animeList = $animes->getAll([['order' => 'popularity', 'status' => 'latest', 'limit' => 50]]);

print_r($animeList);
/**
 * [
 *  ["id" => 1069,
 *  "name" => "Chou Denji Machine Voltes V",
 *  "russian" => "Суперэлектромагнитная машина Вольтес V",
 *  "image": { ...
```

All options for getAll can see at [documentation Shikimori](https://shikimori.one/api/doc/1.0/animes/index).

### If the resource requires a token, such as Dialog

[](#if-the-resource-requires-a-token-such-as-dialog)

```
require 'vendor/autoload.php';

$api = new \ShikimoriAPI\ShikimoriAPI();
$api->setAccessToken('TOKEN');

$dialog = new \ShikimoriAPI\Resources\Dialogs($api);
print_r($dialog->getAll());

// or

$session = new ShikimoriAPI\Session(
    'CLIENT_ID',
    'CLIENT_SECRET',
    'REDIRECT_URI'
);
$session->setAccessToken('TOKEN');
$session->setRefreshToken('TOKEN');

$api = new ShikimoriAPI\ShikimoriAPI(['auto_refresh' => true]);
$api->setSession($session);

$dialog = new \ShikimoriAPI\Resources\Dialogs($api);
print_r($dialog->getAll());
```

For more instructions and examples, check out the [documentation](/docs/). (soon)

License
-------

[](#license)

MIT license. Please see [LICENSE](LICENSE) for more info.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 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

Every ~5 days

Total

2

Last Release

1361d ago

### Community

Maintainers

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

---

Top Contributors

[![YanGusik](https://avatars.githubusercontent.com/u/28189620?v=4)](https://github.com/YanGusik "YanGusik (28 commits)")

---

Tags

shikimori

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/yangusik-shikimori-api-php/health.svg)

```
[![Health](https://phpackages.com/badges/yangusik-shikimori-api-php/health.svg)](https://phpackages.com/packages/yangusik-shikimori-api-php)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

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

A PHP wrapper for Twilio's API

1.6k92.9M270](/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.1M452](/packages/google-gax)

PHPackages © 2026

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