hi, am requesting to discover action category https://api.themoviedb.org/3/discover/movie?api_key=###&sort_by=popularity.desc&with_genres=28 and i get only 1 page details , i can specify a page but i want to get all the movies available in the pages! how to do that? i have seen apps with all of a genres movies so it must be possible!
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 21, 2020 at 7:34 PM
Hi @Yaseen55,
You need to use the
page
parameter.Etc...
Reply by Yaseen55
on January 22, 2020 at 7:11 AM
Hi @travisbell i know that as i said i can specify the page but like that if there is 500 pages out there i have to send 500 requests!!
Reply by Benoît Courtine
on January 22, 2020 at 10:04 AM
Hi @Yaseen55.
You are right: the only way to get all results is to process each result page (and to use 500 requests in your example). You cannot specify in the request the number of results by page.
Best regards.
Reply by talestalker
on January 22, 2020 at 11:53 AM
That's normal. Typically, you need to query all pages only if you are trying to make some local mirror of TMDB dataset and in this case you can wait a while for all pages to download. You can use more download threads if you need to speed things up.
Reply by Yaseen55
on January 22, 2020 at 12:10 PM
@talestalker thanks, could you give me a hint how to query all pages? I'm kinda new at this things
Reply by Yaseen55
on January 22, 2020 at 12:13 PM
@bcourtine that's not fun!
Reply by talestalker
on January 22, 2020 at 2:19 PM
You must make 500 separate queries. But it really isn't that bad, as it takes just ~70 seconds to download all 500 pages with one thread and ~4 seconds using 32 threads.
Reply by lidov14962@syinxun.com
on May 6, 2023 at 6:10 AM
Reply by buddha_0
on June 21, 2023 at 2:31 AM
HEY HOW DO I KNOW THE TOTAL NUMBER OF PAGES AVALIAVLE?
Reply by talestalker
on June 21, 2023 at 6:51 AM
You are getting the total number of pages in every response to
discover
method:You can query only first 500 pages, though.