这是最适合Youtube API开发人员的问题。
执行2个查询以获取视频ID和标题(第一个查询)
https://www.googleapis.com/youtube/v3/search?safeSearch=moderate&order=relevance&part=snippet&q=".urlencode($q). "&maxResults=10&key=". $api;
第二个查询以获取contentDetails来查看视频是否已获得许可
https://www.googleapis.com/youtube/v3/videos?part=contentDetails&maxResults=10&id=".$vid."&key=". $api;
我期望Google仪表板显示2个查询,而不是显示4个查询。
我想知道Google如何计算此搜索的线索。有人检查过此行为吗?
最佳答案
我想澄清一些有关您的问题。如果您的API请求返回多页结果,这将添加到查询中,如here所述。
Note: If your application calls a method, such as
search.list
, that returns multiple pages of results, each request to retrieve an additional page of results will incur the estimated quota cost.
这是由于每页再次请求 token 以获取其他结果。您也可以查看Youtube Quota Calculator文档以获取更多详细信息。
如果不是这种情况,则可能是一个错误。您可以尝试记录问题here。
关于json - Youtube数据Api乘以2您的查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53106216/