【发布时间】:2016-09-23 22:01:13
【问题描述】:
我正在尝试使用 API 从 youtube 获取“所有”游戏直播。
我第一次使用的方式是通过带有参数的“Search.list”:https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.search.list?part=snippet&eventType=live&maxResults=50&type=video&videoCategoryId=20。但是以这种方式,当我尝试使用 PageToken 迭代结果时,我只能得到大约 100 个结果,而在 API 响应中我可以看到“totalResults”大约是 2000。然后我进入这个 topic 并意识到“Search.list "实际上是一种“排名”算法,而不是“从数据库中获取所有数据”,这意味着“totalResults”只是估计的结果数。
然后我开始使用“liveBroadcasts.list”,但它没有返回任何结果:https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.liveBroadcasts.list?part=id&broadcastStatus=active&maxResults=50&_h=8&
而对于其他 API,它们需要 channelId 或其他 id。
有没有什么方法可以获取所有游戏直播而不考虑任何 ID?
【问题讨论】:
标签: youtube-api youtube-data-api