@mateoaranda/jikanjs
v1.3.1
Published
A small Wrapper for the unofficial MAL API Jikan (v4)
Downloads
151
Maintainers
Readme
JikanJS
this is a v4 version of zuritor's jikanjs
Installation
npm install @mateoaranda/jikanjs --save
wrapped jikan Features
- Anime
- Character
- Clubs
- Genres
- Magazines
- Manga
- People
- Producers
- Random
- Recommendations
- Reviews
- Anime Schedule
- Users
- Top
wrapped MAL Features
Usage
const jikanjs = require('@mateoaranda/jikanjs');
Modify API URL
It is possible to change the API Base URL
jikanjs.settings.setBaseURL('apiurl'); // sets the API Base URL
API Methods
- All API functions are promised Based
- Information of all possible parameters are located at the documentation
jikanjs.loadAnime(id [, request [, parameters]])
jikanjs.loadCharacter(id [, request])
jikanjs.loadClub(id [, request [, page]])
jikanjs.loadGenres(type [, page [, limit [, filter]]])
jikanjs.loadMagazines([page])
jikanjs.loadManga(id [, request [, page]])
jikanjs.loadPerson(id [, request])
jikanjs.loadProducers([page])
jikanjs.loadRandom(type)
jikanjs.loadRecommendations(type [, page])
jikanjs.loadReviews(type [, page])
jikanjs.loadSchedule(day [, page [, limit]])
jikanjs.loadUser(username [, request [, page]])
jikanjs.loadAnimelist(username [, limit [, offset]])
jikanjs.loadMangalist(username [, limit [, offset]])
jikanjs.loadSeason(year, season [, page])
jikanjs.loadSeasonArchive()
jikanjs.loadCurrentSeason([page])
jikanjs.loadUpcomingSeason([page])
jikanjs.loadTop(type [, page [, subtype [, filter]]])
jikanjs.search(type, query [, limit [, parameters]])
jikanjs.raw(urlParts [, queryParameters [, mal]])
Examples
loadAnime(id [, request [, parameters]])
id
: Anime IDrequest
: full, characters, staff, episodes, news, forum, videos, videosepisodes, pictures, statistics, moreinfo, recommendations, userupdates, reviews, relations, themes, externalparameters
: query parameters, check the docs for more info
await jikanjs.loadAnime(31240); // Anime Information
await jikanjs.loadAnime(31240, 'episodes'); // All Episodes
await jikanjs.loadAnime(31240, 'episodes', 15); // Episode 15
await jikanjs.loadAnime(31240, 'forum', { filter: 'episode' });
loadCharacter(id [, request])
id
: Character IDrequest
: full, anime, manga, voices, pictures
await jikanjs.loadCharacter(118737); // Character information
await jikanjs.loadCharacter(118737, 'pictures'); // Character pictures
loadClub(id [, request [, page]])
id
: Club IDrequest
: members, staff, relationspage
: Page number, available on members
request, default: 1
await jikanjs.loadClub(73113); // Club information
await jikanjs.loadClub(73113, 'members', 10); // 10th Page of this club members
loadGenres(type [, filter])
type
: either anime
or manga
filter
: genres, explicit_genres, themes, demographics
await jikanjs.loadGenres('anime'); // All anime genres
await jikanjs.loadGenres('manga', 'explicit_genres'); // Manga explicit genres
loadMagazines([page])
page
: Page Number, default: 1
await jikanjs.loadMagazines(); // Magazines collection
loadManga(id [, request [, page]])
id
: Manga IDrequest
: full, characters, news, forum, pictures, statistics, moreinfo, recommendations, userupdates, reviews, relations, externalpage
: Page Number, available on news
userupdates
reviews
requests
await jikanjs.loadManga(74697); // Manga information
await jikanjs.loadManga(74697, 'reviews', 1); // First page of reviews
loadPerson(id [, request])
id
: Person IDrequest
: full, anime, voices, manga, pictures
await jikanjs.loadPerson(34785); // Person information
await jikanjs.loadPerson(34785, 'voices'); // All Person's Voice Acting Roles
loadProducers([page])
page
: Page Number, default: 1
await jikanjs.loadProducers(); // Producers collection
loadRandom(type)
type
: anime, manga, characters, people, users
await jikanjs.loadRandom('anime'); // Some random anime
loadRecommendations(type [, page])
type
: either anime
or manga
page
: Page Number, default: 1
await jikanjs.loadRecommendations('anime'); // First page of recent anime recommendations
loadReviews(type [, page])
type
: either anime
or manga
page
: Page Number, default: 1preliminary
: Receive reviews tagged as preliminary? Default: falsespoiler
: Receive reviews tagged as a spoiler? Default: false
await jikanjs.loadReviews('manga'); // First page of recent manga reviews
loadSchedule(day [, page [, limit]])
day
: monday, tuesday, wednesday, thursday, friday, saturday, sunday, other, unknownpage
: Page Number, default: 1limit
: Result limit numberkids
: Filter entries with the Kids Genre, Default: falsesfw
: Filter entries with the Hentai Genre, Default: falseunapproved
: Include entries which are unapproved, Default: false
await jikanjs.loadSchedule('monday'); // Monday's anime schedule
loadUser(username [, request [, page]])
username
: User's usernamerequest
: full, statistics, favorites, userupdates, about, history, friends, reviews, recommendations, clubs, externalpage
: Page number, available on friends
reviews
recommendations
clubs
requests
await jikanjs.loadUser('pepito'); // Profile information
await jikanjs.loadUser('pepito', 'friends', 6); // 6th page of pepito's friends
loadAnimelist(username [, limit [, offset]])
username
: User's Usernamelimit
: Amount of elements to receive, Default: 1000offset
: Offset, Default: 0
await jikanjs.loadAnimelist('pepito'); // pepito's animelist
loadMangalist(username [, limit [, offset]])
username
: User's Usernamelimit
: Amount of elements to receive, Default: 1000offset
: Offset, Default: 0
await jikanjs.loadMangalist('pepito'); /// pepito's mangalist
loadSeason(year, season [, page])
year
: Season Year (1970-Now)season
: winter, spring, summer, fallpage
: Page Number, default: 1
await jikanjs.loadSeason(2021, 'fall'); // First page of Fall 2021 animes
loadSeasonArchive()
await jikanjs.loadSeasonArchive(); // Seasons collection
loadCurrentSeason([page])
page
: Page Number, default: 1
await jikanjs.loadCurrentSeason(); // First page of the current season's animes
loadUpcomingSeason([page])
page
: Page Number, default: 1
await jikanjs.loadUpcomingSeason(3); // Third page of next season's animes
loadTop(type [, page [, subtype [, filter]]])
type
: anime, manga, people, characters, reviewspage
: Page Number, default: 1 (25 items per page)subtype
:
⠀⠀anime
: tv, movie, ova, special, ona, music, cm, pv, tv_special
⠀⠀manga
: manga, novel, lightnovel, oneshot, doujin, manhwa, manhuafilter
:
⠀⠀anime
: airing, upcoming, bypopularity, favorite
⠀⠀manga
: publishing, upcoming, bypopularity, favorite
await jikanjs.loadTop('anime'); // Top 25 animes
await jikanjs.loadTop('anime', 1, 'movie'); // First page of top anime movies
search(type, query [, limit [, parameters]])
type
: anime, manga, people, characters, clubsquery
: search termlimit
: results limit numberparameters
: extra query parameters, see docs for more info on this
await jikanjs.search('characters', 'Emilia', 1); // Search for a character named "Emilia"
(EXTRA) raw(urlParts [, queryParameters [, mal]])
urlParts
: Array with api endpoint path, e.g. [anime, 1] to load the anime with the id of 1queryParameters
: query parameters, needs to be a key value pair like { page: 1 }mal
: Request to MAL API? Default: false
await jikanjs.raw(['anime', 1]); // Same as loadAnime(1);