How to get all comments on a YouTube video?

前端 未结 5 606
眼角桃花
眼角桃花 2020-12-12 16:36

Since Google has deprecated the YouTube v2 API, I cannot find a way to get all the comments from a video.

Is it possible to use a single, non-deprecated API (Google+

5条回答
  •  天命终不由人
    2020-12-12 17:14

    You can fetch all the comments using https://www.googleapis.com/youtube/v3/commentThreads

    The Youtube API v3.0 allows you the following parameters.

    1. textFormat - This parameter indicates whether the API should return comments formatted as HTML or as plain text. The default value is html.

    2. videoId - The Youtube Video ID you want to fetch comments for ( if you dont know your Youtube Video ID, you can get one from Youtube Video ID Finder )

    3. maxResults - The maxResults parameter specifies the maximum number of items that should be returned in the result set.

    4. pageToken - The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identifies the next page of the result that can be retrieved.

提交回复
热议问题