# Source: https://developers.google.com/youtube/v3/docs/commentThreads.md.txt

# CommentThreads

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](https://developers.google.com/youtube/v3/docs/comments) 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](https://developers.google.com/youtube/v3/docs/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](https://developers.google.com/youtube/v3/docs/commentThreads/list)
:   Returns a list of comment threads that match the API request parameters.
    [Try it now](https://developers.google.com/youtube/v3/docs/commentThreads/list#usage).

[insert](https://developers.google.com/youtube/v3/docs/commentThreads/insert)
:   Creates a new top-level comment. To add a reply to an existing comment, use the [comments.insert](https://developers.google.com/youtube/v3/docs/comments/insert) method instead.
    [Try it now](https://developers.google.com/youtube/v3/docs/commentThreads/insert#usage).

## Resource representation

The JSON structure shows the format of a `commentThreads` resource:  

```objective-c
{
  "https://developers.google.com/youtube/v3/docs/commentThreads#kind": "youtube#commentThread",
  "https://developers.google.com/youtube/v3/docs/commentThreads#etag": etag,
  "https://developers.google.com/youtube/v3/docs/commentThreads#id": string,
  "https://developers.google.com/youtube/v3/docs/commentThreads#snippet": {
    "https://developers.google.com/youtube/v3/docs/commentThreads#snippet.channelId": string,
    "https://developers.google.com/youtube/v3/docs/commentThreads#snippet.videoId": string,
    "https://developers.google.com/youtube/v3/docs/commentThreads#snippet.topLevelComment": comments Resource,
    "https://developers.google.com/youtube/v3/docs/commentThreads#snippet.canReply": boolean,
    "https://developers.google.com/youtube/v3/docs/commentThreads#snippet.totalReplyCount": unsigned integer,
    "https://developers.google.com/youtube/v3/docs/commentThreads#snippet.isPublic": boolean
  },
  "https://developers.google.com/youtube/v3/docs/commentThreads#replies": {
    "https://developers.google.com/youtube/v3/docs/commentThreads#replies.comments[]": [
      comments Resource
    ]
  }
}
```

### Properties

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

|                                                                                                                                                                                                                                                                                                                                                                                                                 Properties                                                                                                                                                                                                                                                                                                                                                                                                                 ||
|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `kind`                    | `string` Identifies the API resource's type. The value will be `youtube#commentThread`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `etag`                    | `etag` The Etag of this resource.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `id`                      | `string` The ID that YouTube uses to uniquely identify the comment thread.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `snippet`                 | `object` The `snippet` object contains basic details about the comment thread. It also contains the thread's top-level comment, which is a [comment](https://developers.google.com/youtube/v3/docs/comments) resource.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| snippet.`channelId`       | `string` The YouTube channel that is associated with the comments in the thread. The `snippet.videoId` property identifies the video.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| snippet.`videoId`         | `string` The ID of the video to which the comments refer.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| snippet.`topLevelComment` | `object` The thread's top-level comment. The property's value is a [comment](https://developers.google.com/youtube/v3/docs/comments#resource) resource.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| snippet.`canReply`        | `boolean` This setting indicates whether the current viewer can reply to the thread.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| snippet.`totalReplyCount` | `unsigned integer` The total number of replies that have been submitted in response to the top-level comment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| snippet.`isPublic`        | `boolean` This setting indicates whether the thread, including all of its comments and comment replies, is visible to all YouTube users.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `replies`                 | `object` The `replies` object is a container that contains a list of replies to the comment, if any exist. The `replies.comments` property represents the list of comments itself.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| replies.`comments[]`      | `list` A list of one or more replies to the top-level comment. Each item in the list is a [comment](https://developers.google.com/youtube/v3/docs/comments#resource) resource. The list contains a limited number of replies, and unless the number of items in the list equals the value of the [snippet.totalReplyCount](https://developers.google.com/youtube/v3/docs/commentThreads#snippet.totalReplyCount) property, the list of replies is only a subset of the total number of replies available for the top-level comment. To retrieve all of the replies for the top-level comment, you need to call the [comments.list](https://developers.google.com/youtube/v3/docs/comments/list) method and use the `parentId` request parameter to identify the comment for which you want to retrieve replies. |