Node.js REST API that allows to interact with MyAnimeList.
A JSON file named config.json located at the API root is used to configure it.
Here are the possible options:
-
encryptionAlgorithm string
- Description: OpenSSL algorithm used to encrypt the passwords.
- Default value: aes256
-
encryptionKey string Required
- Description: Key used to encrypt passwords.
-
logging boolean
- Description: If true, write the logs in a file named logs.txt located in the API root.
- Default value: true
-
myAnimeList object Configuration relative to MyAnimeList.
-
maxSockets {integer}
- Description: Max number of requests simultaneous sent to MyAnimeList.
- Default value: 3
-
retries {integer}
- Description: Number of retries to make when MyAnimeList returns a Too Many Requests error.
- Default value: 3
-
retryDelay {integer}
- Description: Delay between 2 retries in milliseconds.
- Default value: 500
-
timeout {integer}
- Description: Timeout in milliseconds for MyAnimeList requests.
- Default value: 10000
-
-
originsAllowed {string}
- Description: Hosts authorized to communicate with the API. Should be defined.
- Default value: *
-
port {integer}
- Description: Port used to run the API. Can also be provided as environment variable PORT.
- Default value: 8080
-
stackTraceLimit {integer}
- Description: Number of lines to display in the stack when an error occurs.
- Default value: 5
{
"encryptionKey": "Snorlax",
"myAnimeList": {
"timeout": 5000
},
"port": 9000,
"stackTraceLimit": 10
}
Provide details on an anime that are not available in the animelist.
/anime/:id
GET
- id integer
JSON object containing the following fields:
- endDate timestamp
- episodes timestamp
- genres Array of string
- imageUrl string
- membersScore float
- popularity integer
- rank integer
- rating string
- startDate timestamp
- status string
- studios Array of string
- synonyms Array of string
- synopsis string
- title string
- type string
/anime/1
{
"endDate": 924904800000,
"episodes": "26",
"genres": [
"Action",
"Adventure",
"Comedy",
"Drama",
"Sci-Fi",
"Space"
],
"imageUrl": "http://cdn.myanimelist.net/images/anime/4/19644.jpg",
"membersScore": 8.83,
"popularity": 29,
"rank": 23,
"rating": "R - 17+ (violence & profanity)",
"startDate": 891554400000,
"status": "Finished Airing",
"studios": [
"Sunrise"
],
"synonyms": [
"Cowboy Bebop"
],
"synopsis": "In the year 2071, humanity has colonized several of the planets [...]",
"title": "Cowboy Bebop",
"type": "TV"
}
Provide the anime list of a user.
/animelist/:user
GET
- user string
Array of JSON objects containing the following fields:
- endDate timestamp
- episodes integer
- id integer
- imageUrl string
- myFinishDate timestamp
- myScore integer
- myStartDate timestamp
- myStatus string
- completed
- dropped
- onHold
- planToWatch
- watching
- myWatchedEpisodes integer
- startDate timestamp
- status string
- Currently Airing
- Finished Airing
- Not yet aired
- synonyms Array of string
- title string
- type string
- Movie
- Music
- ONA
- OVA
- Special
- TV
/animelist/youbi325
[
{
"endDate": 924912000000,
"episodes": 26,
"id": 1,
"imageUrl": "http://cdn.myanimelist.net/images/anime/4/19644.jpg",
"myFinishDate": 1355529600000,
"myScore": 10,
"myStartDate": 1355097600000,
"myStatus": "completed",
"myWatchedEpisodes": 26,
"startDate": 891561600000,
"status": "Finished Airing",
"synonyms": [],
"title": "Cowboy Bebop",
"type": "TV"
},
{
"endDate": 907113600000,
"episodes": 26,
"id": 6,
"imageUrl": "http://cdn.myanimelist.net/images/anime/7/20310.jpg",
"myFinishDate": 1425340800000,
"myScore": 9,
"myStartDate": 1424131200000,
"myStatus": "completed",
"myWatchedEpisodes": 26,
"startDate": 891388800000,
"status": "Finished Airing",
"synonyms": [],
"title": "Trigun",
"type": "TV"
}
]
Provide a top list.
/toplist/:name/:page
GET
- name string
- all
- airing
- bypopularity
- movie
- ova
- special
- tv
- upcoming
- page integer
Array of JSON objects containing the following fields:
- imageUrl string
- score float
- title string
- topRank integer
/toplist/all/1
[
{
"imageUrl": "http://cdn.myanimelist.net/images/anime/5/47421.jpg",
"score": 9.25,
"title": "Fullmetal Alchemist: Brotherhood",
"topRank": 1
},
{
"imageUrl": "http://cdn.myanimelist.net/images/anime/5/73199.jpg",
"score": 9.17,
"title": "Steins;Gate",
"topRank": 2
}
]
Verify credentials of a MyAnimeList account.
/verifycredentials/:user/:password
GET
- user string
- password string
JSON object containing the following fields:
- authenticated boolean
- secureKey string Only if authenticated is true.
/verifycredentials/youbi325/rightpassword
{
"authenticated": true,
"secureKey": "Hiuuh679Ygugbuv"
}
/verifycredentials/youbi325/wrongpassword
{
"authenticated": false
}
Add an anime in a user anime list.
/addanime/:user/:id/:secureKey
PUT
- user string
- id integer
- secureKey string (See Verify credentials)
JSON object that must contain the following field:
- myStatus string Required
- completed
- dropped
- onHold
- planToWatch
- watching
HTTP 200
/addanime/youbi325/1/Hiuuh679Ygugbuv
{
"myStatus": "watching"
}
HTTP 200
Delete an anime in a user anime list.
/deleteanime/:user/:id/:secureKey
DELETE
- user string
- id integer
- secureKey string (See Verify credentials)
HTTP 200
/deleteanime/youbi325/1/Hiuuh679Ygugbuv
HTTP 200
Update an anime in a user anime list.
/updateanime/:user/:id/:secureKey
PATCH
- user string
- id integer
- secureKey string (See Verify credentials)
JSON object that can contain the following fields:
- myFinishDate timestamp
- myScore integer
- myStartDate timestamp
- myStatus string
- completed
- dropped
- onHold
- planToWatch
- watching
- myWatchedEpisodes integer
All these fields are optionals. If a field is not provided, its value will not change.
HTTP 200
/updateanime/youbi325/1/Hiuuh679Ygugbuv
{
"myScore": 8,
"myWatchedEpisodes": 700
}
HTTP 200