The Discover Method: Movies

Other than find and search methods, TMDB also has a discover method to find or search for all the objects (movies, TV shows, and persons). This lesson will focus on how TMDB’s discover method works for the movies.

The discover endpoint

Sometimes it’s useful to search for movies and TV shows based on filters or definable values like ratings, certifications, or release dates. TMDB’s discover method makes this easy. It has two versions, one for movies and other for TV shows.

Discover movies

We can discover movies with respect to different types of data like genres, rating, number of votes, and certificationsCertifications decide whether a movie can be publicly presented or not. If not, then make some deletions and modifications to allow it for public viewing. For example, a “Rated G: General audiences” certification represents a movie for all ages.. TMDB also has a method to get a valid list of certifications.

The discover method also supports sorting of results. For example, we can get our results in ascending or descending order using the asc keyword or desc keyword. Moreover, we can also use gte for greater than or equal to and lte for less than or equal to. We’ll discuss a few in detail below.

Note: A number of filters we use with discover endpoint support being comma (,) or pipe (|) separated. The commas are treated as an AND query while pipes are considered as an OR.

Get hands-on with 1200+ tech skills courses.