REST Resource: playlists

Resource: Playlist

A playlist resource represents a YouTube playlist. A playlist is a collection of videos that can be viewed sequentially and shared with other users. Playlists can be public, private, or unlisted; playlists created with the API default to private.

YouTube also uses playlists to identify special collections of videos for a channel, such as uploaded videos and positively rated (liked) videos. These lists are associated with a channel, and you can retrieve their playlist IDs from the channel resource.

You can call playlistItems.list to retrieve any of those lists, and playlistItems.insert or playlistItems.delete to add or remove items from supported lists.

JSON representation
{
  "kind": string,
  "etag": string,
  "id": string,
  "snippet": {
    "publishedAt": string,
    "channelId": string,
    "title": string,
    "description": string,
    "thumbnails": {
      object (ThumbnailDetails)
    },
    "channelTitle": string,
    "tags": [
      string
    ],
    "defaultLanguage": string,
    "localized": {
      "title": string,
      "description": string
    }
  },
  "status": {
    "privacyStatus": enum,
    "podcastStatus": enum
  },
  "contentDetails": {
    "itemCount": integer
  },
  "player": {
    "embedHtml": string
  },
  "localizations": {
    string: {
      "title": string,
      "description": string
    },
    ...
  }
}
Fields
kind

string

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

etag

string

Etag of this resource.

id

string

The ID that YouTube uses to uniquely identify the playlist.

snippet

object

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

snippet.publishedAt

string

Output only. The date and time that the playlist was created. The value is specified in ISO 8601 format.

snippet.channelId

string

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

snippet.title

string

The playlist's title. The title must be 1 to 150 characters long and can't contain HTML tags.

snippet.description

string

The playlist's description. The description can be up to 5,000 characters long and can't contain HTML tags.

snippet.thumbnails

object (ThumbnailDetails)

Output only. A map of thumbnail images associated with the playlist. 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 belongs to.

snippet.tags[]
(deprecated)

string

Deprecated: Keyword tags associated with the playlist. YouTube no longer supports playlist keyword tags.

snippet.defaultLanguage

string

The language of the text in the playlist resource's snippet.title and snippet.description properties, specified as a BCP-47 language code. Required whenever localizations is included in the part parameter on playlists.insert and playlists.update requests.

snippet.localized

object

Output only. Contains either a localized title and description for the playlist or the title and description in the playlist's default language.

Localized text is returned when a playlists.list request specifies the hl parameter and localized text is available in that language. Otherwise, metadata for the default language is returned.

Use the localizations object to add, update, or delete localized metadata.

snippet.localized.title

string

The localized playlist title.

snippet.localized.description

string

The localized playlist description.

status

object

The status object contains status information for the playlist.

status.privacyStatus

enum

The playlist's privacy status. Defaults to private when omitted in a playlists.insert request.

Valid values of this enum field are:

  • public
  • unlisted
  • private
status.podcastStatus

enum

The playlist's podcast status. When set to enabled, the playlist is marked as a podcast show.

This property is writable only in playlists.update requests. Before setting podcastStatus to enabled, the playlist must have a square playlist image (aspect ratio within 5% of 1:1), or the API returns 400 failedPrecondition.

Valid values of this enum field are:

  • enabled
  • disabled
contentDetails

object

Output only. The contentDetails object contains information about the playlist content, including the number of videos in the playlist.

contentDetails.itemCount

integer (uint32 format)

Output only. The number of videos in the playlist.

player

object

Output only. The player object contains information that you use to play the playlist in an embedded player.

player.embedHtml

string

Output only. An <iframe> tag that embeds a player that plays the playlist.

localizations[]

map (key: string, value: object)

The localizations object encapsulates translations of the playlist's metadata. Each map key is a BCP-47 language code identifying the language of the localized title and description. Read responses include this object only when the playlist has a defaultLanguage or translations set.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

localizations[].title

string

The localized playlist title.

localizations[].description

string

The localized playlist description.

Methods

delete

Deletes a playlist.

insert

Creates a playlist.

list

Returns a collection of playlists that match the API request parameters.

update

Modifies a playlist.