Unofficial implementation of the MyAnimeList API for .NET
You can install this package by entering the following command into your Package Manager Console
:
Install-Package MovieCollection.MyAnimeList -PreRelease
First, define an instance of the HttpClient
class if you haven't already.
// HttpClient is intended to be instantiated once per application, rather than per-use.
// See https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient
private static readonly HttpClient httpClient = new HttpClient();
Then, you need to set your api key.
// 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 check out the demo project for more examples.
- Some methods has not been implemented (e.g. Authentication, Forum, Manga, Users).
- Thanks to MyAnimeList for providing free API services.
- Please read MyAnimeList terms of use before using their services.
This project is licensed under the MIT License.