Overview
ThesearchAnime() function searches MyAnimeList’s anime database using a query string. Returns paginated results with metadata.
Function Signature
Parameters
Search query string. Can include:
- Anime titles (English or Japanese)
- Partial matches (e.g., “attack” matches “Attack on Titan”)
- Special characters (automatically URL-encoded)
"Naruto", "進撃の巨人", "demon slayer"Page number for pagination. Must be a positive integer.
- Minimum: 1
- Default: 1
- Use
pagination.last_visible_pageto determine max page
Number of results per page.
- Minimum: 1
- Maximum: 25 (API limitation)
- Default: 20
Return Value
Returns a Promise that resolves to aJikanSearchResponse object.
Array of anime objects matching the search query. Each object contains full anime details.See JikanAnime interface for complete structure.
Pagination metadata for navigating results
Examples
Basic Search
Advanced Usage
Filtering Results
React Hook Usage
For React components, use theuseAnimeSearch hook:
Performance Considerations
Caching
Searches are automatically cached for 5 minutes:Rate Limiting
The function handles rate limiting automatically:- Maximum 3 requests per second
- Requests are queued when limit reached
- Automatic retry with exponential backoff on 429 errors
Optimization Tips
Common Use Cases
Autocomplete Search
Search with Filters
Error Handling
Possible errors:Network error or non-200 status code
Failed after 3 retry attempts
API Endpoint
This function calls the Jikan API endpoint:See Also
getTopAnime()
Get highest-rated anime without search query
getSeasonalAnime()
Browse anime by season and year
JikanAnime Interface
Complete type definition for anime objects
Database Queries
Store and retrieve anime entries from database