Returns a collection of playlist items that match the API request parameters. You can retrieve all of the playlist items in a specified playlist or retrieve one or more playlist items by their unique IDs.
Quota impact: A call to this method has a quota cost of 1 unit.
Common use cases
Request
HTTP request
GET https://www.googleapis.com/youtube/v3/playlistItems
Parameters
The following table lists the parameters that this query supports. All of the parameters listed are query parameters.
| Parameters | ||
|---|---|---|
| Required parameters | ||
part |
stringThe part parameter specifies a comma-separated list of one or more playlistItem resource properties that the API response will include.If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlistItem resource, the snippet property contains numerous fields, including the title, description, position, and resourceId properties. As such, if you set part=snippet, the API response will contain all of those properties.The following list contains the part names that you can include in the parameter value:
|
|
| Filters (specify exactly one of the following parameters) | ||
id |
stringThe id parameter specifies a comma-separated list of one or more unique playlist item IDs. |
|
playlistId |
stringThe playlistId parameter specifies the unique ID of the playlist for which you want to retrieve playlist items. Note that even though this is an optional parameter, every request to retrieve playlist items must specify a value for either the id parameter or the playlistId parameter. |
|
| Optional parameters | ||
maxResults |
unsigned integerThe maxResults parameter specifies the maximum number of items that should be returned in the result set. Acceptable values are 0 to 50, inclusive. The default value is 5. |
|
onBehalfOfContentOwner |
stringThis parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. |
|
pageToken |
stringThe pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. |
|
videoId |
stringThe videoId parameter specifies that the request should return only the playlist items that contain the specified video. |
|
Request body
Do not provide a request body when calling this method.
Response
If successful, this method returns a response body with the following structure:
{
"kind": "youtube#playlistItemListResponse",
"etag": etag,
"nextPageToken": string,
"prevPageToken": string,
"pageInfo": {
"totalResults": integer,
"resultsPerPage": integer
},
"items": [