Search code examples
jsonapithemoviedb-api

TMDB API Search function gives only one page of data


Hello

I'm using TMDB Api and I got an error in my code saying that I have only 20 results out of 29. The reason is that the search function in TMDB did not return the second page of data. Here is the api search phrase (without my personal key):

https://api.themoviedb.org/3/search/movie?query=Avengers&api_key=API_KEY

And here is the data received: http://pastebin.com/MdpFz2Nx

As you can see there is only page 1 and at the bottom of the code it says there are 2 pages in total.

Is there some other way to receive the rest of the data or is it a mistake made by the API ?


Solution

  • You're looking for the page parameter.

    https://api.themoviedb.org/3/search/movie?query=Avengers&api_key=API_KEY&page=2
    

    Cheers.