@mateoaranda/jikanjs v1.3.1
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 URLAPI 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 picturesloadClub(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 membersloadGenres(type , filter)
type: either anime or mangafilter: genres, explicit_genres, themes, demographics
await jikanjs.loadGenres('anime'); // All anime genres
await jikanjs.loadGenres('manga', 'explicit_genres'); // Manga explicit genresloadMagazines(page)
page: Page Number, default: 1
await jikanjs.loadMagazines(); // Magazines collectionloadManga(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 reviewsloadPerson(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 RolesloadProducers(page)
page: Page Number, default: 1
await jikanjs.loadProducers(); // Producers collectionloadRandom(type)
type: anime, manga, characters, people, users
await jikanjs.loadRandom('anime'); // Some random animeloadRecommendations(type , page)
type: either anime or mangapage: Page Number, default: 1
await jikanjs.loadRecommendations('anime'); // First page of recent anime recommendationsloadReviews(type , page)
type: either anime or mangapage: 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 reviewsloadSchedule(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 scheduleloadUser(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 friendsloadAnimelist(username [, limit , offset])
username: User's Usernamelimit: Amount of elements to receive, Default: 1000offset: Offset, Default: 0
await jikanjs.loadAnimelist('pepito'); // pepito's animelistloadMangalist(username [, limit , offset])
username: User's Usernamelimit: Amount of elements to receive, Default: 1000offset: Offset, Default: 0
await jikanjs.loadMangalist('pepito'); /// pepito's mangalistloadSeason(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 animesloadSeasonArchive()
await jikanjs.loadSeasonArchive(); // Seasons collectionloadCurrentSeason(page)
page: Page Number, default: 1
await jikanjs.loadCurrentSeason(); // First page of the current season's animesloadUpcomingSeason(page)
page: Page Number, default: 1
await jikanjs.loadUpcomingSeason(3); // Third page of next season's animesloadTop(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 moviessearch(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);