Method: playlists.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 retrieve one or more playlists by their unique IDs.

Unauthenticated requests (using an API key) can retrieve public playlists using channelId, or public and unlisted playlists using id. Retrieving private playlists, listing unlisted playlists using channelId, using mine=true, or specifying onBehalfOfContentOwner requires OAuth 2.0 authorization.

For method-specific error responses, see playlists.list errors. For code examples, see playlists.list code snippets.

HTTP request

GET https://youtube.googleapis.com/youtube/v3/playlists

The URL uses gRPC Transcoding syntax.

Query parameters

Parameters
id[]

string

Specifies a comma-separated list of up to 50 YouTube playlist IDs for the resources to retrieve. Specify exactly one filter parameter (channelId, id, or mine). Unreadable or unsupported playlist IDs are omitted from the response.

mine

boolean

Set this parameter's value to true to return only playlists owned by the authenticated user. Requires OAuth 2.0 authorization, and setting false returns an error. Specify exactly one filter parameter (channelId, id, or mine).

channelId

string

Specifies a YouTube channel ID to return that channel's playlists. Specify exactly one filter parameter (channelId, id, or mine). Unauthenticated requests return public playlists; authenticated requests by the channel owner or an authorized content owner also return private and unlisted playlists.

hl

string

Instructs the API to retrieve localized resource metadata for a specific application language that YouTube supports. The value must be a language code returned by i18nLanguages.list.

When localized details are available in that language, snippet.localized contains the localized values; otherwise, snippet.localized contains details in the playlist's default language.

maxResults

integer (uint32 format)

Specifies the maximum number of items returned in the result set. Acceptable values are 0 to 50, inclusive. The default value is 5. Setting 0 returns an empty result set. When filtering by id, non-zero values are still validated and populate pagination metadata (pageInfo.resultsPerPage and page tokens), but do not limit the returned items.

pageToken

string

Identifies a specific page in the result set to return. In an API response, nextPageToken and prevPageToken identify other pages that can be retrieved. When filtering by id, pageToken is still validated and used to populate pagination metadata, but does not paginate the returned items.

part[]

string

Required. Specifies a comma-separated list of one or more playlist resource properties that the API response includes.

If the parameter identifies a property that contains child properties, the child properties are included in the response. For example, in a playlist resource, snippet contains properties such as title, description, channelId, and publishedAt, so setting part=snippet returns all of those properties.

Valid values are contentDetails, id, localizations, player, snippet, and status.

onBehalfOfContentOwner

string

Intended exclusively for YouTube content partners and valid only in an authorized request. Indicates that the request's authorization credentials identify a YouTube CMS user acting on behalf of the specified content owner, allowing partners that manage multiple channels to authenticate once and access data for linked channels.

When combining this parameter with mine=true, you must also specify onBehalfOfContentOwnerChannel.

onBehalfOfContentOwnerChannel

string

Intended exclusively for YouTube content partners and valid only in an authorized request. Specifies the YouTube channel ID of the managed channel whose playlists are being retrieved.

This parameter can only be used together with onBehalfOfContentOwner, and is required when using onBehalfOfContentOwner with mine=true. Both the authenticating CMS account and the specified channel must be linked to the content owner identified by onBehalfOfContentOwner.

Request body

The request body must be empty.

Response body

If successful, the response body contains data with the following structure:

JSON representation
{
  "kind": string,
  "etag": string,
  "nextPageToken": string,
  "prevPageToken": string,
  "pageInfo": {
    "totalResults": integer,
    "resultsPerPage": integer
  },
  "items": [
    {
      object (Playlist)
    }
  ]
}
Fields
kind

string

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

etag

string

Etag of this resource.

nextPageToken

string

The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set.

prevPageToken

string

The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set.

pageInfo

object

Encapsulates paging information for the result set.

pageInfo.totalResults

integer

The total number of results in the result set.

pageInfo.resultsPerPage

integer

The number of results included in the API response.

items[]

object (Playlist)

A list of playlists that match the request criteria.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/youtube
  • https://www.googleapis.com/auth/youtubepartner
  • https://www.googleapis.com/auth/youtube.readonly
  • https://www.googleapis.com/auth/youtube.force-ssl

For more information, see the OAuth 2.0 Overview.