Skip to content

fushinori/MyAnimeList-API

Repository files navigation

MyAnimeList-API

API wrapper for MyAnimeList written in Dart.

Installation

Click here.

Get started

You're gonna need an access token to use this wrapper. To find out how to get one, click here.

import 'package:myanimelist_api/myanimelist_api.dart';

void main() async {
  // Initialize client
  var client = Client("YOUR_ACCESS_TOKEN");
}

Examples

• Node objects are objects with minimal fields like id, title and main pictures. Most methods return nodes (or variations).

// Search for anime
var animeList = await client.searchAnime("Shingeki no Kyojin");
for (var anime in animeList) {
  print(anime.id); // Most methods return objects with minimal fields
}

• Use ID to get complete anime/manga objects.

// Get complete objects using id
var anime = await client.getAnimeDetails(16498);
assert(anime.title == "Shingeki no Kyojin");
assert(anime.mainPicture.large == "https://api-cdn.myanimelist.net/images/anime/10/47347l.jpg");
assert(anime.genres[0].name == "Action");
assert(anime.createdAt == DateTime.parse("2012-12-05T12:03:21.000Z"));

• Use templates for updating lists.

var template = AnimeListTemplate(
  status: "completed",
  score: 9,
  numWatchedEpisodes: 13
);
await client.updateAnimeList(30015, template);

TODO

  • User anime list
  • Forum info
  • User manga list
  • User info