【问题标题】:Is there a way to get more than 50 results from maxResults with the Youtube API?有没有办法使用 Youtube API 从 maxResults 获得超过 50 个结果?
【发布时间】:2020-07-30 02:02:17
【问题描述】:

我正在尝试使用 Subscriptions: 列表获取我的订阅者列表。有没有办法为我的所有订阅者获取价值,还是只能获得 50 最大值?还有其他方法可以为我的所有订阅者获取价值吗?我知道文档说您最多只能获得 50 个结果,但我想看看是否有另一种方法来获取所有值。谢谢!

【问题讨论】:

    标签: youtube-api youtube-data-api


    【解决方案1】:

    通过 1 次调用可以获得的最大结果是 50。 要获得更多结果,您需要进行多次调用。在第一次调用完成并且可以获得更多结果后,API 调用应该为nextPageToken 属性返回一个字符串。将其用于下一次 API 调用的可选 pageToken 参数。重复此过程,直到获得所有结果。

    【讨论】:

      【解决方案2】:

      是的!看看docs中列出的pageToken参数:

      相关描述为:

      The pageToken parameter identifies a specific page in the result set that should be 
      returned. In an API response, the nextPageToken and prevPageToken properties identify 
      other pages that could be retrieved.
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2018-07-10
        • 2021-11-05
        • 2020-12-05
        • 1970-01-01
        • 2014-01-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多