TMDB API Search function gives only one page of da

2019-02-26 04:38发布

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 ?

2条回答
放我归山
2楼-- · 2019-02-26 05:10

Read in TMDB's forum on this link:

https://www.themoviedb.org/talk/5892db39c3a3686d10001a4d?language=en

You need to make another request to get next 20 results on next page

TMDB doesn't provide full search result without pagination in one API request (https://www.themoviedb.org/talk/55aa2a76c3a3682d63002fb1?language=en)

查看更多
Bombasti
3楼-- · 2019-02-26 05:15

You're looking for the page parameter.

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

Cheers.

查看更多
登录 后发表回答