Learn R Programming

tuber (version 0.2.1)

yt_search: Search YouTube

Description

Search for videos, channels and playlists. (By default, the function searches for videos.)

Usage

yt_search(term = NULL, maxResults = 5, channelId = NULL, channelType = NULL, type = "video", eventType = NULL, location = NULL, locationRadius = NULL, publishedAfter = NULL, publishedBefore = NULL, videoDefinition = "any", videoCaption = "any", videoLicense = "any", videoSyndicated = "any", videoType = "any", ...)

Arguments

term
Character. Search term; required; no default
maxResults
Numeric. 0 to 50. Acceptable values are 0 to 50, inclusive. Search results are constrained to a maximum of 500 videos if type is video and we have a value of ChannelId.
channelId
Character. Only return search results from this channel; Optional.
channelType
Character. Optional. Takes one of two values: 'any' or 'show'. Default is 'any'
type
Character. Optional. Takes one of three values: 'video', 'channel', or 'playlist'
eventType
Character. Optional. Takes one of three values: `completed', 'live' or 'upcoming'
location
Character. Optional. Latitude and Longitude within parentheses, e.g. "(37.42307,-122.08427)"
locationRadius
Character. Optional. e.g. "1500m", "5km", "10000ft", "0.75mi"
publishedAfter
Character. Optional. RFC 339 Format. For instance, "1970-01-01T00:00:00Z"
publishedBefore
Character. Optional. RFC 339 Format. For instance, "1970-01-01T00:00:00Z"
videoDefinition
Character. Optional. Takes one of three values: 'any' (return all videos; Default), 'high' and 'standard'
videoCaption
Character. Optional. Takes one of three values: 'any' (return all videos; Default), 'closedCaption', 'none'. Type must be set to video.
videoLicense
Character. Optional. Takes one of three values: 'any' (return all videos; Default), 'creativeCommon' (return videos with Creative Commons license), 'youtube' (return videos with standard YouTube license).
videoSyndicated
Character. Optional. Takes one of two values: 'any' (return all videos; Default), 'true' (return only syndicated videos)
videoType
Character. Optional. Takes one of three values: 'any' (return all videos; Default), 'episode' (return episode of shows), 'movie' (return movies)
...
Additional arguments passed to tuber_GET.

Value

data.frame with 13 elements - kind, etag, id.kind, id.videoId, snippet.publishedAt, snippet.channelId, snippet.title, snippet.description, snippet.thumbnails.default.url, snippet.thumbnails.medium.url, snippet.thumbnails.high.url, snippet.channelTitle, snippet.liveBroadcastContent

References

https://developers.google.com/youtube/v3/docs/search/list

Examples

Run this code
## Not run: 
# yt_search(term="Barack Obama")
# ## End(Not run)

Run the code above in your browser using DataLab