Code Monkey home page Code Monkey logo

jikan-rest's Introduction

Jikan

Jikan REST API v4 - 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 API functionality that MyAnimeList.net 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 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 REST API does not support authenticated requests. You can not update your lists. Use the official MyAnimeList API for this!

Installation

NOTICE: v3

This is Jikan REST API v4 - which has been merged into master branch. If you're looking for deploying a v3 build, view the v3 branch for installation instructions: https://github.com/jikan-me/jikan-rest/tree/v3

⚠ v3 is discontinued and will no longer receive any updates.

Manual installation

Please read the manual installation guide. For any additional help, join our Discord server.

🐳 Docker Installation

We distribute the app as a container image, so you can just run it:

docker run -d --name=jikan-rest -p 8080:8080 -v ./.env:/app/.env jikanme/jikan-rest:latest

For more information please refer to our container usage guide.

Public REST API

If you don't want to host your instance, there's a public API available.

Documentation

Please view the documentation. For any additional help, join our Discord server.

Wrappers

Language Wrappers
JavaScript JikanJS by Zuritor
🆕 (v4) JikanJS by Mateo Aranda
Java Jikan4java by Doomsdayrs
🆕 (v4) reactive-jikan by Sandro Marques
🆕 (v4) Jaikan by ShindouMihou
Python (v4) JikanPy by Abhinav Kasamsetty
🆕 (v4) jikan4snek by Indrawan I.
Node.js jikan-node by xy137
jikan-nodejs by ribeirogab
🆕 (v4) Jikan4JS by RizzziGit
🆕 (v4) jikan-api.js by OpenianDev
TypeScript jikants by Julien Broyard
jikan-client by Javier Blanco
🆕 (v4) jikan-ts by Clara Castillo
PHP jikan-php by Jan Vernieuwe
.NET 🆕 (v4) Jikan.net by Ervie
Elixir JikanEx by Sean Breckenridge
Go 🆕 (v4) jikan-go by Daren Liang
jikan2go by nokusukun
Ruby Jikan.rb by Zerocchi
Dart jikan-dart by Rafal Wachol
Kotlin JikanKt by Ganedra Afrasya

Add your wrapper here

Running Tests

php vendor/bin/phpunit tests

Note: Tests may fail due to rate limit from MyAnimeList (HTTP 429)


Backers

A huge thank you to all our Patrons! 🙏 This project wouldn't be running without your support.

We have a free REST API service, if you wish to support us you can become a Patron!

Sugoi (すごい) Patrons

Patrons

  • Aaron Treinish
  • Abdelhafid Achtaou
  • Aika Fujiwara
  • Bobby Williams
  • Cesar Irad Mendoza
  • CrafterSama
  • Fro116
  • Jason Weatherly
  • Jesse
  • Kundan Chintamaneni
  • Kururin
  • Purplepinapples
  • Ryo Ando
  • Sakamotodesu
  • TeraNovaLP

Development

JetBrain Jikan's development is powered by JetBrain's Open Source License

A shoutout to their amazing products and for supporting Jikan since early versions!


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

jikan-rest's People

Contributors

abhinavk99 avatar adiirfan avatar barrafiqaulihi avatar chris-peterson444 avatar darenliang avatar dependabot[bot] avatar gsculerlor avatar irfan-dahir avatar jamesqo avatar janvernieuwe avatar lordkyubae avatar n0d4n avatar nerg4l avatar ninjajc01 avatar nokusukun avatar polymeilex avatar purplepinapples avatar pushrbx avatar ribeirogab avatar rohank05 avatar sandrohc avatar seanbreckenridge avatar tbkj98 avatar vernoxvernax avatar vuriaval avatar xy137 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jikan-rest's Issues

[HOSTED] Generated Issue: ParserException on /v3/person/0

Please fill out the details below.

Summary:

Steps to reproduce:
http://api.jikan.moe/v3/person/0

Additional Details

Jikan Parser Version: v2.8.2@d7b5ecb5836f6cdd2b24aaa21c9dde1daff0f49c
PHP: 7.3.6-1+ubuntu18.04.1+deb.sury.org+1
Redis: Connected
Exception: Jikan\Exception\ParserException
Code: 0
Message: Failed to parse 'https://myanimelist.net/people/0'
Trace: /var/www/jikan/vendor/jikan-me/jikan/src/Exception/ParserException.php on line 24
Request: GET /v3/person/0

Opening and Ending themes have second quote mark at start of string

When getting info for an anime, the Opening and Ending theme arrays have a second " at the start of each string.

Example: https://api.jikan.moe/v3/anime/38759/ ( Meddlesome Kitsune Senko-san )

  "opening_themes": [
    ""Koyoi mofumofu!! (今宵mofumofu!!)" by Senko (Azumi Waki), Shiro (Maaya Uchida)"
  ],
  "ending_themes": [
    ""Moffumoffu DE Yoi no Ja yo (もっふもっふ DE よいのじゃよ)" by Senko (Azumi Waki)"
  ]```

This happens for all anime I've tested.
A simple workaround is to just remove that first character from each string, but thats slightly annoying.

Tested with nodejs request library and the official documentation console page thing

Edit: forgot to end code block lol

Use `.env` for configuring cache management type

Feature for self-hosters

JikanResponseHandler: Current queue based cache management (serves stale cache until updated cache available)

JikanResponseLegacy: Previous way of caching: Simply fetch+parse again from MAL during a request if cache has expired

Proposed key for .env

CACHE_METHOD=queue|legacy

[Cachet Middleware] Add Queues

Can't update cachet metrics at every request - would kill status.jikan.moe and slow down requests.

Need to look into Lumen Queues.

Cachet Middleware disabled until resolved

[RedisCache] Data storing issue

Some middleware passes an array or a string sometimes. v2 passes an array where-as v3 endpoints passes JSON.

Need to investigate what's causing this. Could be the serializer for v2 as well.

Database

/storage/framework/cache/../../.......
Is there another place where the data are stocked?

[HOSTED] Generated Issue: ErrorException

Please fill out the details below.

Summary:

Steps to reproduce:

Additional Details

Jikan Parser Version: v2.8.2@d7b5ecb5836f6cdd2b24aaa21c9dde1daff0f49c
PHP: 7.3.6-1+ubuntu18.04.1+deb.sury.org+1
Redis: Connected
Exception: ErrorException
Code: 0
Message: file_put_contents(): Only 0 of 3132 bytes written, possibly out of free disk space
Trace: /var/www/jikan/vendor/illuminate/filesystem/Filesystem.php on line 122
Request: GET /v3/manga/10447

[HOSTED] Generated Issue: ErrorException

Please fill out the details below.

Summary:
500 Internal Server Error on any route

Steps to reproduce:
Any form of request produces a 500 internal server error.

Additional Details

Jikan Parser Version: v2.8.2@d7b5ecb5836f6cdd2b24aaa21c9dde1daff0f49c
PHP: 7.3.6-1+ubuntu18.04.1+deb.sury.org+1
Redis: Connected
Exception: ErrorException
Code: 0
Message: file_put_contents(): Only 0 of 1655 bytes written, possibly out of free disk space
Trace: /var/www/jikan/vendor/illuminate/filesystem/Filesystem.php on line 122
Request: GET /v3/manga/112589

[Request] Add User ID to /user/<username> endpoint

The User ID for users on MAL can be seen in their profile picture URL https://api.jikan.moe/v3/user/Jonaviz/friends

However if a user doesn't have a profile picture, it shows up as https://cdn.myanimelist.net/images/questionmark_50.gif

As far as I can see theres no easy way to get their UserID.

Making additional requests per missing ID doesn't make sense, but the UserID should be available on this endpoint:

https://api.jikan.moe/v3/user/Jonaviz

Its available on various parts of the Profile Page, most reliable seems to be the link in the report button, by selecting .header-right:

https://myanimelist.net/modules.php?go=report&type=profile&id=5237248

[History]

Hey is user history broken? It doesn't return anything for users that should have an history. Example is Kineta.

[UserAnimeList] season_year and season_name are null for some users

Test case:
GET https://api.jikan.moe/v3/user/nekomata1037/animelist/watching
Every anime has season_year and season_name filled in correctly as expected.

But:
GET https://api.jikan.moe/v3/user/Xinil/animelist/watching
or
GET https://api.jikan.moe/v3/user/Luna/animelist/watching
Every anime has season_year and season_name equal to null.

Add Serializer Metadata Exclusion policy

  • Create Metadata for each model 😓

  • add exclusion policy to NONE to have it output everything - even if null

  • Check for possible method for exclusion policy defaults (JMSSerializer v2?)

Sorting issue

/api/meta/requests/anime/today|weekly
don't sort by count

Add more Kernel commands/control

  • Cache Delete cache:delete {key}
    key is the request_hash from request JSON body.
    e.g cache:delete request:anime:d6092f2422f084452c84555f17c7ba047e6998d3
  • Queue Clear queue:clear
  • Changing Cache Driver

Unit Test Coverage

Unit Test coverage required for production endpoints, paths and GET arguments. Expected results would be the MyAnimeList response.

  • Anime
  • Manga
  • Character
  • Person
  • Club
  • Genre
  • Producer
  • Magazine
  • Schedule
  • Season
  • Top
  • User
  • Search

Contributing Info

  • Add appropriate tests for each Controller in tests/Http/Controllers.
  • New test file for each Controller: ExampleControllerTest.php
  • Controllers located at app/Http/Controllers/V3
  • Multiple version testing would be done in the same file. No testing required for V2.

Running Tests

  1. cd into project directory
  2. php vendor/bin/phpunit tests

[Anime|Manga] better relation types handling

Proposed for version: 4.0

Currently they're dynamically parsed strings from MAL. Which include spaces and non-linear schema patterns.

Update 14/2/2019
No need for snake case. Going for this schema:
New Schema

Anime Studio Listing / Manga Magazine Listing

Data

  • mal_id
  • name
  • count
  • url

Proposed Model
ProducerListItem and MagazineListItem

  • Jikan\Model\Common\MalUrl
  • count (integer)

Response
Array listing of the model above

REST API

  • /producers
  • /magazines

Conflicts
/producer and /magazine already exist. With the option to pass along the producer ID: /producer/1, to fetch producer details and anime listing. Same for /magazine/1

This is bad design. Need to use plurals at this point.

Resolution
GET /producers // fetches listing
GET /producers/1 // fetches details on the producer with the respective ID

Therefore, proposed for v4+ only - where we can use /producers only and remove /producer (or keep as backward compatibility).

[Search] Improve Genre filters

Currently

Single Genre:
genre=1

Multiple Genre: (passed as array)
genre[]=1&genre[]=2

Proposed for v3.3

Add support for the following syntax for multiple genre:
genre=1,2

  • Cleaner
  • Allows backward compatibility

[Search] Add Order By

https://myanimelist.net/anime.php?q=&letter=&type=0&score=0&status=0&p=0&r=0&sm=0&sd=0&sy=0&em=0&ed=0&ey=0&c[0]=a&c[1]=b&c[2]=c&c[3]=d&c[4]=e&c[5]=f&c[6]=g&gx=0&o=7&w=2&o=7&w=1

It's possible to order by columns available on the search results by passing some extra GET params.

Anime score is returned as null on some IDs.

I've tested this with many Anime, but this particular one always returns null as the score even though its score on MAL is clearly a valid number.

Test case:
curl https://api.jikan.moe/v3/anime/29711
Result. The result JSON was shortened for the sake of demonstration
{ "mal_id":29711, "score":null, "scored_by":null }

Review cache expiry

User endpoints such as lists or history would need a quicker response to new data.

Possibly, 1-5 minute(s) would be a good range of cache time.

[User Lists] Add Filters/Sorts/Order By

It's possible to order by more columns available on the search results by passing some extra GET params; order2.


https://myanimelist.net/animelist/purplepinapples?status=1&order=12&order2=0 by episode progress

By air start date https://myanimelist.net/animelist/purplepinapples?status=1&order=14&order2=0

https://myanimelist.net/animelist/purplepinapples?order=5&status=1 last updated by user. This is different from user history as it doesnt require an episode change to be considered
<select><option value="0">-</option><option value="16">Status</option><option value="1">Anime Title</option><option value="4">Score</option><option value="6">Type</option><option value="12">Watched Episodes</option><option value="8">Rating</option><option value="3">Start Date</option><option value="2">Finish Date</option><option value="14">Air Start Date</option><option value="15">Air End Date</option><option value="5">Last Updated</option><option value="9">Rewatch Value</option><option value="11">Priority</option><option value="13">Storage</option></select>

corresponding values for
&order=<n>
order=5 will sort ascending
order=-5 will sort descending

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.