Skip to content
AniLink

MyAnimeList operation catalog

Every public MyAnimeList operation is REST, so the catalog is a single page: the operations below are grouped by response domain.

Anime

mal.anime.get

MyAnimeListAnimeApi.get gets one anime by its MyAnimeList ID through MalAnimeOperation.get. It is the public facade for the GET /anime/{id} endpoint; use MalRequestOptions.fields to select the response shape and MalRequestOptions transport settings to override per call.

Signature

TypeScript
get(id: number, options?: MalRequestOptions): Promise<MalAnime>

Auth: Not required for public anime data; pass an access token for list-related fields.

NameTypeRequiredDescription
idnumberyesThe MyAnimeList anime ID.
optionsMalRequestOptionsnoOptional field selection and transport settings; merged over the instance defaults.
  fieldsstring | readonly string[]noComma-separated MAL field selector, or the same selector as an array. Shapes the response.
  timeoutnumbernoMilliseconds before the request is aborted. `0` disables.
  signalAbortSignalnoSignal used to cancel the in-flight request.
FieldTypeDescription
idnumberThe MyAnimeList numeric identifier.
titlestringThe canonical MyAnimeList title.
main_pictureMalPictureOptional image variants requested through the `fields` query parameter.
  • AniLinkApiError — non-success MyAnimeList response
  • AniLinkNetworkError — timeout, cancellation, or other transport failure

Example

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

const aniLink = new AniLink({ mal: { accessToken: "mal-token" } });
const anime = await aniLink.mal.anime.get(21, {
    fields: ["id", "title", "main_picture", "synopsis"],
});
console.log(anime.title);

User

mal.user.me

MyAnimeListUserApi.me gets the currently authenticated MyAnimeList user through MalUserOperation.me. It is the public facade for GET /users/@me and requires a MAL access token from MalCredentials.accessToken via buildMyAnimeListApi; use MalRequestOptions.fields to select the response shape.

Signature

TypeScript
me(options?: MalRequestOptions): Promise<MalUser>

Auth: Required — MAL OAuth2 access token (`mal.accessToken` credential slot).

NameTypeRequiredDescription
optionsMalRequestOptionsnoOptional field selection and transport settings; merged over the instance defaults.
  fieldsstring | readonly string[]noComma-separated MAL field selector, or the same selector as an array. Shapes the response.
  timeoutnumbernoMilliseconds before the request is aborted. `0` disables.
  signalAbortSignalnoSignal used to cancel the in-flight request.
FieldTypeDescription
idnumberThe MyAnimeList numeric user identifier.
namestringThe user's MyAnimeList name.
locationstringOptional profile location.
joined_atstringOptional account creation timestamp.
  • AniLinkAuthError — no MAL access token is configured
  • AniLinkApiError — non-success MyAnimeList response
  • AniLinkNetworkError — timeout, cancellation, or other transport failure

Example

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

const aniLink = new AniLink({ mal: { accessToken: "mal-token" } });
const user = await aniLink.mal.user.me({
    fields: ["id", "name", "location", "joined_at"],
});
console.log(user.name);

AniLink — typed AniList & MyAnimeList client for TypeScript.