YouTube Data API v3 - Comment threads request doesn't return count of total results

社会主义新天地 提交于 2019-12-10 17:43:54

问题


When I perform the following YouTube Data API request to list commentThreads, pageInfo/totalResults isn't returned in the response.

I expect pageInfo/totalResults to be returned per the documentation.

GET https://www.googleapis.com/youtube/v3/commentThreads?part=snippet%2Creplies&videoId=dGidYBqBHVw&key={YOUR_API_KEY}

For example, if you use the API Explorer, and enter:

  • part: snippet,replies
  • videoId: dGidYBqBHVw

The response returns 200 OK with the rest of the data, but omits the pageInfo/totalResults value:

"pageInfo": {
  "resultsPerPage": 20
} 

回答1:


I just tried the request you posted and got

{
 "kind": "youtube#commentThreadListResponse",
 "etag": "\"sGDdEsjSJ_SnACpEvVQ6MtTzkrI/p78HIXZZWNay4CG1YPcS0NCjiOw\"",
 "nextPageToken": "Cg0QnNnZ0pTFxwIgACgBEhQIABCI5cnWjcTHAhi4kKTI3bvHAhgCIBQondOJjuX1p_e5AQ==",
 "pageInfo": {
  "totalResults": 20,
  "resultsPerPage": 20
 },...
}

Seems like it's been fixed.




回答2:


I have also tired for it. It works for me. Youtube or Google usually change their apis format or data structures. It is not a big thing.



来源:https://stackoverflow.com/questions/30488713/youtube-data-api-v3-comment-threads-request-doesnt-return-count-of-total-resu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!