Resource: Comment
A comment resource contains information about a single YouTube comment on a video or a post. The comment can be a top-level comment or a reply to a top-level comment.
Comments on posts are in a pilot phase with access limited to select launch partners (approved Google Cloud projects). Broader public API access is planned for General Availability in 2027.
| JSON representation |
|---|
{
"kind": string,
"etag": string,
"id": string,
"snippet": {
"channelId": string,
"videoId": string,
"postId": string,
"textDisplay": string,
"textOriginal": string,
"parentId": string,
"authorDisplayName": string,
"authorProfileImageUrl": string,
"authorChannelUrl": string,
"authorChannelId": {
"value": string
},
"canRate": boolean,
"viewerRating": enum,
"likeCount": integer,
"moderationStatus": enum ( |
| Fields | |
|---|---|
kind |
Identifies what kind of resource this is. Value: the fixed string |
etag |
Etag of this resource. |
id |
The ID that YouTube uses to uniquely identify the comment. |
snippet |
The |
snippet.channelId |
The ID of the YouTube channel associated with the comment (the channel that owns the video or post the comment refers to). |
snippet.videoId |
The ID of the video the comment refers to, if any. The API returns this field only for comments in a |
snippet.postId |
The ID of the post that the comment refers to, if any. The API returns this field only for comments in a |
snippet.textDisplay |
The comment's text, formatted as either HTML or plain text depending on the |
snippet.textOriginal |
The original, raw text of the comment as initially posted or last updated. |
snippet.parentId |
The unique ID of the parent top-level comment. This property is only set if the comment was submitted as a reply to another comment. |
snippet.authorDisplayName |
The display name of the user who posted the comment. |
snippet.authorProfileImageUrl |
The URL for the avatar of the user who posted the comment. |
snippet.authorChannelUrl |
The URL of the comment author's YouTube channel, if available. |
snippet.authorChannelId |
Encapsulates information about the comment author's YouTube channel, if available. |
snippet.authorChannelId.value |
The ID of the comment author's YouTube channel, if available. |
snippet.canRate |
Indicates whether the viewer can rate the comment. |
snippet.viewerRating |
The rating the viewer has given to this comment. Valid values of this enum field are:
|
snippet.likeCount |
The total number of likes (positive ratings) the comment has received. |
snippet.moderationStatus |
The comment's moderation status. This property is populated whenever a returned comment is held for review ( |
snippet.publishedAt |
The date and time when the comment was originally published. The value is specified in ISO 8601 format. |
snippet.updatedAt |
The date and time when the comment was last updated. The value is specified in ISO 8601 format. |
snippet.imageUrl |
Output only. The URL of the image or animated GIF attached to the comment, if any. This property is only present when a comment contains an image or GIF. The URL is served as a signed link with a six-hour time to live (TTL) and expires six hours after retrieval. |
Methods |
|
|---|---|
|
Deletes a comment. |
|
Creates a reply to an existing comment. |
|
Returns a list of comments that match the API request parameters. |
|
Sets the moderation status of one or more comments. |
|
Modifies a comment. |