Unofficial implementation of the MyAnimeList API for .NET
You can install this package via the Package Manager Console
in Visual Studio.
Install-Package MovieCollection.MyAnimeList -PreRelease
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);
You can search for an anime via the GetAnimeListAsync
method.
var search = new NewAnimeSearch
{
Query = "jjk",
};
var result = await service.GetAnimeListAsync(search);
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.
- Some methods has not been implemented (e.g. Authentication, Forum, Manga, Users).
- Please read MyAnimeList's terms of use before using their services.
This project is licensed under the MIT License.