REST Resource: playlistItems

Resource: PlaylistItem

A playlistItem resource identifies another resource, such as a video, that is included in a playlist. In addition, the playlistItem resource contains details about the included resource that pertain specifically to how that resource is used in that playlist.

YouTube also uses a playlist to identify a channel's list of uploaded videos, with each playlistItem in that list representing one uploaded video. You can retrieve the playlist ID for that list from the channel resource for a given channel, and then call the playlistItems.list method to retrieve the list.

JSON representation
{
  "kind": string,
  "etag": string,
  "id": string,
  "snippet": {
    "publishedAt": string,
    "channelId": string,
    "title": string,
    "description": string,
    "thumbnails": {
      object (ThumbnailDetails)
    },
    "channelTitle": string,
    "playlistId": string,
    "position": integer,
    "resourceId": {
      "kind": string,
      "videoId": string,
      "channelId": string,
      "playlistId": string
    },
    "videoOwnerChannelTitle": string,
    "videoOwnerChannelId": string
  },
  "contentDetails": {
    "startAt": string,
    "endAt": string,
    "videoId": string,
    "note": string,
    "videoPublishedAt": string
  },
  "status": {
    "privacyStatus": enum
  }
}
Fields
kind

string

Output only. Identifies what kind of resource this is. Value: the fixed string "youtube#playlistItem".

etag

string

Etag of this resource.

id

string

The ID that YouTube uses to uniquely identify the playlist item.

snippet

object

The snippet object contains basic details about the playlist item, such as its title and position in the playlist.

snippet.publishedAt

string

Output only. The date and time that the item was added to the playlist. If that timestamp isn't available, the value falls back to the video's publish time or creation time. The value is specified in ISO 8601 format.

snippet.channelId

string

Output only. The ID that YouTube uses to uniquely identify the channel that owns the playlist item.

snippet.title

string

Output only. The item's title. For private videos that aren't accessible to the caller, this value is "Private video"; for deleted videos, it is "Deleted video".

snippet.description

string

Output only. The item's description. For private videos that aren't accessible to the caller, this value is "This video is private."; for deleted videos, it is "This video is unavailable.".

snippet.thumbnails

object (ThumbnailDetails)

Output only. A map of thumbnail images associated with the playlist item. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail.

snippet.channelTitle

string

Output only. The channel title of the channel that the playlist item belongs to.

snippet.playlistId

string

The ID that YouTube uses to uniquely identify the playlist that the playlist item is in.

snippet.position

integer (uint32 format)

The order in which the item appears in the playlist. The value uses a zero-based index, so the first item has a position of 0, the second item has a position of 1, and so forth.

snippet.resourceId

object

The resourceId object contains information that can be used to uniquely identify the resource that is included in the playlist as the playlist item. For playlist items, kind must be youtube#video and videoId identifies the video.

snippet.resourceId.kind

string

The type of the API resource.

snippet.resourceId.videoId

string

The ID that YouTube uses to uniquely identify the referred resource, if that resource is a video. This property is only present if the resourceId.kind value is youtube#video.

snippet.resourceId.channelId

string

The ID that YouTube uses to uniquely identify the referred resource, if that resource is a channel. This property is only present if the resourceId.kind value is youtube#channel.

snippet.resourceId.playlistId

string

The ID that YouTube uses to uniquely identify the referred resource, if that resource is a playlist. This property is only present if the resourceId.kind value is youtube#playlist.

snippet.videoOwnerChannelTitle

string

Output only. The channel title of the channel that uploaded this video. Omitted for private or deleted videos that aren't accessible to the caller.

snippet.videoOwnerChannelId

string

Output only. The channel ID of the channel that uploaded this video. Omitted for private or deleted videos that aren't accessible to the caller.

contentDetails

object

The contentDetails object is included in the resource if the included item is a YouTube video. The object contains additional information about the video.

contentDetails.startAt
(deprecated)

string

Deprecated: This property is ignored if set.

contentDetails.endAt
(deprecated)

string

Deprecated: This property is ignored if set.

contentDetails.videoId

string

Output only. The ID that YouTube uses to uniquely identify a video. To retrieve the video resource, set the id query parameter to this value in your API request.

contentDetails.note

string

A user-generated note for this item. The property value has a maximum length of 280 characters. Set this property using playlistItems.update.

contentDetails.videoPublishedAt

string

Output only. The date and time that the video was published to YouTube. For unpublished private or unlisted videos, the value falls back to the video's creation time. Omitted for private or deleted videos that aren't accessible to the caller. The value is specified in ISO 8601 format.

status

object

The status object contains information about the playlist item's privacy status.

status.privacyStatus

enum

Output only. The playlist item's privacy status. The channel that uploaded the video that the playlist item represents can set this value using either the videos.insert or videos.update method.

Valid values of this enum field are:

  • public
  • unlisted
  • private

Methods

delete

Deletes a playlist item.

insert

Adds a resource to a playlist.

list

Returns a collection of playlist items that match the API request parameters.

update

Modifies a playlist item.