myanimelist.net

0.0.6 • Public • Published

MyAnimeList

A simple wrapper for MyAnimeList api v2

Table of contents

Installation

# with npm
$ npm install myanimelist.net

# or with Yarn
$ yarn add myanimelist.net

Documentation

new MyAnimeList(token)

  • token - token for authorization of requests (Required)

Anime

getAnime(search, resultLimit)

Search anime by name

  • search - string that will be queried in the api (Required)
  • resultLimit - amout of results (Default value: 4)

Returns:    Promise<Object>

getAnimeById(id, fields)

Get anime by id

  • id - anime id (Required)
  • fields - an array that contains the returns fields (Optional)

Returns:    Promise<Object>

getAnimeRanking(type, resultLimit)

Anime list by ranking

  • type - anime type (Required)
    • types: all | airing | upcoming | tv | ova | movie | special | bypopularity | favorite
  • resultLimit - amout of results (Default value: 4)

Returns:    Promise<Object>

getAnimeBySuggestion(resultLimit)

Suggest anime

  • resultLimit - amout of results (Default value: 4)

Returns:    Promise<Object>

getAnimeBySeason(year, season, resultLimit)

Get seasonal anime

  • year - anime year (Required)
  • season - seasonal (Required)
    • seasons: winter | spring | summer | fall
  • resultLimit - amout of results (Default value: 4)

Returns:    Promise<Object>

Manga

getManga(search)

Search manga by name

  • search - string that will be queried in the api (Required)

Returns:    Promise<Object>

getMangaById(id, fields)

Get manga by id

  • id - manga id (Required)
  • fields - an array that contains the returns fields (Optional)

Returns:    Promise<Object>

getMangaRanking(type, resultLimit)

Manga list by ranking

  • type - manga type (Required)
    • types: all | manga | oneshots | doujin | lightnovels | novels | manhwa | manhua | bypopularity | favorite
  • resultLimit - amout of results (Default value: 4)

Returns:    Promise<Object>

Example

const MyAnimeList = require('myanimelist.net')
const mal = new MyAnimeList('your-token')

mal.getMangaById(2)
  .then(console.log)
  .catch(console.error)

Returns

{
  "id": 2,
  "title": "Berserk",
  "main_picture": {
    "medium": "https:\/\/api-cdn.myanimelist.net\/images\/manga\/1\/157931.jpg",
    "large": "https:\/\/api-cdn.myanimelist.net\/images\/manga\/1\/157931l.jpg"
  }
}

Package Sidebar

Install

npm i myanimelist.net

Weekly Downloads

1

Version

0.0.6

License

MIT

Unpacked Size

8.77 kB

Total Files

4

Last publish

Collaborators

  • samueldurantes