Top Client
Usage
Client used to access the Top Endpoints:
See also: JikanAPI Documentation
getTopAnime /top/anime
Get the current top Animes.
Params
- [Optional] searchParams: AnimeTopParams
Response
Example
ts
import { TopClient, AnimeTopParams, AnimeType, JikanResponse, Anime } from '@tutkli/jikan-ts';
(async () => {
const topClient = new TopClient();
const searchParams: AnimeTopParams = {
type: AnimeType.tv
}
await topClient
.getTopAnime(searchParams)
.then((jikanResponse: JikanResponse<Anime[]>) => { /* your code */ })
.catch((error) => console.error(error));
})();
getTopManga /top/manga
Get the current top Mangas.
Params
- [Optional] searchParams: MangaTopParams
Response
Example
ts
import { TopClient, MangaTopParams, MangaType, JikanResponse, Manga } from '@tutkli/jikan-ts';
(async () => {
const topClient = new TopClient();
const searchParams: MangaTopParams = {
type: MangaType.manwha
}
await topClient
.getTopManga(searchParams)
.then((jikanResponse: JikanResponse<Manga[]>) => { /* your code */ })
.catch((error) => console.error(error));
})();