问题描述
我正在为使用 YouTube Data API V3 执行 HTTP GET 提供一些咨询;为了开发基于 Windows 的应用程序以从 Youtube 获取结果列表,例如特定的类别或特定的标签.
I am in the process of providing some consultancy on doing a HTTP GET using YouTube Data API V3; in order to develop a Windows based application to GET a list of results from Youtube, for say a specific CATEGORY, or a specific TAG.
我们愿意使用任何编程语言(我来自 C++ 背景,希望 Youtube 支持直接 HTTP 连接而不使用 Google 客户端 SDK 等)来连接到 YouTube 和 (HTTP) GET 数据.(大约一个月一次,所以 YouTube API 配额应该没有问题).
We are open to using any programming language(I'm from a C++ background and am hoping You tube will support direct HTTP connections without using Google client SDK and so on) to connect to YouTube and (HTTP) GET data.(Once a month or so, so YouTube API quotas should not be problem).
我客户的一些网络开发人员告诉我们,YouTube API v3 最多只能返回 500 条记录/结果,例如一个查询只返回总观看者、视频链接和基本元数据,例如
We are being told by some of my client's web developers that YouTube API v3 will only return a maximum of 500 records/results, for say a query that returns JUST the Total viewers, the Video's link, and basic meta data such as that.
S,假设我希望为家庭音乐"或篮球"类别找到 5,000 个结果 - 我已经设置了开发人员密钥等,这可能吗?
S, say I wish to find 5,000 results for category "House music" or "basketball" - and I have the Developer Key etc are all set up, would that be possible?
如果是这样,我需要填充哪些 GET 字段(例如max_results_per_page")?
If so, what GET fields would I need to populate(such as "max_results_per_page")?
谢谢.
推荐答案
API 不会为任意查询提供超过 ~500 个搜索结果.这是设计使然.从技术上讲,这意味着 nextPageToken
字段在您达到约 500 个结果后将不会返回.没有其他参数可以改变这一点.
The API won't provide more than ~500 search results for any arbitrary query. It's by design. Technically, it means that the nextPageToken
field won't be returned once you hit ~500 results. No additional parameter can change that.
如果您想要查询超过 500 个结果,您必须将其拆分为更具体的子查询.我建议使用 publishedAfter
和 publishedBefore
参数来实现这一点,但可以随意尝试其他参数 此处.
If you want more than ~500 results for a query, you have to split it into more specific sub-queries. I'd suggest using the publishedAfter
and publishedBefore
parameters to achieve that, but feel free to experiment with the other ones here.
这篇关于YouTube 数据 API v3 调用返回的最大结果是多少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!