Querying data
The query surface is grouped by domain. Every method takes a typed variables object and an optional trailing RequestOptions.
Media
| Operation | Purpose |
|---|---|
query.media | One anime or manga by id or idMal |
query.mediaTrend | Popularity/progression trends for a media |
query.airingSchedule | Airing schedule for a media |
typescript
const anime = await aniLink.anilist.query.media({ id: 21, type: "ANIME" });Characters & staff
| Operation | Purpose |
|---|---|
query.character | One character with their media |
query.staff | One staff member with their media and characters |
Studios
| Operation | Purpose |
|---|---|
query.studio | One studio with its productions |
Users
| Operation | Purpose |
|---|---|
query.user | One user by id or name |
query.viewer | The authenticated user (token required) |
query.following | Users a user follows |
query.follower | Users following a user |
Lists
| Operation | Purpose |
|---|---|
query.mediaList | One list entry for a user and media |
query.mediaListCollection | A user's whole list collection, chunked |
mediaListCollection returns lists nested by status and custom list. Flatten it with flattenMediaListCollection and walk large collections with paginateChunks.
Taxonomy
| Operation | Purpose |
|---|---|
query.genreCollection | All genres |
query.mediaTagCollection | All tags |
query.externalLinkSourceCollection | External link sources |
Activity
| Operation | Purpose |
|---|---|
query.activity | One activity |
query.activityReply | One activity reply |
query.notification | Notifications for the viewer (token required) |
Community
| Operation | Purpose |
|---|---|
query.thread | One forum thread |
query.threadComment | One thread comment |
Reviews & recommendations
| Operation | Purpose |
|---|---|
query.review | One review |
query.recommendation | One recommendation |
Misc
| Operation | Purpose |
|---|---|
query.markdown | Render AniList markdown to HTML |
query.aniChartUser | AniChart settings for the viewer |
query.siteStatistics | Site-wide statistics |
Example with variables
typescript
const character = await aniLink.anilist.query.character({
id: 1,
asHtml: true,
mediaSort: ["POPULARITY_DESC"],
mediaPage: 1,
mediaPerPage: 10,
});Next steps
- Page queries — fetching a single known page.
- Pagination — collecting many pages automatically.
- Query operation reference — variables and response shapes per operation.