Skip to content
墨 AniLink

MyAnimeList user operations ​

This page lists public MyAnimeList user operations by response domain.

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; a MalRequestOptions merged over the instance defaults.
  fieldsstring | readonly string[]noA comma-separated field selector, or the same selector as an array.
  timeoutnumbernoMilliseconds before a request is aborted. `0` disables the Axios timeout. Defaults to DEFAULT_REQUEST_TIMEOUT; timeout errors carry the effective duration as `AniLinkNetworkError.timeoutMs`.
  signalAbortSignalnoSignal used to cancel in-flight requests.
FieldTypeDescription
idnumberThe MyAnimeList numeric user identifier.
namestringThe user's MyAnimeList name.
locationstringOptional profile location.
joined_atstringOptional account creation timestamp.
picturestringThe user's profile picture URL, when requested via the `fields` query parameter.
genderstringThe user's gender, when requested via the `fields` query parameter.
birthdaystringThe user's birthday in ISO 8601 format, when requested via the `fields` query parameter.
  • AniLinkAuthError: when no MAL access token is configured
  • AniLinkRestError: for a non-success MyAnimeList response
  • AniLinkNetworkError: for timeout, cancellation, or other transport failures

Example

TypeScript
const api = new AniLink({ mal: { accessToken: "mal-token" } }).mal;
const user = await api.user.me({ fields: ["id", "name"] });

mal.user.get

MyAnimeListUserApi.get gets a MyAnimeList user profile through MalUserOperation.get. It is the public facade for GET /users/{user_name}. MyAnimeList documents only @me for this endpoint. Other usernames are passed through, but MyAnimeList currently answers them with 404. Every request requires an access token. Use MalRequestOptions.fields to select the response shape.

Signature

TypeScript
get(params: MalUserGetParams, options?: MalRequestOptions): Promise<MalUser>

Auth: Requires an access token: MyAnimeList documents only `@me` for this endpoint; other usernames are passed through but currently answered with `404`.

NameTypeRequiredDescription
paramsMalUserGetParamsyesThe profile read inputs; a MalUserGetParams carrying the username.
  usernamestringnoThe MyAnimeList username; MyAnimeList documents only `@me` for this endpoint.
optionsMalRequestOptionsnoOptional field selection and transport settings; a MalRequestOptions merged over the instance defaults.
  fieldsstring | readonly string[]noA comma-separated field selector, or the same selector as an array.
  timeoutnumbernoMilliseconds before a request is aborted. `0` disables the Axios timeout. Defaults to DEFAULT_REQUEST_TIMEOUT; timeout errors carry the effective duration as `AniLinkNetworkError.timeoutMs`.
  signalAbortSignalnoSignal used to cancel in-flight requests.
FieldTypeDescription
idnumberThe MyAnimeList numeric user identifier.
namestringThe user's MyAnimeList name.
locationstringOptional profile location.
joined_atstringOptional account creation timestamp.
picturestringThe user's profile picture URL, when requested via the `fields` query parameter.
genderstringThe user's gender, when requested via the `fields` query parameter.
birthdaystringThe user's birthday in ISO 8601 format, when requested via the `fields` query parameter.
  • AniLinkAuthError: when no access token is configured
  • AniLinkValidationError: when `username` is empty or only whitespace
  • AniLinkRestError: for a non-success MyAnimeList response
  • AniLinkNetworkError: for timeout, cancellation, or other transport failures

Example

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

mal.user.animeList

MyAnimeListUserApi.animeList gets a user's anime list through MalUserOperation.animeList. It is the public facade for GET /users/{user_name}/animelist; username accepts a user name or @me. A public list needs only MalCredentials.clientId (or an access token), since MAL rejects unauthenticated requests. @me and private lists need an access token (a client ID alone cannot resolve @me). The @me check is case-insensitive and ignores surrounding whitespace. Use MalUserAnimeListParams to filter by status, sort, and page with limit/offset.

Signature

TypeScript
animeList(params: MalUserAnimeListParams, options?: MalRequestOptions): Promise<MalUserAnimeListResponse>

Auth: Not required for public user lists; `@me` and private lists require an access token, because a client ID alone cannot resolve `@me`.

NameTypeRequiredDescription
paramsMalUserAnimeListParamsyesThe anime-list read inputs; a MalUserAnimeListParams carrying the username plus the optional status, sort, and paging filters.
  usernamestringnoThe MyAnimeList username, or `@me` for the authenticated user.
  statusMalAnimeListStatusValuenoThe watch status to filter by; one of MalAnimeListStatusValue. Omit to return all.
  sortMalAnimeListSortnoThe sort order; one of MalAnimeListSort.
  limitnumbernoThe number of entries per page; defaults to 100, capped at 1000 by MyAnimeList.
  offsetnumbernoThe offset of the first entry; defaults to 0.
optionsMalRequestOptionsnoOptional field selection and transport settings; a MalRequestOptions merged over the instance defaults.
  fieldsstring | readonly string[]noA comma-separated field selector, or the same selector as an array.
  timeoutnumbernoMilliseconds before a request is aborted. `0` disables the Axios timeout. Defaults to DEFAULT_REQUEST_TIMEOUT; timeout errors carry the effective duration as `AniLinkNetworkError.timeoutMs`.
  signalAbortSignalnoSignal used to cancel in-flight requests.
FieldTypeDescription
dataMalUserAnimeListEntry[]The anime list entries on this page.
pagingMalPagingThe paging node with the next/previous page URLs, when the list continues.
  • AniLinkAuthError: when `username` is `@me` and no access token is configured
  • AniLinkValidationError: when `username` is empty or only whitespace
  • AniLinkRestError: for a non-success MyAnimeList response
  • AniLinkNetworkError: for timeout, cancellation, or other transport failures

Example

TypeScript
const api = new AniLink({ mal: { accessToken: "mal-token" } }).mal;
const list = await api.user.animeList(
  { username: "@me", status: "watching" },
  { fields: ["id", "title", "list_status"] }
);
console.log(list.data[0]?.node.title);

mal.user.mangaList

MyAnimeListUserApi.mangaList gets a user's manga list through MalUserOperation.mangaList. It is the public facade for GET /users/{user_name}/mangalist; username accepts a user name or @me. A public list needs only MalCredentials.clientId (or an access token), since MAL rejects unauthenticated requests. @me and private lists need an access token (a client ID alone cannot resolve @me). The @me check is case-insensitive and ignores surrounding whitespace. Use MalUserMangaListParams to filter by status, sort, and page with limit/offset.

Signature

TypeScript
mangaList(params: MalUserMangaListParams, options?: MalRequestOptions): Promise<MalUserMangaListResponse>

Auth: Not required for public user lists; `@me` and private lists require an access token, because a client ID alone cannot resolve `@me`.

NameTypeRequiredDescription
paramsMalUserMangaListParamsyesThe manga-list read inputs; a MalUserMangaListParams carrying the username plus the optional status, sort, and paging filters.
  usernamestringnoThe MyAnimeList username, or `@me` for the authenticated user.
  statusMalMangaListStatusValuenoThe reading status to filter by; one of MalMangaListStatusValue. Omit to return all.
  sortMalMangaListSortnoThe sort order; one of MalMangaListSort.
  limitnumbernoThe number of entries per page; defaults to 100, capped at 1000 by MyAnimeList.
  offsetnumbernoThe offset of the first entry; defaults to 0.
optionsMalRequestOptionsnoOptional field selection and transport settings; a MalRequestOptions merged over the instance defaults.
  fieldsstring | readonly string[]noA comma-separated field selector, or the same selector as an array.
  timeoutnumbernoMilliseconds before a request is aborted. `0` disables the Axios timeout. Defaults to DEFAULT_REQUEST_TIMEOUT; timeout errors carry the effective duration as `AniLinkNetworkError.timeoutMs`.
  signalAbortSignalnoSignal used to cancel in-flight requests.
FieldTypeDescription
dataMalUserMangaListEntry[]The manga list entries on this page.
pagingMalPagingThe paging node with the next/previous page URLs, when the list continues.
  • AniLinkAuthError: when `username` is `@me` and no access token is configured
  • AniLinkValidationError: when `username` is empty or only whitespace
  • AniLinkRestError: for a non-success MyAnimeList response
  • AniLinkNetworkError: for timeout, cancellation, or other transport failures

Example

TypeScript
const api = new AniLink({ mal: { accessToken: "mal-token" } }).mal;
const list = await api.user.mangaList(
  { username: "@me", status: "reading" },
  { fields: ["id", "title", "list_status"] }
);
console.log(list.data[0]?.node.title);

AniLink, typed AniList & MyAnimeList client for TypeScript.