getPlaylistItems: getPlaylistItems

Description Usage Arguments Details Author(s) Examples

View source: R/get_playlist_items.R

Description

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

Usage

1
2
3
getPlaylistItems(token, part = "snippet", n = 50, id, playlist.id,
  max.results = 50, on.behalf.of.content.owner = NULL, video.id = NULL,
  verbose = FALSE)

Arguments

token

Your token as returned by youOAuth.

part

The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include. The default value is snippet, see findParts or official documentation for all valid values.

n

Number of results to fecth. The default value is 50.

id

The id parameter specifies a comma-separated list of one or more unique playlist item IDs.

playlist.id

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 playlist.id parameter.

max.results

Specifies the maximum number of results that should be returned by each API call. Acceptable values are 0 to 50, inclusive. The default value is 50.

on.behalf.of.content.owner

This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. 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.

video.id

Specifies that the request should return only the playlist items that contain the specified video.

verbose

If TRUE prints infromational messages in the console. The default value is FALSE.

Details

Must pass either id or playlist.id

Author(s)

John Coene [email protected]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
# Authenticate
token <- youOAuth(client.id = "something.apps.googleusercontent.com",
                  client.secret = "XxxXX1XxXxXxxx1xxx1xxXXX")

# search playlists
search <- searchTube(token, query = "cats", type = "playlist")

# sample playlist id
id <- sample(search$id.playlistId, 1)

# fetch
items <- getPlaylistItems(token, playlist.id = id)

## End(Not run)

JohnCoene/youTubeDataR documentation built on May 4, 2018, 8:05 a.m.