Posts

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 string
Identifies the API resource's type. The value is youtube#post.
etag etag
The Etag of this resource.
id string
The ID that YouTube uses to uniquely identify the post.
snippet object
The snippet object contains basic details about the post, such as its channel and text.
snippet.channelId string
The ID of the channel that published the post.

This property is required when you insert a post.
snippet.textDisplay string
The 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.publishTime datetime
The date and time that the post was published. The value is specified in ISO 8601 format.
statistics object
The statistics object contains statistics about the post. The API returns this object only in posts.list responses.
statistics.likeCount long
The number of likes that the post has received.
statistics.commentCount long
The number of comments on the post.
attachments object
The attachments object contains the images attached to the post.
attachments.imageAttachments[] list
A 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.imageAttachments[].uploadToken string
The 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.imageAttachments[].imagePreview object
Information 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.imageAttachments[].imagePreview.url string
The URL of the image.
attachments.imageAttachments[].imagePreview.width integer
The width of the image, in pixels.
attachments.imageAttachments[].imagePreview.height integer
The height of the image, in pixels.
status object
The status object contains information about the post's processing, publishing, and archiving state.
status.processingStatus string
The post's processing status.

Valid values for this property are:
  • complete – The post is fully processed.
  • processing – YouTube is preparing the post for publication.
status.publishingStatus string
The post's publication status.

Valid values for this property are:
  • published – The post is published.
  • scheduled – The post is scheduled to be published and is visible only to its owner.
status.archiveState string
The post's archiving state.

Valid values for this property are:
  • archived – The post is archived and is visible only to its owner.
  • evergreen – The post isn't archived or scheduled to be archived.
  • scheduledToArchive – The post is scheduled to be archived.