AI-generated Key Takeaways
-
Playlists are collections of videos on YouTube that can be public or private and are used to organize and share content sequentially.
-
Special YouTube playlists, like uploaded or liked videos, are associated with a channel, which contains all of a users videos, playlists, and other youtube information, where these special playlists can be retrieved via channel ID's.
-
The YouTube API for playlists offers methods to list, create, update, and delete playlists, enabling full management of these resources.
-
Each playlist resource contains details such as title, description, privacy status, and content information, with the ability to set localization for these fields.
-
Thumbnails for playlists are available in various resolutions and sizes, including default, medium, high, standard, and maxres.
A playlist resource represents a YouTube playlist. A playlist is a collection of videos that can be viewed sequentially and shared with other users. By default, playlists are publicly visible to other users, but playlists can be public or private.
YouTube also uses playlists to identify special collections of videos for a channel, such as:
- uploaded videos
- positively rated (liked) videos
channel resource for a given channel.You can then use the
playlistItems.list method to retrieve any of those lists. You can also add or remove items from those lists by calling the playlistItems.insert and playlistItems.delete methods.
Methods
The API supports the following methods for playlists resources:
- list
- Returns a collection of playlists that match the API request parameters. For example, you can retrieve all playlists that the authenticated user owns, or you can retrieve one or more playlists by their unique IDs. Try it now.
- insert
- Creates a playlist. Try it now.
- update
- Modifies a playlist. For example, you could change a playlist's title, description, or privacy status. Try it now.
- delete
- Deletes a playlist. Try it now.
Resource representation
The following JSON structure shows the format of a playlists resource:
{
"kind": "youtube#playlist",
"etag": etag,
"id": string,
"snippet": {
"publishedAt": datetime,
"channelId": string,
"title": string,
"description": string,
"thumbnails": {
(key): {
"url": string,
"width": unsigned integer,
"height": unsigned integer
}
},
"channelTitle": string,
"defaultLanguage": string,
"localized": {
"title": string,
"description": string
}
},
"status": {
"privacyStatus": string,
"podcastStatus": enum
},
"contentDetails": {
"itemCount": unsigned integer
},
"player": {
"embedHtml": string
},
"localizations": {
(key): {
"title": string,
"description": string
}
}
}Properties
The following table defines the properties that appear in this resource:
| Properties | |
|---|---|
kind |
stringIdentifies the API resource's type. The value will be youtube#playlist. |
etag |
etagThe Etag of this resource. |
id |
stringThe ID that YouTube uses to uniquely identify the playlist. |
snippet |
objectThe snippet object contains basic details about the playlist, such as its title and description. |
snippet.publishedAt |
datetimeThe date and time that the playlist was created. The value is specified in ISO 8601 format. |
snippet.channelId |
stringThe ID that YouTube uses to uniquely identify the channel that published the playlist. |
snippet.title |
stringThe playlist's title. |
snippet.description |
stringThe playlist's description. |
snippet.thumbnails |
objectA 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.thumbnails.(key) |
objectValid key values are:
|
snippet.thumbnails.(key).url |
stringThe image's URL. |
snippet.thumbnails.(key).width |
unsigned integerThe image's width. |
snippet.thumbnails.(key).height |
unsigned integerThe image's height. |
snippet.channelTitle |
stringThe channel title of the channel that the video belongs to. |
snippet.tags[] |
listThis property has been deprecated. Keyword tags associated with the playlist. |
snippet.defaultLanguage |
stringThe language of the text in the playlist resource's snippet.title and snippet.description properties. |
snippet.localized |
objectThe snippet.localized object contains either a localized title and description for the playlist or the title in the default language for the playlist's metadata.
localizations object to add, update, or delete localized titles. |
snippet.localized.title |
stringThe localized playlist title. |
snippet.localized.description |
stringThe localized playlist description. |
status |
objectThe status object contains status information for the playlist. |
status.privacyStatus |
stringThe playlist's privacy status. Valid values for this property are:
|
status.podcastStatus |
stringThe playlist's podcast status. If value is enabled, the playlist is marked as a podcast show. To set a playlist's podcast status to enabled, the playlist must have a playlist image.Valid values for this property are:
|
contentDetails |
objectThe contentDetails object contains information about the playlist content, including the number of videos in the playlist. |
contentDetails.itemCount |
unsigned integerThe number of videos in the playlist. |
player |
objectThe player object contains information that you would use to play the playlist in an embedded player. |
player.embedHtml |
stringAn <iframe> tag that embeds a player that will play the playlist. |
localizations |
objectThe localizations object encapsulates translations of the playlist's metadata. |
localizations.(key) |
objectThe language of the localized text associated with the key value. The value is a string that contains a BCP-47 language code. |
localizations.(key).title |
stringThe localized playlist title. |
localizations.(key).description |
stringThe localized playlist description. |