jikan-rest/README.MD
2019-06-20 10:33:51 +05:00

6.1 KiB
Executable File
Raw Blame History

Jikan

Jikan - Unofficial MyAnimeList.net REST API

Average time to resolve an issue Percentage of issues still open stable Discord Server

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

Linux

This is specifically for Ubuntu, but other distributions should work similarly.

  1. 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 doing sudo apt install python-software-properties or sudo apt install software-properties-common
  • 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 and php-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
  • Install composer: curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
  1. Start the redis server: sudo service redis start

Mac

  1. Install brew
  2. Install requirements: brew install php composer redis supervisor
  3. Start the redis server: brew services start redis

Setting Up

  1. git clone https://github.com/jikan-me/jikan-rest.git
  2. cd jikan-rest
  3. cp .env.dist .env
  4. 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

  1. APP_KEY : a random 32 alphanumeric character string
  2. APP_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
  1. sudo cp conf/supervisor/jikan-worker.conf /etc/supervisor/conf.d
    • Be sure to update to the correct directory in jikan-worker.conf for command and stdout_logfile to the directory of jikan!
  2. sudo supervisorctl reread
  3. sudo supervisorctl update
  4. sudo supervisorctl start jikan-worker:*
Mac
  1. supervisord -c /usr/local/etc/supervisord.ini
  2. Copy conf/supervisor/jikan-worker.conf to /usr/local/etc/supervisor.d/
  3. brew services start supervisor
  4. sudo supervisorctl update
  5. 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

Add your wrapper here

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