Updated on September 14, 2023

Retrieve a movie

GET

The Monolito Movies API allows you to retrieve detailed information about a specific movie using its unique identifier (ID). This document provides you with the details on how to make a GET request to retrieve movie data.

Endpoint

To retrieve a movie, make a GET request to the following endpoint:

GET /movies/{movie_id}

Replace {movie_id} with the unique identifier of the movie you want to retrieve.

Request

Here's an example of how to make a GET request to retrieve movie information using JavaScript:

const movieId = 12345; // Replace with the actual movie ID
const apiUrl = `https://api.monolitomovies.com/v1/movies/${movieId}`;

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

In this example, we use the fetch function to make an HTTP GET request to the specified API endpoint. Replace 12345 with the actual movie ID you want to retrieve.

Response

The API will respond with detailed information about the movie in JSON format. Here's an example response:

{
  "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
}

Response Explanation

  • 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.

Now that you know how to retrieve movie information, you can explore the Monolito Movies API further by making requests for specific movies or implementing more advanced queries.