Miss any of our Open RFC calls?Watch the recordings here! »

node-myanimelist

3.0.4 • Public • Published

NodeMal API Banner

Node-MyAnimeList

Node-MyAnimeList is a small promise based package for downloading information from MyAnimeList. Node-MyAnimeList is using Jikan.moe API and flew methods created by me specially for this package

Quick 2.0 to 3.0 Migration guide

  • Jikan module is now imported with import { Jikan } from 'node-myanimelist'
  • Jikan module now returns jikan json directly you no longer need to use res.data, data will be returned directly
  • There is new way of choosing GenreId.Rating,etc you should check genre and search for examples of usage
  • Wiki is deprecated use Doc instead

Intellisens Support (Typescript)

Gif

Instalation

NPM

npm i node-myanimelist

Import

const { Mal, Jikan } = require("node-myanimelist");
// Or
import { Mal, Jikan } from 'node-myanimelist';

MalAPI Example

const auth = Mal.auth("6114d00ca681b7701d1e15fe11a4987e" /* app_id */ );
 
// Unoffical way to login (not recomended)
const acount = await auth.Unstable.login("username","password");
 
// Offical way to login (recomended)
// import pkceChallenge from "pkce-challenge";
// const pkce = pkceChallenge();
 
const url = auth.getOAuthUrl(pkce.code_challenge)
// Open returned url, accept oauth and use returned code to authorize
const acount = await auth.authorizeWithCode(code,pkce.code_challenge);
 
let search = await acount.manga.search(
   "Sakurasou",
   Mal.Manga.fields()
      .alternativeTitles()
      .startDate()
      .endDate()
      .synopsis()
      .mean()
      .rank()
      .popularity()
      .numListUsers()
      .numScoringUsers()
      .nsfw()
      .genres()
      .createdAt()
      .updatedAt()
      .mediaType()
      .status()
      .myListStatus(
         Mal.Manga.listStatusFields()
            .startDate()
            .finishDate()
            .priority()
            .numTimesReread()
            .rereadValue()
            .tags()
            .comments()
      )
      .numVolumes()
      .numChapters()
      .authors()
).call();
 
// Alternative if you don't care about choosing fields
let searchIDC = await acount.manga.search(
   "Sakurasou",
   Mal.Manga.fields().all()
).call();

List of functions

For more detalis visit doc

  • MalApi Methods
    • OAuth PKCE Auth
    • OAuth Login And Passwor Auth (unofficial)
    • Anime
      • Search
      • Details
      • Ranking
      • Seasonal anime
      • Suggested anime
    • Manga
      • Search
      • Details
      • Ranking
    • Forum
      • Boards
      • Topics
      • Topic details
    • User
      • Info
      • Animelist
      • Mangalist
  • JikanApi Methods

Buildin Scraper

import { Scraper } from "node-myanimelist";
 
// Login into Mal acount
let loginData = await Scraper.login("username","password");
 
// loginData == {
//   MALSESSIONID: "***",
//   csrf_token: "***"
// };
 
// Get Mal User Notifications
let notifications = await Scraper.notifications(loginData);
 
// Update Episode On Mal
const animeUpdate = {
   num_watched_episodes: 20,
   anime_id: 24833,
   status: 1
};
let res = await Scraper.animeEdit(loginData,animeUpdate);
 

Notifications response example

Install

npm i node-myanimelist

DownloadsWeekly Downloads

50

Version

3.0.4

License

MIT

Unpacked Size

287 kB

Total Files

237

Last publish

Collaborators

  • avatar