Skip to main content
Annie Mei uses the AniList GraphQL API to fetch comprehensive anime and manga metadata. All queries are sent to the official AniList endpoint with standard GraphQL request formatting.

Endpoint

All requests are sent via HTTP POST with the following headers:
Source: src/utils/requests/anilist.rs:10-24

Anime Queries

Fetch Anime by ID

Retrieves detailed information for a specific anime using its AniList ID.
Source: src/commands/anime/queries.rs:1-56

Search Anime

Searches for anime using a text query with pagination support.
Source: src/commands/anime/queries.rs:58-123

Manga Queries

Fetch Manga by ID

Retrieves detailed information for a specific manga using its AniList ID.
Source: src/commands/manga/queries.rs:1-60

Search Manga

Searches for manga using a text query with pagination support.
Source: src/commands/manga/queries.rs:62-131

Response Models

Anime Response

The anime data is deserialized into the Anime struct:
Source: src/models/anilist_anime.rs:14-41

Supporting Structures

Source: src/models/anilist_anime.rs:43-72

Manga Response

The manga data is deserialized into the Manga struct:
Source: src/models/anilist_manga.rs:16-42

Supporting Structures

Source: src/models/anilist_manga.rs:44-71

Data Transformations

Both Anime and Manga models implement the Transformers trait which provides methods for formatting data for Discord embeds:
  • Episode/Chapter counting: For currently airing anime, displays aired episodes vs total (e.g., “7/12”)
  • Season formatting: Combines season and year (e.g., “Fall 2024”)
  • Studio/Staff extraction: Identifies main studios or story/art staff from the edges/nodes structure
  • Link filtering: Extracts streaming links for supported platforms (Netflix, Crunchyroll, HBO)
  • Trailer formatting: Converts YouTube trailer IDs to full URLs
Source: src/models/anilist_anime.rs:74-306 and src/models/anilist_manga.rs:73-305

Rate Limiting

AniList does not currently enforce strict rate limits on their GraphQL API, but the bot uses blocking HTTP requests which naturally throttle request frequency. Future implementations may add explicit rate limiting or request caching.