Skip to main content

Overview

EpiNeko integrates with the Jikan API v4 to fetch anime data from MyAnimeList. The Jikan service provides a clean, typed interface with built-in caching and rate limit handling.
All Jikan API functions are located in src/services/jikan.ts:1 and include automatic caching and error handling.

Core Functions

getTopAnime

Fetches the top-rated anime from MyAnimeList with pagination support.
number
default:1
The page number for pagination
Cache Duration: 1 hour (3600 seconds)

searchAnime

Search for anime by query string with pagination support.
string
required
The search query string (automatically URL-encoded)
number
default:1
The page number for pagination
Cache Duration: 1 hour (3600 seconds)

getAnimeById

Fetch detailed information about a specific anime by its MyAnimeList ID.
number
required
The MyAnimeList ID of the anime
Cache Duration: 24 hours (86400 seconds)

getAnimeCharacters

Fetch the characters for a specific anime.
number
required
The MyAnimeList ID of the anime
Cache Duration: 24 hours (86400 seconds)

getAnimeEpisodes

Fetch episode information for a specific anime with pagination.
number
required
The MyAnimeList ID of the anime
number
default:1
The page number for pagination
Cache Duration: 24 hours (86400 seconds)

TypeScript Interfaces

JikanAnime

JikanImage

JikanEpisode

JikanResponse<T>

Rate Limiting & Error Handling

The Jikan API has rate limits. The service automatically handles rate limit errors:
When you receive a 429 error, the Jikan API is temporarily unavailable. The application should display a user-friendly message and retry the request after a delay.

Caching Strategy

All Jikan API calls use Next.js ISR (Incremental Static Regeneration) for caching:
You can adjust cache durations by modifying the revalidate parameter in each function call.

Best Practices

API Base URL

All requests are made to the Jikan API v4 endpoint. No API key is required.

Jikan API Documentation

Official Jikan API v4 documentation

MyAnimeList

Source data for all anime information