Hit Movies

Learn and practice how to get popular, top-rated, and trending movies using TMDB API.

In this lesson, we’ll explore and practice three endpoints—popular, top-rated, and trending movies.

Popular movies

It always helps to have a list of popular movies to choose from, especially when we plan to watch a movie after a long time.

We can get a list of the current popular movies on TMDB using the popular movies endpoint. To keep the list up-to-date, the content is updated daily. The endpoint doesn’t take any path parameter other than the API key.

Here is the base URL in focus:

https://api.themoviedb.org/3/movie/popular?api_key={ourTMDBapikey}

Request parameters

The following query parameters can be used with this endpoint:

Name

Type

Category

Description

language

string

optional

This is an ISO_3166_1 code used to get the translated data as per the specified language. This is applicable to only the fields that support it. The default value is en-US.

page

integer

optional

This is used to specify which page to query. Its value can be in a range 1–1000 inclusive. The default value is 1.

region

string

optional

This is to specify an ISO 3166-1 code to filter release dates and get the popular movies of just the specified region. Its value must be uppercase. For example, using FR will return all the popular movies made in France.


The widget below has the code to get a list of popular movies on TMDB. ...