Youtube API v3 get comments

2019-02-25 16:51发布

I am using Comments: list method

Request

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

I use API get comments return this

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

1条回答
该账号已被封号
2楼-- · 2019-02-25 17:43

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.

What you want is the commentThreads->list endpoint:

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

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.

查看更多
登录 后发表回答