Youtube API v3获得评论 [英] Youtube API v3 get comments

查看:182
本文介绍了Youtube API v3获得评论的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用评论:列表方法

请求

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

我使用API​​ get comments返回这个

I use API get comments return this

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


推荐答案

评论 - >列表方法仅用于当您需要获取关于评论的更多信息时,您已经知道评论ID ......或者你的网址,如果你想获得更多关于评论的细节,这些评论是对parentID的回复。换句话说,您不能将videoID放入评论 - >列表方法中。

The comments->list method is only used when you need to get additional info about comments where you already know the comment ID ... or in the case of your URL, if you are trying to get more details about comments that are replies to a parentID. In other words, you can't put a videoID into the comments->list method.

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

What you want is the commentThreads->list endpoint:

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

这会给你所有的评论以及他们的ID ......然后,你可以获取这些ID,然后通过评论 - >列表端点运行它们以获得更多的细化信息。

That'll give you all the comments with their IDs ... you can take those IDs, then, and run them through the comments->list endpoint to get more granular info.

这篇关于Youtube API v3获得评论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆