### Jikan.Net Dependency Injection Setup Source: https://context7.com/ervie/jikan.net/llms.txt Code examples for setting up Jikan client with dependency injection using various frameworks. ```APIDOC ## Dependency Injection Setup Register the Jikan client for dependency injection in your application. ```csharp // Microsoft.Extensions.DependencyInjection var services = new ServiceCollection() .AddSingleton() .BuildServiceProvider(); // With HttpClientFactory for custom timeout/settings services.AddHttpClient(client => { client.Timeout = TimeSpan.FromSeconds(10); client.BaseAddress = new Uri("https://api.jikan.moe/v4"); }); // Autofac public class JikanModule : Module { public override void Load(ContainerBuilder builder) { builder.RegisterType().As(); } } // Ninject public class JikanModule : NinjectModule { public override void Load() { Bind().To(); } } ``` ``` -------------------------------- ### Jikan.Net Installation Source: https://context7.com/ervie/jikan.net/llms.txt Instructions on how to install the JikanDotNet NuGet package. ```APIDOC ## Installation Install the JikanDotNet NuGet package to add the library to your project. ```bash # Package Manager PM> Install-Package JikanDotNet # .NET CLI dotnet add package JikanDotNet dotnet restore ``` ``` -------------------------------- ### Install JikanDotNet NuGet Package Source: https://context7.com/ervie/jikan.net/llms.txt Install the JikanDotNet NuGet package using Package Manager or the .NET CLI. ```bash # Package Manager PM> Install-Package JikanDotNet # .NET CLI dotnet add package JikanDotNet dotnet restore ``` -------------------------------- ### Jikan.Net Initialization Source: https://context7.com/ervie/jikan.net/llms.txt Examples of how to initialize the Jikan client with different configurations. ```APIDOC ## Initialization Create a Jikan client instance to start making requests to the MyAnimeList API. ```csharp using JikanDotNet; // Basic initialization IJikan jikan = new Jikan(); // With custom configuration var config = new JikanClientConfiguration { SuppressException = false, // Throw exceptions on failed requests LimiterConfigurations = TaskLimiterConfiguration.Default }; var jikan = new Jikan(config); // Using custom endpoint (self-hosted Jikan instance) var config = new JikanClientConfiguration { Endpoint = "https://your-jikan-instance.example.com/v4" }; var jikan = new Jikan(config); ``` ``` -------------------------------- ### Get Manga Recommendations Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves recommendations based on a manga. ```csharp var recs = await jikan.GetMangaRecommendationsAsync(2); ``` -------------------------------- ### Get Producers Async Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves a list of producers. Supports pagination. ```csharp var producers = await jikan.GetProducersAsync(); ``` -------------------------------- ### Install Jikan.net via .NET CLI Source: https://github.com/ervie/jikan.net/blob/master/README.md Use the .NET CLI to add the package and restore dependencies. ```bash >dotnet add package JikanDotNet ``` ```bash >dotnet restore ``` -------------------------------- ### Get Manga Reviews Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves reviews for a manga. ```csharp var reviews = await jikan.GetMangaReviewsAsync(2); ``` -------------------------------- ### Install JikanDotNet via .NET CLI Source: https://github.com/ervie/jikan.net/blob/master/docs/GettingStarted.md Use the .NET CLI to add the package and restore dependencies. ```bash dotnet add package JikanDotNet ``` ```bash dotnet restore ``` -------------------------------- ### Get Top Reviews Async Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves a list of the most popular reviews. Supports pagination. ```csharp var top = await jikan.GetTopReviewsAsync(); ``` -------------------------------- ### Install Jikan.net via Package Manager Source: https://github.com/ervie/jikan.net/blob/master/README.md Use the NuGet Package Manager console to add the library to your project. ```powershell PM> Install-Package JikanDotNet ``` -------------------------------- ### Get Anime Seasons Source: https://context7.com/ervie/jikan.net/llms.txt Retrieves anime listings for a specific season and year, the current airing season, and upcoming anime. Also shows how to get a list of available season archives. ```csharp var jikan = new Jikan(); // Get specific season var spring2024 = await jikan.GetSeasonAsync(2024, Season.Spring); foreach (var anime in spring2024.Data) { Console.WriteLine($"{anime.Title} - {anime.Type}"); } // With pagination var page2 = await jikan.GetSeasonAsync(2024, Season.Spring, 2); // Get current airing season var current = await jikan.GetCurrentSeasonAsync(); foreach (var anime in current.Data) { Console.WriteLine($"{anime.Title} - Airing: {anime.Airing}"); } // Get upcoming anime (marked as "Later" on MAL) var upcoming = await jikan.GetUpcomingSeasonAsync(); // Get available season archive var archive = await jikan.GetSeasonArchiveAsync(); foreach (var s in archive.Data) { Console.WriteLine($"Year: {s.Year}, Seasons: {string.Join(", ", s.Seasons)}"); } ``` -------------------------------- ### Get Season Archive Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves a list of all available seasons. ```csharp var archive = await jikan.GetSeasonArchiveAsync(); foreach (var s in archive.Data) Console.WriteLine($"{s.Year} {s.Season}"); ``` -------------------------------- ### Get Person Data Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves person details by their MAL ID. ```csharp var person = await jikan.GetPersonAsync(1870); Console.WriteLine(person.Data.FamilyName); Console.WriteLine(person.Data.GivenName); ``` -------------------------------- ### Get Anime Videos Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves promotional videos, episodes, and music videos for an anime. ```csharp var videos = await jikan.GetAnimeVideosAsync(1); // videos.Data contains Promo, Episodes, MusicVideos ``` -------------------------------- ### Apply Predefined Rate Limiting Setups in C# Source: https://github.com/ervie/jikan.net/blob/master/docs/RateLimiting.md Use built-in configurations for default rate limiting or to disable it entirely. ```csharp // Default rules (passed explicitly) var config = new JikanClientConfiguration { LimiterConfigurations = TaskLimiterConfiguration.Default }; var jikan = new Jikan(config); // No rate limiting var config = new JikanClientConfiguration { LimiterConfigurations = TaskLimiterConfiguration.None }; var jikan = new Jikan(config); ``` -------------------------------- ### Get Seasonal Anime Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves a preview of anime for a specific year and season. ```csharp var season = await jikan.GetSeasonAsync(2024, Season.Spring); foreach (var anime in season.Data) Console.WriteLine(anime.Title); ``` -------------------------------- ### Get User About Async Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Fetches the profile description or 'about me' section for a given user using their username. ```csharp var about = await jikan.GetUserAboutAsync("username"); ``` -------------------------------- ### Get Manga Pictures Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves a set of images for a manga. ```csharp var pictures = await jikan.GetMangaPicturesAsync(2); ``` -------------------------------- ### Get Manga Additional Info Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves supplementary information for a manga. ```csharp var info = await jikan.GetMangaMoreInfoAsync(2); ``` -------------------------------- ### Get Anime Themes Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves opening and ending themes for an anime. Requires the MAL ID. ```csharp var themes = await jikan.GetAnimeThemesAsync(1); // themes.Data contains Openings, Endings ``` -------------------------------- ### Get Character Details Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves detailed information about a character by their ID. ```csharp var character = await jikan.GetCharacterAsync(2219); Console.WriteLine(character.Data.Name); Console.WriteLine(character.Data.About); ``` -------------------------------- ### Get Anime Video Episodes Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves a paginated list of video episodes for an anime. ```csharp var episodes = await jikan.GetAnimeVideosEpisodesAsync(1); foreach (var ep in episodes.Data) Console.WriteLine(ep.Title); ``` -------------------------------- ### Get Person Pictures Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves image links for a person by their MAL ID. ```csharp var pictures = await jikan.GetPersonPicturesAsync(1870); ``` -------------------------------- ### Get Character Pictures Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves image links for a character by their MAL ID. ```csharp var pictures = await jikan.GetCharacterPicturesAsync(2219); ``` -------------------------------- ### Get Anime Recommendations Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves a list of recommendations for a given anime. Requires the MAL ID. ```csharp var recs = await jikan.GetAnimeRecommendationsAsync(1); foreach (var r in recs.Data) Console.WriteLine(r.Content); ``` -------------------------------- ### Get Full Manga Data Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves comprehensive data for a manga. ```csharp var full = await jikan.GetMangaFullDataAsync(2); ``` -------------------------------- ### Get Anime More Info Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Fetches additional information for a specific anime. Requires the MAL ID. ```csharp var info = await jikan.GetAnimeMoreInfoAsync(1); Console.WriteLine(info.Data.MoreInfo); ``` -------------------------------- ### Get Anime Pictures Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves a collection of image links for an anime. ```csharp var pictures = await jikan.GetAnimePicturesAsync(1); foreach (var img in pictures.Data) Console.WriteLine(img.Jpg?.ImageUrl); ``` -------------------------------- ### Get Anime Details Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves anime information by its MyAnimeList ID. ```csharp var anime = await jikan.GetAnimeAsync(1); Console.WriteLine(anime.Data.Title); Console.WriteLine(anime.Data.Type); ``` -------------------------------- ### Get Anime Episodes with C# Source: https://context7.com/ervie/jikan.net/llms.txt Fetches paginated episode lists for an anime, including metadata and specific episode details. ```csharp var jikan = new Jikan(); // Get first page of episodes var response = await jikan.GetAnimeEpisodesAsync(1); foreach (var episode in response.Data) { Console.WriteLine($"Ep {episode.MalId}: {episode.Title}"); Console.WriteLine($" Japanese: {episode.TitleJapanese}"); Console.WriteLine($" Aired: {episode.Aired}"); Console.WriteLine($" Filler: {episode.Filler}"); Console.WriteLine($" Score: {episode.Score}"); } // Pagination info Console.WriteLine($"Has next page: {response.Pagination.HasNextPage}"); Console.WriteLine($"Total items: {response.Pagination.Items.Total}"); // Get specific page (for anime with many episodes) var page2 = await jikan.GetAnimeEpisodesAsync(21, 2); // One Piece, page 2 // Get specific episode details var episode1 = await jikan.GetAnimeEpisodeAsync(1, 1); Console.WriteLine(episode1.Data.Synopsis); ``` -------------------------------- ### Get Top People Async Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves a list of the most popular people. Supports pagination. ```csharp var top = await jikan.GetTopPeopleAsync(); ``` -------------------------------- ### Get Schedule Async by Day Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Fetches the anime schedule for a specific day of the week. An optional page index can also be provided. ```csharp var schedule = await jikan.GetScheduleAsync(ScheduledDay.Monday); foreach (var anime in schedule.Data) Console.WriteLine(anime.Title); ``` -------------------------------- ### Get Manga External Links Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves external service links for a manga. ```csharp var links = await jikan.GetMangaExternalLinksAsync(2); ``` -------------------------------- ### Get Character Appearances with C# Source: https://context7.com/ervie/jikan.net/llms.txt Retrieves the anime or manga appearances for a specific character. ```csharp var jikan = new Jikan(); // Get anime appearances var animeResponse = await jikan.GetCharacterAnimeAsync(2219); foreach (var entry in animeResponse.Data) { Console.WriteLine($"{entry.Anime?.Title} - {entry.Role}"); } // Get manga appearances var mangaResponse = await jikan.GetCharacterMangaAsync(2219); foreach (var entry in mangaResponse.Data) { Console.WriteLine($"{entry.Manga?.Title} - {entry.Role}"); } ``` -------------------------------- ### Get Full Person Data Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves comprehensive data for a person by their MAL ID. ```csharp var full = await jikan.GetPersonFullDataAsync(1870); ``` -------------------------------- ### Get Manga Details with C# Source: https://context7.com/ervie/jikan.net/llms.txt Fetches detailed information for a manga using its MyAnimeList ID. ```csharp var jikan = new Jikan(); // Get manga by MAL ID (2 = Berserk) var response = await jikan.GetMangaAsync(2); var manga = response.Data; Console.WriteLine($"Title: {manga.Title}"); // "Berserk" Console.WriteLine($"Type: {manga.Type}"); // "Manga" Console.WriteLine($"Chapters: {manga.Chapters}"); // null (ongoing) Console.WriteLine($"Volumes: {manga.Volumes}"); Console.WriteLine($"Status: {manga.Status}"); // "Publishing" Console.WriteLine($"Score: {manga.Score}"); // 9.43 Console.WriteLine($"Synopsis: {manga.Synopsis}"); // Authors foreach (var author in manga.Authors) Console.WriteLine($"Author: {author.Name}"); // Serialization info foreach (var serial in manga.Serializations) Console.WriteLine($"Serialized in: {serial.Name}"); ``` -------------------------------- ### Get User By ID Async Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Fetches a user's profile by their numeric MAL ID. This is an alternative to using the username. ```csharp var profile = await jikan.GetUserByIdAsync(12345); ``` -------------------------------- ### Get Anime External Links Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Fetches external service links for an anime. Requires the MAL ID. ```csharp var links = await jikan.GetAnimeExternalLinksAsync(1); foreach (var l in links.Data) Console.WriteLine($"{l.Name}: {l.Url}"); ``` -------------------------------- ### Get Anime Episodes Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves a list of episodes for an anime, with optional pagination support. ```csharp var episodes = await jikan.GetAnimeEpisodesAsync(1); foreach (var ep in episodes.Data) Console.WriteLine($"Ep {ep.MalId}: {ep.Title}"); ``` -------------------------------- ### Get Anime Staff with C# Source: https://context7.com/ervie/jikan.net/llms.txt Retrieves the staff members associated with an anime and their respective roles. ```csharp var jikan = new Jikan(); var response = await jikan.GetAnimeStaffAsync(1); foreach (var staff in response.Data) { var positions = string.Join(", ", staff.Position); Console.WriteLine($"{staff.Person.Name} - {positions}"); } ``` -------------------------------- ### Get Full Character Data Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves comprehensive data for a character by their MAL ID. ```csharp var full = await jikan.GetCharacterFullDataAsync(2219); ``` -------------------------------- ### Get Top Characters Async Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves a list of the most popular characters. Supports pagination. ```csharp var top = await jikan.GetTopCharactersAsync(); ``` -------------------------------- ### Get Manga Forum Topics Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves forum topics related to a specific manga. ```csharp var topics = await jikan.GetMangaForumTopicsAsync(2); foreach (var t in topics.Data) Console.WriteLine(t.Title); ``` -------------------------------- ### Get Anime Reviews Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves reviews for an anime, with options for pagination, preliminary, and spoiler reviews. Requires the MAL ID and optional parameters. ```csharp var reviews = await jikan.GetAnimeReviewsAsync(1); foreach (var r in reviews.Data) Console.WriteLine($"{r.User?.Username}: {r.Score}"); ``` -------------------------------- ### Get Producer Full Data Async Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves comprehensive data for a specific producer using their MAL ID. Ensure the producer ID is valid. ```csharp var full = await jikan.GetProducerFullDataAsync(1); ``` -------------------------------- ### Get Character Details with C# Source: https://context7.com/ervie/jikan.net/llms.txt Retrieves detailed information about a character by their MyAnimeList ID. ```csharp var jikan = new Jikan(); // Get character (2219 = Lain Iwakura) var response = await jikan.GetCharacterAsync(2219); var character = response.Data; Console.WriteLine($"Name: {character.Name}"); Console.WriteLine($"Name (Kanji): {character.NameKanji}"); Console.WriteLine($"Favorites: {character.Favorites}"); Console.WriteLine($"About: {character.About}"); Console.WriteLine($"URL: {character.Url}"); // Nicknames foreach (var nickname in character.Nicknames) Console.WriteLine($"Nickname: {nickname}"); ``` -------------------------------- ### Get Manga Relations Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves related entries for a manga. ```csharp var relations = await jikan.GetMangaRelationsAsync(2); ``` -------------------------------- ### Get Anime User Updates Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Fetches user updates for an anime, with optional pagination. Requires the MAL ID and an optional page index. ```csharp var updates = await jikan.GetAnimeUserUpdatesAsync(1); foreach (var u in updates.Data) Console.WriteLine($"{u.User?.Username}: {u.Score}"); ``` -------------------------------- ### Get Anime Full Data Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Fetches an anime with all associated data, including relations and news. Requires the MAL ID. ```csharp var full = await jikan.GetAnimeFullDataAsync(1); // full.Data contains anime plus relations, news, etc. ``` -------------------------------- ### Initialize Jikan Client Source: https://context7.com/ervie/jikan.net/llms.txt Create a Jikan client instance for making requests. Supports basic initialization, custom configurations, and custom endpoints. ```csharp using JikanDotNet; // Basic initialization IJikan jikan = new Jikan(); // With custom configuration var config = new JikanClientConfiguration { SuppressException = false, // Throw exceptions on failed requests LimiterConfigurations = TaskLimiterConfiguration.Default }; var jikan = new Jikan(config); // Using custom endpoint (self-hosted Jikan instance) var config = new JikanClientConfiguration { Endpoint = "https://your-jikan-instance.example.com/v4" }; var jikan = new Jikan(config); ``` -------------------------------- ### Get User Statistics Async Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves a user's anime and manga statistics based on their username. This provides insights into their viewing and reading habits. ```csharp var stats = await jikan.GetUserStatisticsAsync("username"); ``` -------------------------------- ### Get Manga Statistics Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves statistical data for a manga. ```csharp var stats = await jikan.GetMangaStatisticsAsync(2); Console.WriteLine($"Score: {stats.Data.Score?.Mean}"); ``` -------------------------------- ### Initialize Jikan Client and Fetch Data Source: https://github.com/ervie/jikan.net/blob/master/docs/README.md Demonstrates initializing the Jikan client and fetching anime, manga, person, and character data by their MyAnimeList IDs. All response models contain a 'Data' property with the actual response data. Paginated endpoints also include pagination metadata. ```csharp // Initialize Jikan client var jikan = new Jikan(); // Get anime by MAL id (e.g. Cowboy Bebop) var bebop = await jikan.GetAnimeAsync(1); Console.WriteLine(bebop.Data.Title); // "Cowboy Bebop" Console.WriteLine(bebop.Data.Type); // "TV" Console.WriteLine(bebop.Data.Rating); // "R - 17+ (violence & profanity)" // Get manga by MAL id (e.g. Berserk) var berserk = await jikan.GetMangaAsync(2); Console.WriteLine(berserk.Data.Title); // "Berserk" Console.WriteLine(berserk.Data.Status); // "Publishing" // Get person by MAL id (e.g. Hayao Miyazaki) var miyazaki = await jikan.GetPersonAsync(1870); Console.WriteLine(miyazaki.Data.FamilyName); // "Miyazaki" // Get character by MAL id (e.g. Lain Iwakura) var lain = await jikan.GetCharacterAsync(2219); Console.WriteLine(lain.Data.Url); // "https://myanimelist.net/character/2219/Lain_Iwakura" ``` -------------------------------- ### Initialize Jikan Instance Source: https://github.com/ervie/jikan.net/blob/master/docs/GettingStarted.md Create a new Jikan instance for making API requests, optionally with custom configuration. ```csharp IJikan jikan = new Jikan(); ``` ```csharp var config = new JikanClientConfiguration { Endpoint = "https://api.jikan.moe/v4" }; var jikan = new Jikan(config); ``` -------------------------------- ### Get Top Manga Async Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves a list of top-ranked manga. Supports pagination and advanced search configurations. ```csharp var top = await jikan.GetTopMangaAsync(); ``` -------------------------------- ### Get Person Mangaography Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves the mangaography for a person by their MAL ID. ```csharp var manga = await jikan.GetPersonMangaAsync(1870); ``` -------------------------------- ### Search Anime (Simple and Advanced) Source: https://context7.com/ervie/jikan.net/llms.txt Demonstrates searching for anime using a simple query string and a detailed configuration object. Includes filtering by type, status, rating, and ordering. ```csharp var jikan = new Jikan(); // Simple search var response = await jikan.SearchAnimeAsync("cowboy bebop"); foreach (var anime in response.Data) { Console.WriteLine($"{anime.Title} ({anime.Year}) - Score: {anime.Score}"); } // Advanced search with filters var searchConfig = new AnimeSearchConfig { Query = "bebop", Type = AnimeType.TV, Status = AiringStatus.Complete, Rating = AnimeAgeRating.R17, OrderBy = AnimeSearchOrderBy.Score, SortDirection = SortDirection.Descending, Page = 1, Limit = 10 }; var filtered = await jikan.SearchAnimeAsync(searchConfig); foreach (var anime in filtered.Data) { Console.WriteLine($"{anime.Title} - {anime.Score}"); } // Pagination Console.WriteLine($"Page: {filtered.Pagination.CurrentPage}"); Console.WriteLine($"Total Results: {filtered.Pagination.Items.Total}"); ``` -------------------------------- ### Search Characters and People Source: https://context7.com/ervie/jikan.net/llms.txt Demonstrates searching for characters and people by name. Includes examples of simple searches and searches using configuration objects with sorting options. ```csharp var jikan = new Jikan(); // Search characters var characters = await jikan.SearchCharacterAsync("lain"); foreach (var c in characters.Data) { Console.WriteLine($"{c.Name} - Favorites: {c.Favorites}"); } // Search with config var charConfig = new CharacterSearchConfig { Query = "lain", OrderBy = CharacterSearchOrderBy.Favorites, SortDirection = SortDirection.Descending }; var filteredChars = await jikan.SearchCharacterAsync(charConfig); // Search people var people = await jikan.SearchPersonAsync("miyazaki"); foreach (var p in people.Data) { Console.WriteLine($"{p.Name} - Favorites: {p.MemberFavorites}"); } ``` -------------------------------- ### Get Person Animeography Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves the animeography for a person by their MAL ID. ```csharp var anime = await jikan.GetPersonAnimeAsync(1870); foreach (var entry in anime.Data) Console.WriteLine(entry.Anime?.Title); ``` -------------------------------- ### Retrieve Watch Promos Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Fetches recently released or popular promotional videos. ```csharp var promos = await jikan.GetWatchRecentPromosAsync(); ``` ```csharp var promos = await jikan.GetWatchPopularPromosAsync(); ``` -------------------------------- ### Get Anime Characters with C# Source: https://context7.com/ervie/jikan.net/llms.txt Retrieves a list of characters for a specific anime, including their roles and associated voice actors. ```csharp var jikan = new Jikan(); var response = await jikan.GetAnimeCharactersAsync(1); foreach (var character in response.Data) { Console.WriteLine($"{character.Character.Name} - {character.Role}"); Console.WriteLine($" Favorites: {character.Favorites}"); // Voice actors for each character foreach (var va in character.VoiceActors) Console.WriteLine($" VA: {va.Person.Name} ({va.Language})"); } ``` -------------------------------- ### Get Manga Details Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves basic manga information using its MAL ID. Requires the MAL ID of the manga. ```csharp var manga = await jikan.GetMangaAsync(2); Console.WriteLine(manga.Data.Title); Console.WriteLine(manga.Data.Status); ``` -------------------------------- ### Get Magazines Async Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Fetches a list of magazines. An optional page parameter can be provided to paginate through the results. If no page is specified, it defaults to the first page. ```csharp var magazines = await jikan.GetMagazinesAsync(); ``` -------------------------------- ### Get Character Mangaography Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves the mangaography for a character by their MAL ID. ```csharp var manga = await jikan.GetCharacterMangaAsync(2219); foreach (var entry in manga.Data) Console.WriteLine(entry.Manga?.Title); ``` -------------------------------- ### Retrieve User Recommendations Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Fetches a paginated list of recommendations for a specific user. ```csharp var recs = await jikan.GetUserRecommendationsAsync("username"); ``` -------------------------------- ### Get Character Animeography Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves the animeography for a character by their MAL ID. ```csharp var anime = await jikan.GetCharacterAnimeAsync(2219); foreach (var entry in anime.Data) Console.WriteLine($"{entry.Anime?.Title} - {entry.Role}"); ``` -------------------------------- ### Configure Jikan with HttpClientFactory Source: https://github.com/ervie/jikan.net/blob/master/docs/GettingStarted.md Register Jikan using HttpClientFactory to customize HTTP client settings like timeout and base address. ```csharp services.AddHttpClient(client => { client.Timeout = TimeSpan.FromSeconds(10); client.BaseAddress = new Uri("https://api.jikan.moe/v4"); }); ``` -------------------------------- ### Get Manga News Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves news articles for a manga by its ID. ```csharp var news = await jikan.GetMangaNewsAsync(2); foreach (var n in news.Data) Console.WriteLine(n.Title); ``` -------------------------------- ### Search Manga (Simple and Advanced) Source: https://context7.com/ervie/jikan.net/llms.txt Shows how to search for manga using a basic query and a more complex search configuration. Allows filtering by type, status, and ordering. ```csharp var jikan = new Jikan(); // Simple search var response = await jikan.SearchMangaAsync("berserk"); foreach (var manga in response.Data) { Console.WriteLine($"{manga.Title} - Score: {manga.Score}"); } // Advanced search var searchConfig = new MangaSearchConfig { Query = "one piece", Type = MangaType.Manga, Status = PublishingStatus.Publishing, OrderBy = MangaSearchOrderBy.Score, SortDirection = SortDirection.Descending }; var filtered = await jikan.SearchMangaAsync(searchConfig); ``` -------------------------------- ### GET Character Appearances Source: https://context7.com/ervie/jikan.net/llms.txt Retrieves the anime or manga appearances for a character. ```APIDOC ## GET GetCharacterAnimeAsync / GetCharacterMangaAsync ### Description Returns the anime or manga appearances (animeography/mangaography) for a character. ### Parameters #### Path Parameters - **id** (int) - Required - The MyAnimeList ID of the character. ``` -------------------------------- ### GET Manga Characters Source: https://context7.com/ervie/jikan.net/llms.txt Retrieves characters appearing in a manga with their roles. ```APIDOC ## GET GetMangaCharactersAsync ### Description Returns characters appearing in a manga with their roles. ### Parameters #### Path Parameters - **id** (int) - Required - The MyAnimeList ID of the manga. ``` -------------------------------- ### Configure Jikan API Rate Limiting Source: https://context7.com/ervie/jikan.net/llms.txt Set up rate limiting configurations for the Jikan client to adhere to API quotas. Supports default, custom, and disabled rate limiting. ```csharp // Default rate limiting (recommended) var config = new JikanClientConfiguration { LimiterConfigurations = TaskLimiterConfiguration.Default }; var jikan = new Jikan(config); // Custom rate limiting var customConfig = new JikanClientConfiguration { LimiterConfigurations = new List { new(1, TimeSpan.FromMilliseconds(500)), // 1 request per 500ms new(100, TimeSpan.FromMinutes(1)) // Max 100 per minute } }; var jikan = new Jikan(customConfig); // Disable rate limiting (not recommended for production) var noLimitConfig = new JikanClientConfiguration { LimiterConfigurations = TaskLimiterConfiguration.None }; var jikan = new Jikan(noLimitConfig); // Default rules: // - Space every request by at least 300ms // - Rate limit for bursts: 3 requests per second // - Baseline limit: 4 requests per 4 seconds (60/min) ``` -------------------------------- ### Get Producer Async by ID Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves a specific producer by their MyAnimeList ID. ```csharp var producer = await jikan.GetProducerAsync(1); ``` -------------------------------- ### Retrieve Recent Recommendations Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Fetches recently added recommendations for anime or manga. ```csharp var recs = await jikan.GetRecentAnimeRecommendationsAsync(); ``` ```csharp var recs = await jikan.GetRecentMangaRecommendationsAsync(); ``` -------------------------------- ### Get Club Async Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves the profile information for a specific club using its MAL ID. The returned data includes the club's name and other details. ```csharp var club = await jikan.GetClubAsync(1); Console.WriteLine(club.Data.Name); ``` -------------------------------- ### GET /manga/{id}/statistics Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves statistical data for a specific manga. ```APIDOC ## GET /manga/{id}/statistics ### Description Returns statistics for a specific manga. ### Parameters #### Path Parameters - **id** (long) - Required - MAL id of manga ### Response #### Success Response (200) - **BaseJikanResponse** - Returns the statistics model for the manga. ``` -------------------------------- ### Get Full Anime Data with Relations and Links Source: https://context7.com/ervie/jikan.net/llms.txt Retrieve comprehensive anime data, including relations, themes (openings/endings), streaming, and external links, in a single request. ```csharp var jikan = new Jikan(); var response = await jikan.GetAnimeFullDataAsync(1); var anime = response.Data; // Full data includes everything from basic plus: Console.WriteLine($"Title: {anime.Title}"); // Relations (sequels, prequels, etc.) foreach (var relation in anime.Relations) { Console.WriteLine($"Relation: {relation.Relation}"); foreach (var entry in relation.Entry) Console.WriteLine($" - {entry.Name}"); } // Themes (openings and endings) foreach (var opening in anime.Theme.Openings) Console.WriteLine($"OP: {opening}"); foreach (var ending in anime.Theme.Endings) Console.WriteLine($"ED: {ending}"); // External links foreach (var link in anime.External) Console.WriteLine($"External: {link.Name} - {link.Url}"); ``` -------------------------------- ### Get Manga User Updates Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves recent user updates for a manga. ```csharp var updates = await jikan.GetMangaUserUpdatesAsync(2); ``` -------------------------------- ### Rate Limiting Configuration Source: https://context7.com/ervie/jikan.net/llms.txt Configure rate limiting to comply with Jikan API quotas. ```APIDOC ## Rate Limiting Configuration ### Description Configure rate limiting to comply with Jikan API quotas (2 requests/second, 30 requests/minute). ### Default Rate Limiting Uses recommended default configurations. ### Request Example ```csharp var config = new JikanClientConfiguration { LimiterConfigurations = TaskLimiterConfiguration.Default }; var jikan = new Jikan(config); ``` ### Custom Rate Limiting Allows setting custom request limits and intervals. ### Request Example ```csharp var customConfig = new JikanClientConfiguration { LimiterConfigurations = new List { new(1, TimeSpan.FromMilliseconds(500)), // 1 request per 500ms new(100, TimeSpan.FromMinutes(1)) // Max 100 per minute } }; var jikan = new Jikan(customConfig); ``` ### Disabling Rate Limiting Rate limiting can be disabled, but this is not recommended for production environments. ### Request Example ```csharp var noLimitConfig = new JikanClientConfiguration { LimiterConfigurations = TaskLimiterConfiguration.None }; var jikan = new Jikan(noLimitConfig); ``` ### Default Rules Summary - Space every request by at least 300ms. - Rate limit for bursts: 3 requests per second. - Baseline limit: 4 requests per 4 seconds (60/min). ``` -------------------------------- ### Get User Reviews Async Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves reviews written by a specific user, identified by their username. Pagination is supported for accessing reviews across multiple pages. ```csharp var reviews = await jikan.GetUserReviewsAsync("username"); ``` -------------------------------- ### Get Manga Characters Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves characters associated with a specific manga ID. ```csharp var characters = await jikan.GetMangaCharactersAsync(2); foreach (var c in characters.Data) Console.WriteLine($"{c.Character.Name} - {c.Role}"); ``` -------------------------------- ### Register Jikan for Dependency Injection Source: https://context7.com/ervie/jikan.net/llms.txt Register the Jikan client for dependency injection using Microsoft.Extensions.DependencyInjection, HttpClientFactory, Autofac, or Ninject. ```csharp // Microsoft.Extensions.DependencyInjection var services = new ServiceCollection() .AddSingleton() .BuildServiceProvider(); // With HttpClientFactory for custom timeout/settings services.AddHttpClient(client => { client.Timeout = TimeSpan.FromSeconds(10); client.BaseAddress = new Uri("https://api.jikan.moe/v4"); }); // Autofac public class JikanModule : Module { public override void Load(ContainerBuilder builder) { builder.RegisterType().As(); } } // Ninject public class JikanModule : NinjectModule { public override void Load() { Bind().To(); } } ``` -------------------------------- ### Get Anime News Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves news articles related to a specific anime. ```csharp var news = await jikan.GetAnimeNewsAsync(1); foreach (var n in news.Data) Console.WriteLine(n.Title); ``` -------------------------------- ### Get Anime Characters Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves a collection of characters associated with a specific anime. ```csharp var characters = await jikan.GetAnimeCharactersAsync(1); foreach (var c in characters.Data) Console.WriteLine($"{c.Character.Name} - {c.Role}"); ``` -------------------------------- ### GET Character Details Source: https://context7.com/ervie/jikan.net/llms.txt Retrieves detailed information about a character by their MyAnimeList ID. ```APIDOC ## GET GetCharacterAsync ### Description Returns detailed information about a character by their MyAnimeList ID. ### Parameters #### Path Parameters - **id** (int) - Required - The MyAnimeList ID of the character. ``` -------------------------------- ### Retrieve Recent Reviews Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Fetches recently added reviews for anime or manga. ```csharp var reviews = await jikan.GetRecentAnimeReviewsAsync(); ``` ```csharp var reviews = await jikan.GetRecentMangaReviewsAsync(); ``` -------------------------------- ### GET Manga Details Source: https://context7.com/ervie/jikan.net/llms.txt Retrieves detailed information about a manga by its MyAnimeList ID. ```APIDOC ## GET GetMangaAsync ### Description Returns detailed information about a manga by its MyAnimeList ID. ### Parameters #### Path Parameters - **id** (int) - Required - The MyAnimeList ID of the manga. ``` -------------------------------- ### Register Jikan with Microsoft.Extensions.DependencyInjection Source: https://github.com/ervie/jikan.net/blob/master/docs/GettingStarted.md Register the Jikan service using the standard .NET dependency injection container. ```csharp var services = new ServiceCollection() .AddSingleton() .BuildServiceProvider(); ``` -------------------------------- ### Get Manga Characters with C# Source: https://context7.com/ervie/jikan.net/llms.txt Retrieves characters appearing in a specific manga. ```csharp var jikan = new Jikan(); var response = await jikan.GetMangaCharactersAsync(2); foreach (var character in response.Data) { Console.WriteLine($"{character.Character.Name} - {character.Role}"); Console.WriteLine($" MAL URL: {character.Character.Url}"); } ``` -------------------------------- ### GetAnimeRecommendationsAsync Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves recommendations for a specific anime. ```APIDOC ## GetAnimeRecommendationsAsync ### Description Returns anime recommendations. ### Parameters #### Path Parameters - **id** (long) - Required - MAL id of anime ### Response - **Returns** (BaseJikanResponse>) - A collection of recommendation objects. ``` -------------------------------- ### Configure Custom Jikan API Endpoint Source: https://github.com/ervie/jikan.net/blob/master/docs/GettingStarted.md Point the Jikan client to a self-hosted instance by updating the endpoint configuration. ```csharp var config = new JikanClientConfiguration { Endpoint = "https://your-jikan-instance.example.com/v4" }; var jikan = new Jikan(config); ``` -------------------------------- ### Retrieve Popular Episodes Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Fetches popular episodes. ```csharp var episodes = await jikan.GetWatchPopularEpisodesAsync(); ``` -------------------------------- ### GET /character/{id} Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves detailed information about a specific character by their MAL ID. ```APIDOC ## GET /character/{id} ### Description Returns character with given MAL id. ### Parameters #### Path Parameters - **id** (long) - Required - MAL id of character ### Response #### Success Response (200) - **BaseJikanResponse** - Returns the character details. ``` -------------------------------- ### GET /manga/{id}/news Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves news articles related to a specific manga. ```APIDOC ## GET /manga/{id}/news ### Description Returns news for a specific manga. ### Parameters #### Path Parameters - **id** (long) - Required - MAL id of manga #### Query Parameters - **page** (int) - Optional - Page index ### Response #### Success Response (200) - **PaginatedJikanResponse>** - Returns a paginated list of news articles. ``` -------------------------------- ### GET /manga/{id}/characters Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves the list of characters appearing in a specific manga. ```APIDOC ## GET /manga/{id}/characters ### Description Returns characters appearing in manga. ### Parameters #### Path Parameters - **id** (long) - Required - MAL id of manga ### Response #### Success Response (200) - **BaseJikanResponse>** - Returns a collection of manga characters. ``` -------------------------------- ### Retrieve Full User Data Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Fetches comprehensive data for a specific user profile. ```csharp var full = await jikan.GetUserFullDataAsync("username"); ``` -------------------------------- ### Get Anime Relations Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Fetches related anime entries. Requires the MAL ID. ```csharp var relations = await jikan.GetAnimeRelationsAsync(1); foreach (var r in relations.Data) Console.WriteLine($"{r.Relation}: {r.Entry?.FirstOrDefault()?.Name}"); ``` -------------------------------- ### GET Anime Staff Source: https://context7.com/ervie/jikan.net/llms.txt Retrieves the staff members who worked on an anime with their positions and roles. ```APIDOC ## GET GetAnimeStaffAsync ### Description Returns the staff members who worked on an anime with their positions and roles. ### Parameters #### Path Parameters - **id** (int) - Required - The MyAnimeList ID of the anime. ``` -------------------------------- ### Get User Updates Async Source: https://github.com/ervie/jikan.net/blob/master/docs/API.md Retrieves a user's recent updates on their anime and manga progress. This is useful for tracking what a user is currently watching or reading. ```csharp var updates = await jikan.GetUserUpdatesAsync("username"); ```