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:
| Field | Meaning |
|---|---|
total | Total items across all pages |
currentPage | 1-based page number of this response |
lastPage | Last existing page number |
hasNextPage | Whether a following page exists |
perPage | Items 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
- Pagination, fetching pages automatically.
- Operation reference, with variables and responses for each method.