The Movie Database Support

For now, I can get only 20 movies. How can I get more movies?

7 replies (on page 1 of 1)

Jump to last post

Use the page parameter. Each page has 20 movies (besides the last, usually) and by appending &page=2 (or whatever page number) to your api call, you can get the second page. There is also a total_pages parameter you can use to find the total number of pages.

Examples:

  • Page 1https://api.themoviedb.org/3/trending/movie/day?api_key=YOUR_API_KEY&page=1
  • Page 2 https://api.themoviedb.org/3/trending/movie/day?api_key=YOUR_API_KEY&page=2
  • Page 3 https://api.themoviedb.org/3/trending/movie/day?api_key=YOUR_API_KEY&page=3
  • Page 4 https://api.themoviedb.org/3/trending/movie/day?api_key=YOUR_API_KEY&page=4

You should get a response like this:

{
  "page": 1, //or whatever page you queried
  "results": [] //movies are in this array
  "total_pages": 1000,
  "total_results": 20000
}

Hope this helps.

It works perfectly, Thanks so much!!!!!!

Sure thing. Glad to help

Sorry, one question more How can I guess how many pages are there for horror movies?

If you are searching for a specific genre, then you can use the discover feature, and add the with_genres parameter. You would need to make a call to the /genres/movies/list endpoint to get a list of genres, and their respective IDs. Once you find the ids of the genre you are looking for, then you can add them to the with_genres parameter. For instance, I believe that the Action genre's id is 28, so for action movies, you would pass with_genres=28as parameter to the discover endpoint. If you want to add more genres to search, then you can, just seperate each with a comma like so: with_genres=28, 56, 345 (these aren't real genre IDs - you will have to find them from the genre list. To get the list of genres

https://api.themoviedb.org/3/genre/movie/list?api_key=YOUR_API_KEY&language=en-US

To use the discover endpoint, see the docs:

https://developers.themoviedb.org/3/discover/movie-discover

Once you make that request, you can view the total_pages parameter in the response to find the total number of pages with your specific filters.

Thanks so much.

Sure

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

On media pages

b go back (or to parent when applicable)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Settings

Want to rate or add this item to a list?

Login