This specification is for the undocumented MyAnimeList JSON API for managing lists - that's used by their own website.
You need 2 things to make this work.
- CSRF token
- Session/Cookie
Scrape the CSRF token from the Login.php page.
It's stored in a <meta>
tag.<meta name='csrf_token' content='PARSE_THIS_STRING'>
JikanAuth uses RegEx to do this
Pass the username/password through the login form via form POST. Then use session/cookie response to make further requests.
JikanAuth does this by allowing Guzzle to store the cookies
POST http://myanimelist.net/login.php
Payload
Headers
content-type: application/x-www-form-urlencoded
Form Data
user_name: `your username`
password: `your password`
csrf_token: `the token you scraped`
cookie: '1'
sublogin: 'Login'
submit: '1'
JikanAuth implements this here
//Todo
POST https://myanimelist.net/ownlist/anime/add.json
Key | Type | Remarks |
---|---|---|
anime_id |
Integer | MAL ID of the anime |
status |
Integer | Anime Status Constants |
score |
Integer | 0 - 10 |
num_watched_episodes |
Integer | <= 0 |
csrf_token |
String | Scraped Token |
POST https://myanimelist.net/ownlist/anime/edit.json
Key | Type | Remarks |
---|---|---|
anime_id |
Integer | MAL ID of the anime |
status |
Integer | Anime Status Constants |
score |
Integer | 0 - 10 |
num_watched_episodes |
Integer | <= 0 |
csrf_token |
String | Scraped Token |
POST https://myanimelist.net/ownlist/anime/%s/delete
Where %s
is the MAL ID of the anime.
Key | Type | Remarks |
---|---|---|
csrf_token |
String | Scraped Token |
POST https://myanimelist.net/ownlist/manga/add.json
Key | Type | Remarks |
---|---|---|
manga_id |
Integer | MAL ID of the manga |
status |
Integer | Manga Status Constants |
score |
Integer | 0 - 10 |
num_read_volumes |
Integer | Volumes read; integer (<= 0) |
num_read_chapters |
Integer | Chapters read; integer (<= 0) |
csrf_token |
String | Scraped Token |
POST https://myanimelist.net/ownlist/manga/edit.json
Key | Type | Remarks |
---|---|---|
manga_id |
Integer | MAL ID of the manga |
status |
Integer | Manga Status Constants |
score |
Integer | 0 - 10 |
num_read_volumes |
Integer | Volumes read; integer (<= 0) |
num_read_chapters |
Integer | Chapters read; integer (<= 0) |
csrf_token |
String | Scraped Token |
POST https://myanimelist.net/ownlist/manga/%s/delete
Where %s
is the MAL ID of the manga.
Key | Type | Remarks |
---|---|---|
csrf_token |
String | Scraped Token |
Status | Value |
---|---|
Watching/Reading | 1 |
Completed | 2 |
On-Hold | 3 |
Dropped | 4 |
Plan to Watch/Read | 6 |
Contributions welcome, help make this specification better by creating a PR.