Skip to content

Latest commit

 

History

589 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AniLink

AniLink

npm version npm downloads License: MIT CI CodeQL Documentation

A typed TypeScript wrapper for the AniList GraphQL API and the MyAnimeList REST API. One class exposes two isolated provider namespaces. Every operation with inputs takes a single typed params object plus an optional trailing options object. The parameterless reads, mal.user.me(options?) and mal.anime.suggestions(options?), take the options object alone. Normalized errors, retries, pacing, and caching work identically on both.

Quickstart

npm install anilink-api-wrapper

Requires Node.js 22 or later. The package is ESM-only, so use import syntax, not CommonJS require.

import { AniLink } from "anilink-api-wrapper";

// AniList (GraphQL) needs no token for public queries
const aniLink = new AniLink();
const anime = await aniLink.anilist.query.media({ id: 21, type: "ANIME" });

// MyAnimeList (REST) has its own credential slot
const client = new AniLink({ mal: { accessToken: "mal-token" } });
const malAnime = await client.mal.anime.get(
    { id: 21 },
    { fields: ["id", "title", "main_picture"] }
);

What you can do

Provider Namespace Capabilities
AniList aniLink.anilist Queries, page queries, mutations, pagination helpers, custom(), data helpers, and the crossLink AniList to MAL id mapping
MyAnimeList aniLink.mal anime.get, manga.get, and user.me/user.get REST reads with field selection, the anime.search/manga.search keyword searches, the seasonal, anime.ranking/manga.ranking, and suggestions discovery reads, paginated user.animeList/user.mangaList user-list reads, the forum.boards/forum.topics/forum.topic forum reads, plus anime/manga updateMyListStatus and deleteFromList list-status writes

Both namespaces share one transport layer, which handles timeouts, retries, pacing, circuit breaking, and hooks. Each provider slot has its own credentials and transport settings.

Documentation

Docs Start here
Guides Introduction · Getting started · Provider configuration · Per-request options · Error handling · Retries & resilience · Cancellation & timeouts · Observability · Recipes · TypeScript patterns · Troubleshooting
AniList guides Authentication · Client configuration · Querying · Page queries · Pagination · Mutations · Custom queries · Helpers
MAL guides Authentication · Client configuration · Operations
Operation reference Overview · AniList catalog · MAL catalog
API reference (TypeDoc) AniLink class; the full generated reference is at the docs root

Development

npm install               # install dependencies
npm run check             # typecheck, lint, tests, format, JSDoc, api-compare, build
npm run docs:generate     # TypeDoc + operation reference + guides site into docs/
npm run docs:dev          # serve the guides site locally

See the contributing guide for workflow details.

Resources

License

MIT

About

API wrapper for AniManga sites such as Anilist and MyAnimeList.

Topics

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages