A simple, type-safe TypeScript wrapper for the AniList API. Build awesome anime and manga apps without the hassle of dealing with raw GraphQL queries.
Ever wanted to build something cool with anime data but got stuck trying to figure out AniList's GraphQL API? This wrapper makes it dead simple. Just import, initialize, and start fetching data.
Built with TypeScript for that sweet autocomplete and type safety. No more guessing what properties are available on your anime objects!
// npm
npm install @tdanks2000/anilist-wrapper
// bun
bun add @tdanks2000/anilist-wrapper
// yarn
yarn add @tdanks2000/anilist-wrapper
// pnpm
pnpm add @tdanks2000/anilist-wrapper
import { Anilist } from "@tdanks2000/anilist-wrapper";
// Create an instance (no token needed for public data)
const anilist = new Anilist();
// Get info about Attack on Titan
const aot = await anilist.anime.getAnimeById(16498);
console.log(aot.title.english); // "Attack on Titan"
// Search for anime
const results = await anilist.anime.searchAnime("One Piece");
console.log(results.length); // Number of results found
- Get anime by ID or search by title
- Fetch characters, staff, and recommendations
- Get trending and popular anime
- Find anime by genre
- Same features as anime, but for manga
- Search, get details, characters, staff, etc.
- Get character info and birthdays
- Find staff members and their work
- Toggle favorites (with auth)
- Get user profiles and statistics
- Fetch user's anime/manga lists
- Requires authentication
- Manage user's anime and manga lists
- Add, update, remove entries
- Requires authentication
Some features need you to be logged in. Get an access token from AniList's auth guide and pass it to the constructor:
const anilist = new Anilist("your_access_token_here");
const trending = await anilist.anime.getAnimeTrending();
console.log(trending[0].title.english);
const characters = await anilist.character.getCharacterById(1);
console.log(characters.name.full);
const userList = await anilist.user.getUserAnimeList("username");
console.log(userList.length); // Number of anime in their list
const actionAnime = await anilist.anime.getAnimeListByGenre("Action");
console.log(actionAnime.length); // Number of action anime
Found a bug? Want to add a feature? Contributions are welcome! Check out the contributing guide to get started.
MIT License - use it however you want!
Having trouble? Open an issue on GitHub and I'll help you out.