The
posts resource and its methods 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.A post resource represents a YouTube post. The API supports text-only posts and image posts, which contain 1 to 10 images and optional text.
Methods
The API supports the following methods for posts resources:
- list
- Returns a list of posts that match the API request parameters.
- insert
- Creates and publishes a text-only post or an image post.
- update
- Updates the text of a post.
- delete
- Deletes a post.
- imageUpload
- Uploads an image and returns a token that you use to attach the image to a new post.
Resource representation
The following JSON structure shows the format of a posts resource:
{
"kind": "youtube#post",
"etag": etag,
"id": string,
"snippet": {
"channelId": string,
"textDisplay": string,
"publishTime": datetime
},
"statistics": {
"likeCount": long,
"commentCount": long
},
"attachments": {
"imageAttachments": [
{
"uploadToken": string,
"imagePreview": {
"url": string,
"width": integer,
"height": integer
}
}
]
},
"status": {
"processingStatus": string,
"publishingStatus": string,
"archiveState": string
}
}Properties
The following table defines the properties that appear in this resource:
| Properties | |
|---|---|
kind |
stringIdentifies the API resource's type. The value is youtube#post. |
etag |
etagThe Etag of this resource. |
id |
stringThe ID that YouTube uses to uniquely identify the post. |
snippet |
objectThe snippet object contains basic details about the post, such as its channel and text. |
snippet. |
stringThe ID of the channel that published the post. This property is required when you insert a post. |
snippet. |
stringThe text of the post. This property is required when you insert a text-only post or update a post, and optional when you insert an image post. |
snippet. |
datetimeThe date and time that the post was published. The value is specified in ISO 8601 format. |
statistics |
objectThe statistics object contains statistics about the post. The API returns this object only in posts.list responses. |
statistics. |
longThe number of likes that the post has received. |
statistics. |
longThe number of comments on the post. |
attachments |
objectThe attachments object contains the images attached to the post. |
attachments. |
listA list of the images attached to the post. An image post has 1 to 10 images; a text-only post omits the attachments object. |
attachments. |
stringThe token that identifies an image that you uploaded with the posts.imageUpload method.Set this property when you insert a post. The API doesn't return this property. |
attachments. |
objectInformation about the image as YouTube serves it. The API sets this object, and you can't set it. YouTube can show an image in a preview that changes its aspect ratio, such as a square crop, depending on where the post appears. |
attachments. |
stringThe URL of the image. |
attachments. |
integerThe width of the image, in pixels. |
attachments. |
integerThe height of the image, in pixels. |
status |
objectThe status object contains information about the post's processing, publishing, and archiving state. |
status. |
stringThe post's processing status. Valid values for this property are:
|
status. |
stringThe post's publication status. Valid values for this property are:
|
status. |
stringThe post's archiving state. Valid values for this property are:
|