Skip to content
墨 AniLink

Page queries ​

aniLink.anilist.query.page.* fetches one known page of a collection. Each method mirrors a top-level query but adds page and perPage controls, and returns a pageInfo object alongside the items.

When to fetch a single known page ​

  • You know the page number, for example, when resuming a sync.
  • You want one slice of results, such as the top 10 trending items.
  • You are building your own pagination loop.

To collect everything instead, use the pagination helpers.

Available page queries ​

medias, characters, staffs, studios, mediaLists, airingSchedules, mediaTrends, notifications, followers, following, activities, activityReplies, threads, threadComments, reviews, recommendations, users, likes.

pageInfo semantics ​

Every page response includes pageInfo:

FieldMeaning
totalTotal items across all pages
currentPage1-based page number of this response
lastPageLast existing page number
hasNextPageWhether a following page exists
perPageItems per page for this response

Example ​

typescript
const page = await aniLink.anilist.query.page.medias({
    page: 1,
    perPage: 10,
    type: "ANIME",
    sort: ["POPULARITY_DESC"],
});

console.log(page.pageInfo.hasNextPage, page.media.length);

Next steps ​

AniLink, typed AniList & MyAnimeList client for TypeScript.