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!
Can't find a movie or TV show? Login to create it.
Want to rate or add this item to a list?
Not a member?
Reply by Travis Bell
on January 16, 2017 at 10:40 AM
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:
With that information in hand, you can know exactly what to do with every page (either continue on, or not).
Reply by Stefan Kleeschulte
on January 16, 2017 at 12:25 PM
Great, thank you!
Reply by vijayanand1212
on November 19, 2021 at 4:30 AM
Can we Change the number of results per Page
Reply by ticao2 š§š· pt-BR
on November 19, 2021 at 7:19 AM
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