Comments
Stay organized with collections
Save and categorize content based on your preferences.
Page Summary
A comment resource in the YouTube API represents a single comment, which can be about a video or channel, and can be a top-level comment or a reply.
The API provides methods to list, insert (for replies), update, delete, and set the moderation status of comments, with top-level comment creation done via commentThreads.insert.
The comment resource's JSON structure includes properties like id, snippet, kind and etag, while the snippet object details the comment's text, author, ratings, and moderation status.
The textDisplay property provides the comment's text, potentially modified, while textOriginal offers the original text if the viewer is the author.
Certain properties such as moderationStatus are only returned if the API request is authorized by the channel or video owner, and the markAsSpam method is no longer supported.
A comment resource contains information about a single YouTube comment. A comment resource can represent a comment about either a video or a channel. In addition, the comment could be a top-level comment or a reply to a top-level comment.
Methods
The API supports the following methods for comments resources:
Sets the moderation status of one or more comments. The API request must be authorized by the owner of the channel or video associated with the comments.
Try it now.
Resource representation
The following JSON structure shows the format of a comments resource:
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#comment.
etag
etag
The Etag of this resource.
id
string
The ID that YouTube uses to uniquely identify the comment.
snippet
object
The snippet object contains basic details about the comment.
snippet.authorDisplayName
string
The display name of the user who posted the comment.
snippet.authorProfileImageUrl
string
The URL for the avatar of the user who posted the comment.
snippet.authorChannelUrl
string
The URL of the comment author's YouTube channel, if available.
snippet.authorChannelId
object
This object encapsulates information about the comment author's YouTube channel, if available.
snippet.authorChannelId.value
string
The ID of the comment author's YouTube channel, if available.
snippet.channelId
string
The ID of the YouTube channel associated with the comment.
snippet.textDisplay
string
The comment's text. The text can be retrieved in either plain text or HTML. (The comments.list and commentThreads.list methods both support a textFormat parameter, which specifies the chosen text format.)
Even the plain text may differ from the original comment text. For example, it may replace video links with video titles.
snippet.textOriginal
string
The original, raw text of the comment as it was initially posted or last updated. The original text is only returned to the authenticated user if they are the comment's author.
snippet.parentId
string
The unique ID of the parent comment. This property is only set if the comment was submitted as a reply to another comment.
snippet.canRate
boolean
This setting indicates whether the current viewer can rate the comment.
snippet.viewerRating
string
The rating the viewer has given to this comment. This property doesn't identify dislike ratings, though this behavior is subject to change. In the meantime, the property value is like if the viewer has rated the comment positively. The value is none in all other cases, including the user having given the comment a negative rating or not having rated the comment.
Valid values for this property are:
like
none
snippet.likeCount
unsigned integer
The total number of likes (positive ratings) the comment has received.
snippet.moderationStatus
string
The comment's moderation status. This property is only returned if the API request was authorized by the owner of the channel or the video on which the requested comments were made. Also, this property isn't set if the API request used the id filter parameter.
Valid values for this property are:
heldForReview
likelySpam
published
rejected
snippet.publishedAt
datetime
The date and time when the comment was orignally published. The value is specified in ISO 8601 format.
snippet.updatedAt
datetime
The date and time when the comment was last updated. The value is specified in ISO 8601 format.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-06 UTC."],[],["The `comment` resource represents a YouTube comment, which can be about a video or channel and may be a top-level comment or a reply. Key actions include listing comments, creating replies (or top-level comments via `commentThreads`), updating or deleting comments, and setting their moderation status. Additionally, you can use the API to obtain the comments' properties like author, text, rating, moderation status and publication information. The 'markAsSpam' method is deprecated.\n"]]