Popular Animes

The Popular Animes endpoint provides a curated list of the most popular animes in our database. This endpoint returns a collection of animes sorted by their popularity, allowing you to showcase trending and widely-appreciated series. It's an excellent feature for highlighting top animes on your application's homepage or in a dedicated popular animes section.

Endpoint Information

Endpoint URL

{baseUrl}/animes/popular
GET

Query Parameters

Use the following query parameters to customize your request for popular animes. These parameters allow you to control the pagination of results, ensuring you get the most relevant data for your needs:

  • page: Specify the page number for paginated results. Default is 1.
  • limit: Set the number of popular animes to return per page. Default is 10.

The animes are automatically sorted by popularity in descending order, so you'll always get the most popular animes first.

Example Responses

200 OK - Successful Response

This response indicates that the request was successful and the animes were retrieved.

{
  "statusCode": 200,
  "status": "success",
  "message": "Animes fetched successfully",
  "results": {
    "animes": [],
    "totalPages": 0,
    "currentPage": 0
  }
}

404 Not Found - No Animes Found

This response is returned when no animes match the search criteria in the database.

{
  "statusCode": 404,
  "status": "error",
  "message": "No animes found",
  "results": null
}

500 Internal Server Error - Server Failure

This response indicates that there was an internal server error that prevented the request from being fulfilled.

{
  "statusCode": 500,
  "status": "error",
  "message": "Internal server error",
  "results": null
}

API Demonstration

Try out the Popular Animes API with this interactive demonstration. Adjust the parameters below and click the button to make an API call.

API Call Example

import axios from 'axios';

const fetchMovies = async () => {
  try {
    const response = await axios.get('{baseUrl}/api/v1/animes/popular?page=1&limit=10&api_token=undefined');
    console.log(response.data);
  } catch (error) {
    console.error('Error fetching movies:', error);
  }
};

fetchMovies();

Please sign in and obtain an API token to use this demonstration.