The Movie Database 支持

As I have seen that the discover response returns total_pages in the API response like 3032, 2045, 891. But What's the point of showing it, If I can't go to that range. In simple words, User can't access or go to pages more than 500 otherwise it will return

{"success":false,"status_code":22,"status_message":"Invalid page: Pages start at 1 and max at 500. They are expected to be an integer."}

And There is no solution to get or access the pages more than 500. so You're stuck with only 500 pages.

5 回复(第 1 页,共 1 页)

Jump to last post

@jhhomjhhom said:

As I have seen that the discover response returns total_pages in the API response like 3032, 2045, 891. But What's the point of showing it, If I can't go to that range. In simple words, User can't access or go to pages more than 500 otherwise it will return

{"success":false,"status_code":22,"status_message":"Invalid page: Pages start at 1 and max at 500. They are expected to be an integer."}

And There is no solution to get or access the pages more than 500. so You're stuck with only 500 pages.

It is still often very useful to have the total_results, regardless if you can't retrieve all of the pages. You can always break up your query into smaller groups in order to get whatever data you're looking for (by release date as an example) so that queries stay below 10,000 results.

@travisbell said:

You can always break up your query into smaller groups in order to get whatever data you're looking for (by release date as an example) so that queries stay below 10,000 results.

What do you mean into smaller groups?

If I am using discover endpoint and there are 3000 total_pages available and after 500 pages, I don't know what's after it then How can I even know about the next result's(pages. 743, 554, 2952) release dates, genres, ids?

Let's assume you have this query (with_genres=28):

https://api.themoviedb.org/3/discover/movie?api_key=###&with_genres=28

There are 373379 results. But you can easily split it up by release date (by year in this example):

https://api.themoviedb.org/3/discover/movie?api_key=###&with_genres=28&primary_release_date.gte=2000-01-01&primary_release_date.lte=2000-12-31
https://api.themoviedb.org/3/discover/movie?api_key=###&with_genres=28&primary_release_date.gte=2001-01-01&primary_release_date.lte=2001-12-31
https://api.themoviedb.org/3/discover/movie?api_key=###&with_genres=28&primary_release_date.gte=2002-01-01&primary_release_date.lte=2002-12-31
https://api.themoviedb.org/3/discover/movie?api_key=###&with_genres=28&primary_release_date.gte=2003-01-01&primary_release_date.lte=2003-12-31

All of these queries should yield less than 10,000 items so you can page through each of these as a way to get all of the results. Using dates is a simple way to accomplish this, but depending on your query, there could be alternative approaches.

@travisbell Now I understand, this is good solution too. But this can take too long to query about 1000 to 2000 results. API endpoint's speed is very nice and it doesn't take long to query any kind of result but querying this large number of calls might lower the speed.

找不到电影或节目?登录并创建它吧。

全站通用

s 聚焦到搜索栏
p 打开个人资料菜单
esc 关闭打开的窗口
? 打开键盘快捷键窗口

在媒体页面

b 返回(或返回上级)
e 进入编辑页面

在电视季页面

(右箭头)下一季
(左箭头)前一季

在电视集页面

(右箭头)下一集
(左箭头)上一集

在所有图像页面

a 打开添加图片窗口

在所有编辑页面

t 打开翻译选择器
ctrl+ s 提交

在讨论页面

n 创建新讨论
w 切换关注状态
p 设为公开 / 私密讨论
c 关闭 / 开放讨论
a 打开活动页
r 回复讨论
l 跳转至最新回复
ctrl+ enter 发送信息
(右箭头)下一页
(左箭头)前一页

设置

想给这个条目评分或将其添加到片单中?

登录

还不是会员?

注册加入社区