getVideos: getVideos

Description Usage Arguments Details Author(s) Examples

View source: R/get_videos.R

Description

Returns a list of videos that match the API request parameters.

Usage

1
2
3
getVideos(token, part = "snippet", n = 50, chart, id, my.rating,
  hl = NULL, max.results = 50, on.behalf.of.content.owner = NULL,
  region.code = NULL, video.category.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 for all valid values.

n

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

chart

The chart parameter identifies the chart that you want to retrieve. Only valid value is mostPopular or NULL.

id

Specifies a comma-separated list of the YouTube video ID(s) for the resource(s) that are being retrieved. In a video resource, the id property specifies the video's ID.

my.rating

This parameter can only be used in a properly authorized request. Set this parameter's value to like or dislike to instruct the API to only return videos liked or disliked by the authenticated user.

hl

Specifies the language that will be used for text values in the API response. The default value (from YouTube) is NULL. See getLanguages. If localized resource details are available in that language, the resource's snippet (part = "snippet").

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.

region.code

Instructs the API to select a video chart available in the specified region. This parameter can only be used in conjunction with the chart parameter. The parameter value is an ISO 3166-1 alpha-2 country code.

video.category.id

Identifies the video category for which the chart should be retrieved. This parameter can only be used in conjunction with the chart parameter. By default, charts are not restricted to a particular category. The default value is 0.

verbose

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

Details

Must specify one (and only one) of chart, id or my.rating

Author(s)

John Coene [email protected]

Examples

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

# get videos
videos <- getVideos(token)

## End(Not run)

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