CommentThreads

  • A commentThread resource in YouTube's API represents a comment thread, including a top-level comment and its replies, if present, on a specific video.

  • Each commentThread contains comment resources for both the top-level comment and its replies, and does not necessarily contain all replies, as they may need to be retrieved with the comments.list method.

  • The commentThreads API supports the list method to retrieve comment threads and the insert method to create a new top-level comment.

  • The snippet object within a commentThread provides essential details like the associated channel ID, video ID, the top-level comment itself, reply settings, and the total reply count.

  • The replies object within the commentThread resource contains a list of comment resources that represent the replies to the top level comment, however it is a subset of the total number of replies, not necessarily all of them.

A commentThread resource contains information about a YouTube comment thread, which comprises a top-level comment and replies, if any exist, to that comment. A commentThread resource represents comments on a video.

Both the top-level comment and the replies are actually comment resources nested inside the commentThread resource. The commentThread resource does not necessarily contain all replies to a comment, and you need to use the comments.list method if you want to retrieve all replies for a particular comment. Some comments don't have replies.

Methods

The API supports the following methods for commentThreads resources:

list
Returns a list of comment threads that match the API request parameters. Try it now.
insert
Creates a new top-level comment. To add a reply to an existing comment, use the comments.insert method instead. Try it now.

Resource representation

The JSON structure shows the format of a commentThreads resource:

{
  "kind": "youtube#commentThread",
  "etag": etag,
  "id": string,
  "snippet": {
    "channelId": string,
    "videoId": string,
    "topLevelComment": comments Resource,
    "canReply": boolean,
    "totalReplyCount": unsigned integer,
    "isPublic": boolean
  },
  "replies": {
    "comments": [
      comments Resource
    ]
  }
}

Properties

The following table defines the properties that appear in this resource: