Skip to main content

Endpoint

GET /api/animes/getAnime

Description

Retrieve comprehensive details about a specific anime using its MyAnimeList (MAL) ID. This endpoint returns complete anime information including metadata, images, trailers, genres, studios, and more. The response is cached for 1 hour for optimal performance.

Authentication

This endpoint is publicly accessible and does not require authentication.

Rate Limiting

  • Limit: 100 requests per 60 seconds per IP
  • Headers: Rate limit information included in response headers

Query Parameters

id
number
required
The MyAnimeList ID of the anime to retrieve. Must be a positive integer.Example: id=16498
parentalControl
boolean
default:"true"
Apply parental control filtering. When enabled, restricts access to mature content based on rating.Set to false to disable filtering and allow all content.Example: parentalControl=false

Response

data
object
Anime object with complete details

Examples

Get Anime by ID

curl -X GET "https://your-domain.com/api/animes/getAnime?id=16498"

Get Anime with Parental Control Disabled

curl -X GET "https://your-domain.com/api/animes/getAnime?id=28977&parentalControl=false"

Response Example

{
  "data": {
    "mal_id": 16498,
    "title": "Shingeki no Kyojin",
    "title_english": "Attack on Titan",
    "title_japanese": "進撃の巨人",
    "title_synonyms": ["AoT"],
    "type": "TV",
    "source": "Manga",
    "episodes": 25,
    "status": "Finished Airing",
    "airing": false,
    "aired_from": "2013-04-07T00:00:00.000Z",
    "aired_to": "2013-09-29T00:00:00.000Z",
    "duration": "24 min per ep",
    "rating": "r - 17+ (violence & profanity)",
    "score": 8.55,
    "scored_by": 2500000,
    "popularity": 1,
    "members": 3500000,
    "favorites": 180000,
    "synopsis": "Centuries ago, mankind was slaughtered to near extinction by monstrous humanoid creatures called Titans, forcing humans to hide in fear behind enormous concentric walls. What makes these giants truly terrifying is that their taste for human flesh is not born out of hunger but what appears to be out of pleasure...",
    "background": "Shingeki no Kyojin adapts content from the first 8 volumes of Hajime Isayama's award-winning manga of the same name. The last episode received a pre-airing in Tokyo on September 28, 2013.",
    "season": "Spring",
    "year": 2013,
    "broadcast_day": "Sunday",
    "broadcast_time": "01:58",
    "broadcast_timezone": "Asia/Tokyo",
    "url": "https://myanimelist.net/anime/16498/Shingeki_no_Kyojin",
    "image_url": "https://cdn.myanimelist.net/images/anime/10/47347.jpg",
    "image_small_jpg": "https://cdn.myanimelist.net/images/anime/10/47347t.jpg",
    "image_large_jpg": "https://cdn.myanimelist.net/images/anime/10/47347l.jpg",
    "image_webp": "https://cdn.myanimelist.net/images/anime/10/47347.webp",
    "image_small_webp": "https://cdn.myanimelist.net/images/anime/10/47347t.webp",
    "image_large_webp": "https://cdn.myanimelist.net/images/anime/10/47347l.webp",
    "banner_image": "https://example.com/banners/shingeki-no-kyojin.jpg",
    "youtube_id": "MGRm4IzK1SQ",
    "trailer_url": "https://www.youtube.com/watch?v=MGRm4IzK1SQ",
    "trailer_embed_url": "https://www.youtube.com/embed/MGRm4IzK1SQ",
    "trailer_image_url": "https://i.ytimg.com/vi/MGRm4IzK1SQ/maxresdefault.jpg",
    "approved": true,
    "genres": ["Action", "Drama", "Fantasy", "Mystery"],
    "studios": ["Wit Studio"],
    "producers": ["Production I.G", "Dentsu", "Mainichi Broadcasting System", "Pony Canyon"],
    "licensors": ["Funimation"],
    "themes": ["Military", "Survival"]
  }
}

Error Responses

Missing ID Parameter (400)

{
  "error": {
    "message": "ID is required",
    "type": "validation",
    "statusCode": 400
  }
}

Invalid ID Format (400)

{
  "error": {
    "message": "Invalid anime ID",
    "type": "validation",
    "statusCode": 400,
    "details": {
      "providedId": "abc"
    }
  }
}

Anime Not Found (404)

{
  "error": {
    "message": "Anime not found",
    "type": "notFound",
    "statusCode": 404
  }
}

Parental Control Restriction (403)

{
  "error": {
    "message": "Anime is restricted due to parental control settings",
    "type": "permission",
    "statusCode": 403
  }
}

Rate Limit Exceeded (429)

{
  "error": {
    "message": "Too many requests. Please try again later.",
    "type": "rate_limit",
    "statusCode": 429
  }
}

Internal Server Error (500)

{
  "error": {
    "message": "Failed to fetch anime details",
    "type": "database",
    "statusCode": 500
  }
}

Features

Redis Caching

This endpoint implements Redis-based caching with a 1-hour TTL (Time To Live). Cached responses are keyed by the query parameters, so different combinations of id and parentalControl are cached separately.

Parental Control

When parentalControl=true (default), the endpoint:
  • Blocks anime with ratings: rx - hentai (18+)
  • Returns a 403 Forbidden error for restricted content
  • Logs parental control blocks for monitoring

Input Validation

The endpoint validates:
  • ID presence: Ensures the id parameter is provided
  • ID format: Verifies the ID is a positive integer
  • ID value: Checks that the ID is greater than 0
Performance: This endpoint uses aggressive caching. Repeated requests with the same parameters will be served from cache, significantly reducing database load and response time.
When parental control is enabled (default), attempting to access mature content will return a 403 error instead of the anime data. Disable parental control explicitly if you need access to all content.

Use Cases

  • Anime Detail Pages: Display comprehensive information about a specific anime
  • Recommendation Systems: Fetch full details for recommended animes
  • User Collections: Show detailed info for animes in user lists
  • Search Results: Enrich search results with complete anime data
  • Mobile Apps: Provide full anime information in mobile applications

Build docs developers (and LLMs) love