Hit TV Shows

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

This lesson focuses on a few methods that will allow us to get some hit shows on TMDB.

Popular TV shows

The popularity of any TV show is calculated based on factors like user votes, the number of user visits to the show’s homepage, how many times the video of any episode was played, and so on. The popular TV shows endpoint helps us get a list of the currently popular TV shows on TMDB. This list updates daily on the platform. The endpoint doesn’t take any path parameters.

The base URL in focus is as follows:

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

The input query parameters required by this endpoint are as follows:

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 the range of 1–1000 inclusive. The default value is 1.

The objects in the output JSON response are as follows:

Object

Type

Category

Description

page

integer

optional

This is the page being queried.

results

array[object]

optional

This returns all the popular TV shows (with their details) on the specified page, such as 21 shows on page 1, then 20 shows on page 2, and so on.

total_pages

integer

optional

This is the total number of pages having popular TV shows on TMDB.

total_results

integer

optional

This is the total number of popular TV shows on TMDB.

Let’s run ...