MAL operations
The aniLink.mal.* methods are grouped by domain: anime, manga, user, and forum. Every operation takes a typed params object and an optional trailing MalRequestOptions with fields selection and transport settings, merged over the instance defaults.
Each operation's full request parameters, response shape, auth requirements, and errors live in the MAL operation catalog, generated from source metadata so they cannot drift from the code.
Selecting fields
fields accepts a comma-separated string or an array. Both forms produce the same query parameter. Use either form:
// Equivalent:
await aniLink.mal.anime.get({ id: 21 }, { fields: "id,title,main_picture" });
await aniLink.mal.anime.get({ id: 21 }, { fields: ["id", "title", "main_picture"] });Field names are MAL's own, and AniLink passes them through verbatim. See the MAL API v2 field reference for the full list.
anime.get is the only operation with a default for fields. If you omit fields, it sends DEFAULT_MAL_ANIME_FIELDS (id, title, main_picture, synopsis, status, mean, num_episodes, media_type, start_date, broadcast, average_episode_duration). That default lets await aniLink.mal.anime.get({ id: 21 }) work without options. An explicit fields value replaces the default. The discovery reads (seasonal, ranking, suggestions) omit fields when you do not provide it.
Anime
| Operation | Purpose |
|---|---|
anime.get | One anime by its MyAnimeList ID |
anime.search | Anime search by keyword |
anime.seasonal | The anime of one broadcast season |
anime.ranking | One of MAL's anime ranking lists |
anime.suggestions | MAL's suggestions for the authenticated user |
anime.updateMyListStatus | Update the authenticated user's anime list status |
anime.deleteFromList | Remove an anime from the user's list |
const anime = await aniLink.mal.anime.get(
{ id: 21 },
{ fields: ["id", "title", "main_picture", "synopsis"] }
);
console.log(anime.title, anime.main_picture?.large);The list writes (updateMyListStatus, deleteFromList) require a MAL access token. deleteFromList is permanent.
Manga
| Operation | Purpose |
|---|---|
manga.get | One manga by its MyAnimeList ID |
manga.search | Manga search by keyword |
manga.ranking | One of MAL's manga ranking lists |
manga.updateMyListStatus | Update the authenticated user's manga list status |
manga.deleteFromList | Remove a manga from the user's list |
const status = await aniLink.mal.manga.updateMyListStatus({
id: 1,
status: "reading",
num_chapters_read: 10,
score: 9,
});
console.log(status.num_chapters_read);Users
| Operation | Purpose |
|---|---|
user.me | The authenticated user, token required |
user.get | One user profile; MAL documents only @me |
user.animeList | One page of a user's anime list |
user.mangaList | One page of a user's manga list |
const list = await aniLink.mal.user.animeList(
{ username: "@me", status: "watching", sort: "list_score", limit: 100 },
{ fields: ["id", "title", "list_status"] }
);
console.log(list.data[0]?.node.title, list.data[0]?.list_status?.score);@me and private lists require an access token; a client ID alone cannot resolve @me. Without a token, @me fails fast with AniLinkAuthError before any request is sent.
Forum
| Operation | Purpose |
|---|---|
forum.boards | The forum board tree |
forum.topics | The forum topic list, filterable |
forum.topic | One topic with its posts and poll |
const topic = await aniLink.mal.forum.topic({ id: 23744 });
console.log(topic.data.title, topic.data.posts[0]?.body);Paging and caching notes
The list endpoints (search, ranking, seasonal, suggestions, user.animeList, user.mangaList, forum.topics) return a paging node. When more results remain, paging.next contains the next-page URL. Follow that URL manually only with care: manual requests bypass the library's pacing, retry, and circuit breaker. Prefer the mal.paginate helpers, which walk these endpoints with the guards applied.
With responseCache enabled, list reads can remain stale for ttlMs after updateMyListStatus. The cache uses a TTL and does not invalidate entries after writes.
Next steps
- MAL operation catalog lists every operation with its full request and response details, grouped by anime, manga, user, and forum.
- MAL pagination walks the list endpoints automatically.
- Per-request options covers transport overrides per call.