NodeJS wrapper for MyAnimeList API
Image by yotsu
Popura is a promise-returning wrapper for MAL API.
MAL API is broken. Popura wont work until they solve their internal issues.
- Install
- Usage
- API
- Models
- Anime Model
- Manga Model
- Anime List Item Model
- Manga List Item Model
- Myinfo Model
- Development
- License
$ npm install --save popura
import popura from 'popura';
const client = popura('YourAwesomeUsername', 'YourHackablePassword');
client.getAnimeList()
.then(res => console.log(res))
.catch(err => console.log(err));
Return the current user's username.
Change the current user in this client instance.
Check if this user is valid.
Returns Promise
=> {id, username}
.
Search for an anime or manga title by name
.
Returns Promise
=> Array of Anime Models | Manga Models.
Get the animelist or mangalist from an user. If username
is empty, returns current user's list.
Returns Promise
=> {myinfo, list}
where myinfo
is a Myinfo Model and list
is an array of Anime List Item Models | Manga List Item Models.
Inserts an anime or manga with id
into your list. Optionally you can define values
from Anime Models | Manga Models.
Returns Promise
=> Raw response.body
.
Changes values
from an anime or manga with id
in your list. Define values
from Anime Models | Manga Models.
Returns Promise
=> Raw response.body
.
Removes an anime or manga with id
from your list.
Returns Promise
=> Raw response.body
.
Model used to add/update animes
Property | Type | Note |
---|---|---|
episode | int | |
status | int or string |
1 / watching , 2 / completed , 3 / onhold , 4 / dropped , 6 / plantowatch |
score | int |
|
storage_type | int |
|
storage_value | float |
|
times_rewatched | int |
|
rewatch_value | int |
|
date_start | date |
mmddyyyy |
date_finish | date |
mmddyyyy |
priority | int |
|
enable_discussion | int |
1 = enable, 0 = disable |
enable_rewatching | int |
1 = enable, 0 = disable |
comments | string |
|
fansub_group | string |
|
tags | array |
Model used to add/update mangas
Property | Type | Note |
---|---|---|
chapter | int | |
volume | int | |
status | int or string |
1 / reading , 2 / completed , 3 / onhold , 4 / dropped , 6 / plantoread |
score | int |
|
times_reread | int |
|
reread_value | int |
|
date_start | date |
mmddyyyy |
date_finish | date |
mmddyyyy |
priority | int |
|
enable_discussion | int |
1 = enable, 0 = disable |
enable_rereading | int |
1 = enable, 0 = disable |
comments | string |
|
scan_group | string |
|
tags | array |
|
retail_volumes | int |
Model you receive from API when requesting anime list
Property | Type | Note |
---|---|---|
series_animedb_id | int |
|
series_title | string |
|
series_synonyms | array |
|
series_type | int |
1 = TV , 2 = OVA , 3 = Movie , 4 = Special , 5 = ONA , 6 = Music |
series_episodes | int |
|
series_status | int |
1 = Airing , 2 = Finished , 3 = Not Yet Aired |
series_start | date |
mmddyyyy |
series_end | date |
mmddyyyy |
my_id | int |
|
my_watched_episodes | int |
|
my_start_date | date |
mmddyyyy |
my_finish_date | date |
mmddyyyy |
my_score | int |
|
my_status | int |
1 = watching , 2 = completed , 3 = onhold , 4 = dropped , 6 = plantowatch |
my_rewatching | int |
|
my_rewatching_ep | int |
|
my_last_updated | date |
mmddyyyy |
my_tags | array |
Model you receive from API when requesting anime list
Property | Type | Note |
---|---|---|
series_mangadb_id | int |
|
series_title | string |
|
series_synonyms | array |
|
series_type | int |
TODO: figure out the meaning of these int s |
series_chapters | int |
|
series_volumes | int |
|
series_status | int |
TODO: figure out the meaning of these int s |
series_start | date |
mmddyyyy |
series_end | date |
mmddyyyy |
my_id | int |
|
my_read_chapters | int |
|
my_read_volumes | int |
|
my_start_date | date |
mmddyyyy |
my_finish_date | date |
mmddyyyy |
my_score | int |
|
my_status | int |
1 = reading , 2 = completed , 3 = onhold , 4 = dropped , 6 = plantoread |
my_rereading | int |
|
my_rereading_chap | int |
|
my_last_updated | date |
mmddyyyy |
my_tags | array |
Property | Type | Note |
---|---|---|
user_id | int |
|
user_name | string |
|
user_watching | int |
Only for anime |
user_reading | int |
Only for manga |
user_completed | int |
|
user_onhold | int |
|
user_dropped | int |
|
user_plantowatch | int |
Only for anime |
user_plantoread | int |
Only for manga |
user_days_spent_watching | float |
Yes, they use 'watching' for manga too |
After clonning this repo, you must copy .env.sample
to .env
and put your MAL username and password.
In some tests, it'll add, update and remove one anime and one manga from your lists. You can specify these two at .env
. Defaults to anime Tachumaru Gekijou (id = 9562) and manga Junshin Miracle 100% (id = 94483), two not so known titles.