The Movie Database Support

Hi, I wonder if I can rely on a fixed number of results per page (except for the last page of course). I could not find any information about this in the API docs.

In this thread it is stated that the maximum number of results per page is 20 (february 2014): https://www.themoviedb.org/talk/522eeae419c2955e90252e23

In this thread it was observed that the number of results on the first page can be less than 20 (march 2014): https://www.themoviedb.org/talk/5332e205c3a3686a780044ad The related issue was marked as resolved in october 2016: https://tmdb.lighthouseapp.com/projects/83077-api/tickets/369-why-are-nil-items-being-returned-in-our-solr-queries

What I would like to do is to calculate the position of a specific movie within the result set. Let's say I fetch the fifth page of top rated movies: https://api.themoviedb.org/3/movie/top_rated?api_key=xyz&page=5 If I know for sure that every page from 1 to 4 has 20 results, then I know that the results on page 5 are positions 81 to 100. Is it safe to calculate positions this way?

If I can rely on a fixed number of results per page, where do I find that number? Will it always be 20, or is that subject to change? If so, where do I find the current configuration?

Thanks!

4 replies (on page 1 of 1)

Jump to last post

Hi Stefan,

All of our pages that contain the standard list results are locked at 20 items per page, yes. There are 3 pagination fields present on all responses:

  • page
  • total_pages
  • total_results

With that information in hand, you can know exactly what to do with every page (either continue on, or not).

Great, thank you!

Can we Change the number of results per Page

@vijayanand1212 said:

Can we Change the number of results per Page

If that's a question, the answer is no.

The number/quantity of Items per Page and the number/quantity of Pages
cannot be changed, configured, specified, restricted, or anything like that.
There will always be up to 20 items per page.
And a maximum of 500 pages.
Therefore, at most 10,000 items.

Of course, depending on the parameters used in your API Request
this number/quantity can be much smaller.
Eventually zero.

In a Trending API Request, the quantities are greater.
A maximum of 1,000 pages
Therefore a maximum of 20,000 items

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