我正在使用 Comments: list方法
要求
https://www.googleapis.com/youtube/v3/comments?part=snippet&parentId=ay4MKe1u7Ec&key=`{MY_KEY}`
我使用 API 获取评论返回这个
{
"kind": "youtube#commentListResponse",
"etag": "\"xmg9xJZuZD438sF4hb-VcBBREXc/pGLBhpjR05yQoJV31WoAx2PEFVw\"",
"items": []
}
最佳答案
comment->list 方法仅在您需要获取有关您已经知道评论 ID 的评论的附加信息时使用...一个父 ID。换句话说,您不能将 videoID 放入 comments->list 方法中。
你想要的是 commentThreads->list 端点:
https://www.googleapis.com/youtube/v3/commentThreads?part=snippet&videoId=ay4MKe1u7Ec&key={YOUR_API_KEY}
这将为您提供所有带有 ID 的评论……然后您可以获取这些 ID,并通过 comments->list 端点运行它们以获取更详细的信息。
关于google-api - Youtube API v3 获取评论,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30590003/