how I can set the limit to my results exp:_ I want only the top 10 movies how can I do that_
Δεν μπορείτε να βρείτε κάποια ταινία ή σειρά; Συνδεθείτε για να τη δημιουργήσετε.
Θέλετε να αξιολογήσετε ή να προσθέσετε αυτό το στοιχείο σε μια λίστα;
Δεν είσαι μέλος;
Απάντηση από τον/την ticao2 🇧🇷 pt-BR
στις 15 Μάρτιος 2022 στις 08:57 ΕΊΜΑΙ
You must make this selection on your side.
It is not possible to limit the number of items in any API Request response.
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
Απάντηση από τον/την Travis Bell
στις 15 Μάρτιος 2022 στις 11:08 ΕΊΜΑΙ
As @ticao2 mentioned, the page size on TMDB is fixed. Since the returned object (
results
) is an array, it is easy enough for you to to simply limit the items you want to display client side.Απάντηση από τον/την the-physicist
στις 20 Μάρτιος 2022 στις 12:57 ΕΊΜΑΙ
Hi, I'm a beginner and I had the same question and unfortunately, I couldn't find the answer. But I thought a little more and based on Travi's answer (about being an array) I managed to do it in a very simple way, here's an example code:
I accept tips on how to improve this code snippet and hope it helps others.
Απάντηση από τον/την 3FK5
στις 22 Ιούλιος 2022 στις 12:38 ΜΜ
Thanks for this, I've been on it for quite a while now.
Απάντηση από τον/την SCKante
στις 4 Νοέμβριος 2022 στις 09:03 ΕΊΜΑΙ
Thanks for this it's work nicely
Απάντηση από τον/την seanmcnallie
στις 8 Νοέμβριος 2022 στις 10:32 ΜΜ
Thank you. This works perfectly.
Απάντηση από τον/την chinenye_101
στις 15 Σεπτέμβριος 2023 στις 10:05 ΕΊΜΑΙ
This helped me a lot, thank you so much