6.1 KiB
Executable File
Jikan - Unofficial MyAnimeList.net REST API
Jikan is a REST API for MyAnimeList.net. It scrapes the website to satisfy the need for an API - which MyAnimeList lacks.
The raison d'être of Jikan is to assist developers easily get the data they need for their apps and projects without having to depend on the lackluster official API, unstable APIs, or sidetracking their projects to develop parsers.
The word Jikan literally translates to Time in Japanese (時間). And that's what this API saves you of. ;)
Notice: Jikan does not support authenticated requests. You can not update your lists.
Getting Started
Requirements
Installation
🐳 Docker
- JikanREST Docker by Fethi El Hassasna
Linux
This is specifically for Ubuntu, but other distributions should work similarly.
- Install requirements:
- Add PHP related packages:
sudo add-apt-repository -y ppa:ondrej/php
- If
add-apt-repository
is not installed, you can install it by doingsudo apt install python-software-properties
orsudo apt install software-properties-common
- If
sudo apt update && sudo apt upgrade
- Install requirements:
sudo apt install curl git php redis-server unzip supervisor
- Verify that PHP 7.1+ is installed:
php -v
- Install the corresponding
php-xml
andphp-mbstring
packages for your version, e.g:- PHP 7.1:
sudo apt install php7.1-xml php7.1-mbstring
- PHP 7.3:
sudo apt install php7.3-xml php7.3-mbstring
- PHP 7.1:
- Install composer:
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
- Start the redis server:
sudo service redis start
Mac
- Install brew
- Install requirements:
brew install php composer redis supervisor
- Start the redis server:
brew services start redis
Setting Up
git clone https://github.com/jikan-me/jikan-rest.git
cd jikan-rest
cp .env.dist .env
composer install
Configuring Jikan
You're able to configure Jikan through the .env
file.
Before running, you need to set the correct values to the following keys in .env
APP_KEY
: a random 32 alphanumeric character stringAPP_URL
: If you're using a virtual host, set the correct domain here. Additionally, include the port number if you've changed it from the standard. Do not leave a trailing slash.
Do's
http://api.jikan.moe
✔️https://api.jikan.local
✔️http://localhost
✔️http://localhost:8000
✔️
Dont's
http://localhost/
❌http://api.jikan.moe/
❌
Configuring Supervisor
Linux
sudo cp conf/supervisor/jikan-worker.conf /etc/supervisor/conf.d
- Be sure to update to the correct directory in
jikan-worker.conf
forcommand
andstdout_logfile
to the directory of jikan!
- Be sure to update to the correct directory in
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start jikan-worker:*
Mac
supervisord -c /usr/local/etc/supervisord.ini
- Copy
conf/supervisor/jikan-worker.conf
to/usr/local/etc/supervisor.d/
brew services start supervisor
sudo supervisorctl update
sudo supervisorctl start jikan-worker:*
Ignition
To start the server, create a virtual host and point it to /public
:
php -S localhost:8000 -t public
Jikan is now hosted on http://localhost:8000/v3/
ℹ️ You can also configure Jikan for Apache. If you wish to configure it for Nginx or anything else, you'll have to port the rewrite rules located at public/.htaccess
Information
If you don't want to host your instance, there's a public API available.
Wrappers
- [.NET] Jikan.net by Ervie
- [Python] JikanPy by Andrew Conant & Abhinav Kasamsetty
- [Ruby] Jikan.rb by Zerocchi
- [JavaScript] JikanJS by Zuritor
- [Java] Jikan4java by Doomsdayrs
- [PHP] jikan-php by Jan Vernieuwe
- [Node.js] jikan-node by xy137
- [Dart] jikan-dart by Rafal Wachol
- [TypeScript] jikants by Julien Broyard
Running Tests
php vendor/bin/phpunit tests
Note: Tests may fail due to rate limit from MyAnimeList (HTTP 429)
Backers
Thank you to all our backers! 🙏 [Become a backer]
Sponsors
Thank you to all our sponsors! You will recieve advertisement/promotive perks. [Become a sponsor]
DISCLAIMER
- Jikan is not affiliated with MyAnimeList.net
- You are responsible for the usage of this API. Please be respectful towards MyAnimeList's Terms Of Service