Seasons Client
Usage
Client used to access the Seasons Endpoints:
See also: JikanAPI Documentation
getSeason /seasons/{year}/{season}
Get the seasonal anime by year and season.
Params
- [Required] year: number
- [Required] season: AnimeSeason
- [Optional] searchParams: JikanSearchParams
Response
Example
ts
import { SeasonsClient, AnimeSeason, JikanResponse, Anime } from '@tutkli/jikan-ts';
(async () => {
const seasonsClient = new SeasonsClient();
await seasonsClient
.getSeason(2023, AnimeSeason.winter)
.then((jikanResponse: JikanResponse<Anime[]>) => { /* your code */ })
.catch((error) => console.error(error));
})();
getSeasonNow /seasons/now
Get current seasonal anime.
Params
- [Optional] searchParams: SeasonNowParams
Response
Example
ts
import { SeasonsClient, JikanResponse, Anime } from '@tutkli/jikan-ts';
(async () => {
const seasonsClient = new SeasonsClient();
const searchParams = { limit: 10 };
await seasonsClient
.getSeasonNow(searchParams)
.then((jikanResponse: JikanResponse<Anime[]>) => { /* your code */ })
.catch((error) => console.error(error));
})();
getSeasonsList /seasons
Get available list of seasons.
Response
Example
ts
import { SeasonsClient, JikanResponse, SeasonsListData } from '@tutkli/jikan-ts';
(async () => {
const seasonsClient = new SeasonsClient();
await seasonsClient
.getSeasonsList(searchParams)
.then((jikanResponse: JikanResponse<SeasonsListData[]>) => { /* your code */ })
.catch((error) => console.error(error));
})();
getUpcoming /seasons/upcoming
Get upcoming season's anime.
Params
- [Optional] searchParams: JikanSeasonsParams
Response
Example
ts
import { SeasonsClient, AnimeType, JikanResponse, Anime } from '@tutkli/jikan-ts';
(async () => {
const seasonsClient = new SeasonsClient();
const searchParams = { filter: AnimeType.tv };
await seasonsClient
.getSeasonUpcoming(searchParams)
.then((jikanResponse: JikanResponse<Anime[]>) => { /* your code */ })
.catch((error) => console.error(error));
})();