Skip to content
墨 AniLink

MyAnimeList anime operations ​

This page lists public MyAnimeList anime operations 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(params: MalAnimeGetParams, options?: MalRequestOptions): Promise<MalAnime>

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

NameTypeRequiredDescription
paramsMalAnimeGetParamsyesThe anime lookup inputs; a MalAnimeGetParams carrying the MyAnimeList anime ID.
  idnumbernoThe MyAnimeList anime ID.
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 identifier.
titlestringThe canonical MyAnimeList title.
main_pictureMalPictureOptional image variants requested through the `fields` query parameter.
synopsisstringThe synopsis, when requested via the `fields` query parameter.
statusstringThe publication/airing status, when requested (one of MAL's status values such as `finished_airing`).
meannumberThe average score out of 10, when requested via the `fields` query parameter.
num_episodesnumberThe total number of episodes, when requested via the `fields` query parameter.
media_typestringThe media type, when requested (for example `tv`, `movie`, or `ova`).
start_datestringThe first air/start date in ISO 8601 format, when requested via the `fields` query parameter.
broadcastMalBroadcastThe broadcast schedule, when requested via the `fields` query parameter.
average_episode_durationnumberThe average episode duration in seconds, when requested via the `fields` query parameter.
  • 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 anime = await api.anime.get({ id: 21 }, { fields: ["id", "title", "main_picture"] });

MyAnimeListAnimeApi.search searches MyAnimeList anime by keyword through MalAnimeOperation.search. It is the public facade for GET /anime; use MalRequestOptions.fields to select the response shape and MalRequestOptions transport settings to override per call.

Signature

TypeScript
search(params: MalAnimeSearchParams, options?: MalRequestOptions): Promise<MalAnimeSearchResponse>

Auth: Not required: a public read.

NameTypeRequiredDescription
paramsMalAnimeSearchParamsyesThe search inputs; a MalAnimeSearchParams carrying the keyword plus the optional paging filters.
  qstringnoThe search keyword.
  limitnumbernoThe number of entries per page; defaults to 100, capped at 100 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
dataMalAnimeSearchEntry[]The search-result entries on this page.
pagingMalPagingThe paging node with the next-page URL, when the list continues.
  • AniLinkValidationError: when `q` 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 results = await api.anime.search(
  { q: "one piece" },
  { fields: ["id", "title", "main_picture"] }
);
console.log(results.data[0]?.node.title);

mal.anime.seasonal

MyAnimeListAnimeApi.seasonal gets the anime of one broadcast season through MalAnimeOperation.seasonal. It is the public facade for GET /anime/season/{year}/{season}; use MalRequestOptions.fields to select the response shape and MalRequestOptions transport settings to override per call.

Signature

TypeScript
seasonal(params: MalSeasonalParams, options?: MalRequestOptions): Promise<MalSeasonalAnimeResponse>

Auth: Not required: a public read.

NameTypeRequiredDescription
paramsMalSeasonalParamsyesThe seasonal read inputs; a MalSeasonalParams carrying the year and broadcast window.
  yearnumbernoThe season's year.
  seasonMalSeasonnoThe season's broadcast window; one of MalSeason.
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
dataMalSeasonalAnime[]The seasonal anime entries on this page.
pagingMalPagingThe paging node with the next-page URL, when the list continues.
  • 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 season = await api.anime.seasonal(
  { year: 2024, season: "winter" },
  { fields: ["id", "title", "main_picture"] }
);
console.log(season.data[0]?.node.title);

mal.anime.ranking

MyAnimeListAnimeApi.ranking gets one of MyAnimeList's anime ranking lists through MalAnimeOperation.ranking. It is the public facade for GET /anime/ranking; use MalRequestOptions.fields to select the response shape and MalRequestOptions transport settings to override per call.

Signature

TypeScript
ranking(params: MalRankingParams, options?: MalRequestOptions): Promise<MalAnimeRankingResponse>

Auth: Not required: a public read.

NameTypeRequiredDescription
paramsMalRankingParamsyesThe ranking read inputs; a MalRankingParams carrying the ranking list to fetch.
  rankingTypeMalRankingTypenoThe ranking list to fetch; one of MalRankingType.
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
dataMalRankingEntry[]The ranking entries on this page.
pagingMalPagingThe paging node with the next-page URL, when the list continues.
  • 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 top = await api.anime.ranking(
  { rankingType: "airing" },
  { fields: ["id", "title", "mean"] }
);
console.log(top.data[0]?.node.title, top.data[0]?.ranking.rank);

mal.anime.suggestions

MyAnimeListAnimeApi.suggestions gets MyAnimeList's anime suggestions for the authenticated user through MalAnimeOperation.suggestions. It is the public facade for GET /anime/suggestions and requires a MAL access token from MalCredentials.accessToken via buildMyAnimeListApi; use MalRequestOptions.fields to select the response shape.

Signature

TypeScript
suggestions(options?: MalRequestOptions): Promise<MalAnimeSuggestionsResponse>

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
dataMalSuggestion[]The suggested anime entries on this page.
pagingMalPagingThe paging node with the next-page URL, when the list continues.
  • 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 suggestions = await api.anime.suggestions({
  fields: ["id", "title", "main_picture"],
});
console.log(suggestions.data[0]?.node.title);

mal.anime.updateMyListStatus

MyAnimeListAnimeApi.updateMyListStatus updates the authenticated user's anime list status through MalAnimeOperation.updateMyListStatus. It is the public facade for PATCH /anime/{id}/my_list_status and requires a MAL access token from MalCredentials.accessToken via buildMyAnimeListApi; send only the MalAnimeListStatusUpdate fields you want to change, form-encoded as MAL requires.

Signature

TypeScript
updateMyListStatus(params: MalAnimeListStatusUpdateParams, options?: MalRequestOptions): Promise<MalAnimeListStatus>

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

NameTypeRequiredDescription
paramsMalAnimeListStatusUpdateParamsyesThe list-status write inputs; a MalAnimeListStatusUpdateParams carrying the anime ID plus only the fields to change.
  idnumbernoThe MyAnimeList anime ID.
  statusMalAnimeListStatusValuenoThe watch status to set; one of MalAnimeListStatusValue.
  num_watched_episodesnumbernoThe number of episodes the user has watched.
  scorenumbernoThe user's score out of 10.
  commentsstringnoFree-form notes the user attached to the entry.
  is_rewatchingbooleannoWhether the user is currently rewatching the anime.
  num_times_rewatchednumbernoThe number of times the user has rewatched the anime.
  rewatch_valuenumbernoThe rewatch value rating (0-5).
  prioritynumbernoThe priority rating (0-2).
  tagsreadonly string[]noUser-defined tags attached to the entry; sent as a comma-separated string.
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
statusMalAnimeListStatusValueThe current watch status; one of MalAnimeListStatusValue.
num_episodes_watchednumberThe number of episodes the user has watched; MAL reports this as `num_episodes_watched`.
scorenumberThe user's score out of 10.
start_datestringThe date the user started watching, in ISO 8601 form; may be a partial date (`YYYY-MM` or `YYYY`).
finish_datestringThe date the user finished watching, in ISO 8601 form; may be a partial date (`YYYY-MM` or `YYYY`).
commentsstringFree-form notes the user attached to the entry.
is_rewatchingbooleanWhether the user is currently rewatching the anime.
num_times_rewatchednumberThe number of times the user has rewatched the anime.
rewatch_valuenumberThe rewatch value rating (0-5).
prioritynumberThe priority rating (0-2).
tagsstring[]User-defined tags attached to the entry, as an array of strings.
updated_atstringThe server-managed timestamp of the last update, in ISO 8601 form.
  • AniLinkAuthError: when no MAL access token is configured
  • AniLinkValidationError: when params carries no known list-status field to change
  • 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 status = await api.anime.updateMyListStatus({
  id: 21,
  status: "watching",
  num_watched_episodes: 10,
  score: 9,
});

mal.anime.deleteFromList

MyAnimeListAnimeApi.deleteFromList removes an anime from the authenticated user's list through MalAnimeOperation.deleteFromList. It is the public facade for DELETE /anime/{id}/my_list_status and requires a MAL access token from MalCredentials.accessToken via buildMyAnimeListApi.

Signature

TypeScript
deleteFromList(params: MalAnimeDeleteParams, options?: MalRequestOptions): Promise<void>

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

NameTypeRequiredDescription
paramsMalAnimeDeleteParamsyesThe delete inputs; a MalAnimeDeleteParams carrying the MyAnimeList anime ID.
  idnumbernoThe MyAnimeList anime ID.
optionsMalRequestOptionsnoOptional transport settings; a MalRequestOptions merged over the instance defaults.
  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.

See the TypeDoc page for the full void shape.

  • 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;
await api.anime.deleteFromList({ id: 21 });

AniLink, typed AniList & MyAnimeList client for TypeScript.