Updated on Sep 14, 2023

2

min read

Featured movies

GET

Discover the most popular movies of the week with the Movies API's "Featured Movies" query. This query allows you to retrieve a list of the top-rated movies that are currently trending.

Endpoint

To retrieve the featured movies (top movies of the week), make a GET request to the following endpoint:

GET /movies/featured

Request

Here's an example of how to make a GET request to retrieve the featured movies using JavaScript:

const apiUrl = "https://api.moviesapi.com/v1/movies/featured";

fetch(apiUrl)
  .then(response => response.json())
  .then(data => {
    console.log("Featured Movies:", data);
  })
  .catch(error => {
    console.error("Error:", error);
  });

In this example, we use the fetch function to make an HTTP GET request to the /movies/featured endpoint, which will return a list of top-rated movies of the week.

Response

The API will respond with a list of featured movies in JSON format. Each movie object includes details such as the movie's title, release date, genre, director, actors, plot, and rating.

Here's an example response with a list of featured movies:

[
  {
    "id": 12345,
    "title": "The Shawshank Redemption",
    "release_date": "1994-09-23",
    "genre": ["Drama", "Crime"],
    "director": "Frank Darabont",
    "actors": ["Tim Robbins", "Morgan Freeman"],
    "plot": "Two imprisoned men bond over a number of years...",
    "rating": 9.3
  },
  {
    "id": 67890,
    "title": "Inception",
    "release_date": "2010-07-16",
    "genre": ["Action", "Adventure", "Sci-Fi"],
    "director": "Christopher Nolan",
    "actors": ["Leonardo DiCaprio", "Joseph Gordon-Levitt"],
    "plot": "A thief who enters the dreams of others to steal...",
    "rating": 8.8
  }
]

Response Explanation

Each movie object in the response includes the following properties:

  • id: The unique identifier of the movie.

  • title: The title of the movie.

  • release_date: The release date of the movie.

  • genre: An array of genres associated with the movie.

  • director: The director of the movie.

  • actors: An array of actors in the movie.

  • plot: A brief description of the movie's plot.

  • rating: The average user rating for the movie.

Explore the featured movies and discover the latest trending titles with the Movies API's "Featured Movies" query.