Skip to content

moviecollection/my-anime-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MyAnimeList API

Unofficial implementation of the MyAnimeList API for .NET

NuGet Version NuGet Downloads

Installation

You can install this package via the Package Manager Console in Visual Studio.

Install-Package MovieCollection.MyAnimeList -PreRelease

Configuration

Get or create a new static HttpClient instance if you don't have one already.

// HttpClient lifecycle management best practices:
// https://learn.microsoft.com/dotnet/fundamentals/networking/http/httpclient-guidelines#recommended-use
private static readonly HttpClient httpClient = new HttpClient();

Then, you need to set your api key and pass it to the service's constructor.

// using MovieCollection.MyAnimeList;

var options = new MyAnimeListOptions
{
    ApiKey = "your-api-key",
};

var service = new MyAnimeListService(httpClient, options);

Anime List

You can search for an anime via the GetAnimeListAsync method.

var search = new NewAnimeSearch
{
    Query = "jjk",
};

var result = await service.GetAnimeListAsync(search);

Anime Details

You can get anime details via the GetAnimeDetailsAsync method.

var search = new NewAnimeDetails
{
    AnimeId = 51009,
    Fields = AnimeFields.All,
};

var item = await service.GetAnimeDetailsAsync(search);

Please see the demo project for more examples.

Limitations

  • Some methods has not been implemented (e.g. Authentication, Forum, Manga, Users).

Notes

License

This project is licensed under the MIT License.