Hello,
I noticed something about the discover movie endpoint. Unlike what is written on its documentation page, if I specify a page parameter greather than 500 I get the 22 error code "Invalid page: Pages start at 1 and max at 500. They are expected to be an integer.". Then, is it an error on the documentation page ? If it's normal, why is it like this while much more results can exist (in function of the request of course) ?
Best regards
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 superboy97
on januar 5, 2025 at 9:25 AM
Only the 500 first pages of results from a query can be returned, even if there are more results available.
Reply by LucasUlmer
on januar 5, 2025 at 9:43 AM
Okay, so there is a mistake in the docs. But then what about these results, it's possible that they can never be reached ? Can you explain why this technical choice was made ?
Reply by superboy97
on januar 5, 2025 at 9:44 AM
I can't explain the choice as I wasn't a designer of the API.
Reply by LucasUlmer
on januar 5, 2025 at 9:52 AM
Okay no problem. Can you do some internal research on this ? I would really like to know, and I'm sure I'm not the only one
: maybe it could be clarified in the docs.
Reply by ticao2 š§š· pt-BR
on januar 6, 2025 at 10:49 AM
It depends on the API Request you are making.
If it is Discover you can use all available filters and sort by &sort_by=primary_release_date.des and use the date parameters &primary_release_date.gte and &primary_release_date.lte.
Make a first Request and see what date came in the response.
And make a second Request limiting the initial date.
And so on until you get all the items.
I think the initial reason, about 15 years ago, was to save processing resources.
Besides, the greatest asset of a Database is its data.
It is not interesting to allow someone to get ALL the data and build their own data site.
But that is just my guess.
Reply by ticao2 š§š· pt-BR
on januar 6, 2025 at 11:21 AM
Maybe it would be better if it was written there that the limit is 500.
Where it says "page int32 Defaults to 1" add "Maximum 500".
I believe I already answered in my previous comment.
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.
Here's what Travis Bell, the Administrator, said on 2022-06-28:
https://www.themoviedb.org/talk/62bb2ea18b959e00526428c9#62bb37d2c613ce0094222e71
I believe that only if you make several API Requests.
For example, for decades.
If I'm not mistaken the movie count must be over 650,000.
EDIT: over 706,322 (2022-06-28)
EDIT2: over 1,010,724 (2025-01-06)
Increasing Answer items from 10,000 to 1,010,724 means multiplying the items by 100.
I believe it would demand a lot from the system.
Reply by LucasUlmer
on januar 7, 2025 at 2:21 PM
Thanks for the answers. About the documentation, maybe yeah "maximum 500", but there is also the info box when you click in the page field which shows PHP's minimum and maximum integer values.
Reply by ticao2 š§š· pt-BR
on januar 8, 2025 at 9:35 AM
I'm not a code programmer.
I've always understood this as a general field characteristic.
Also because a negative number of pages wouldn't make sense.
But anyway, it's something for admin Travis Bell to resolve.