【问题标题】:Youtube API v3 get commentsYoutube API v3 获取评论
【发布时间】:2015-06-02 07:32:01
【问题描述】:

我正在使用Comments: list 方法

请求

https://www.googleapis.com/youtube/v3/comments?part=snippet&parentId=ay4MKe1u7Ec&key=`{MY_KEY}`

我使用 API 让 cmets 返回这个

{
 "kind": "youtube#commentListResponse",
 "etag": "\"xmg9xJZuZD438sF4hb-VcBBREXc/pGLBhpjR05yQoJV31WoAx2PEFVw\"",
 "items": []
}

【问题讨论】:

  • 可能是因为父 id 没有结果 ay4MKe1u7Ec
  • 那么你的问题到底是什么?
  • 查看 YouTube 上的视频,看是否有任何 cmets?也许那个视频没有 cmets。

标签: google-api youtube-api


【解决方案1】:

cmets->list 方法仅在您需要获取有关您已经知道评论 ID 的 cmets 的其他信息时使用......或者在您的 URL 的情况下,如果您试图获取有关 cmets 的更多详细信息是对 parentID 的回复。换句话说,您不能将 videoID 放入 cmets->list 方法中。

你想要的是commentThreads->list端点:

https://www.googleapis.com/youtube/v3/commentThreads?part=snippet&videoId=ay4MKe1u7Ec&key={YOUR_API_KEY}

这将为您提供所有带有 ID 的 cmets ...您可以获取这些 ID,然后通过 cmets->list 端点运行它们以获取更详细的信息。

【讨论】:

  • commentThreads->list 最多可以返回 100 个 cmets。我可以在响应中看到 nextPageToken。如何遍历检索所有的cmets?
猜你喜欢
  • 1970-01-01
  • 2017-05-29
  • 1970-01-01
  • 2016-09-07
  • 2015-08-23
  • 2018-04-14
  • 2013-09-20
  • 2017-11-29
  • 2016-09-01
相关资源
最近更新 更多