@animelist/client
v0.1.2
Published
Provide an interface to communicate with MyAnimeList API
Maintainers
Readme
@animelist/client
Contents
Provides an interface for interact with MyAnimeList API:
https://myanimelist.net/apiconfig/references/api/v2
Currently this library only implements the
animerelated API.
Setup
Install the package:
npm
npm install @animelist/clientyarn
yarn add @animelist/clientpnpm
pnpm install @animelist/clientSet the environment variable
MAL_CLIENT_ID=<client_id>or use a package likedotenvwith a.envfile.To get the client id you need to log into your https://myanimelist.net/ and go to
Preferences > APIand create a new client. For the redirection url you can usehttp://localhost:3000/api/myanimelist/auth/callbackwhich is used in other examples.After that just import and make requests.
import { MALClient } from "@animelist/client";
const client = new MALClient({
clientId: process.env.MAL_CLIENT_ID!,
});
const result = await client.getAnimeRanking({
ranking_type: "tv",
});
console.log(result);
MyAnimeListthrottle the request, if your make multiples request in a short period of time you may receive a403error.
Checkout https://github.com/Neo-Ciber94/animelist/tree/main/examples/client-sample
License
This project is licensed under the MIT License - see the LICENSE file for details.
