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

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

问题描述

我正在使用 评论:列表方法

请求

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

我使用 API 获取评论返回此

I use API get comments return this

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

推荐答案

comments->list 方法仅在您需要获取有关您已经知道评论 ID 的评论的附加信息时使用...您的 URL,如果您试图获取有关回复 parentID 的评论的更多详细信息.换句话说,您不能将 videoID 放入 comments->list 方法中.

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,然后通过 comments->list 端点运行它们以获得更详细的信息.

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天全站免登陆