如何从YouTube API v3获取评论

时间:2017-01-14 13:24:44

标签: c# youtube youtube-api youtube-data-api

var commentThreadsRequest = youTubeService.CommentThreads.List("replies,snippet");
commentThreadsRequest.VideoId = "bla-bla"; // here real id
commentThreadsRequest.MaxResults = 100; // 1 - 100;
var response = commentThreadsRequest.Execute();

通过这种方式我得到100条评论。 怎么得到所有评论?

可以指定resultsPerPage?

2 个答案:

答案 0 :(得分:2)

使用Comments.list时,

100是maxResults。现在,如果您的YouTube注释超过100,那么您将需要" nextPageToken"访问接下来的100个结果等等。只要有更多结果要检索,就会有nextPageToken。

有一个video tutorial here可以为你演示一些。 This SO thread也可能提供额外的洞察力。

答案 1 :(得分:-1)

YouTube API仅允许视频获得0-100个结果。

请参阅reference guide.

相关问题