Learn R Programming

:sweet_potato: tuber: Access YouTube API via R

Access YouTube API via R. Get comments posted on YouTube videos, get information on how many times a video has been liked, search for videos with particular content, and much more. You can also get closed captions of videos you own. To learn more about the YouTube API, see https://developers.google.com/youtube/v3/.

Installation

To get the current development version from GitHub:

# install.packages("devtools")
devtools::install_github("soodoku/tuber", build_vignettes = TRUE)

To get a quick overview of some important functions in tuber, check out this article. For a fun vignette about how to analyze emojis in YouTube comments, see here.

Using tuber

To get going, get the application id and password from Google Developer Console (see https://developers.google.com/youtube/v3/getting-started). Enable all the YouTube APIs. Also enable Freebase API. Then set the application id and password via the yt_oauth function. For more information about YouTube OAuth, see YouTube OAuth Guide.

yt_oauth("app_id", "app_password")

Note: If you are on ubuntu, you may have to run the following before doing anything:

httr::set_config(httr::config( ssl_verifypeer = 0L ) )

Get Statistics of a Video

get_stats(video_id = "N708P-A45D0")

Get Information About a Video

get_video_details(video_id = "N708P-A45D0")

Get Captions of a Video

get_captions(video_id = "yJXTXN4xrI8")

Search Videos

yt_search("Barack Obama")

Get All the Comments Including Replies

get_all_comments(video_id = "a-UQz7fqR3w")

License

Scripts are released under the MIT License.

Contributor Code of Conduct

The project welcomes contributions from everyone! In fact, it depends on it. To maintain this welcoming atmosphere, and to collaborate in a fun and productive way, we expect contributors to the project to abide by the Contributor Code of Conduct.

Copy Link

Version

Install

install.packages('tuber')

Monthly Downloads

898

Version

0.9.9

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

June 11th, 2020

Functions in tuber (0.9.9)

get_all_comments

Get all the comments for a video including replies
list_abuse_report_reasons

List reasons that can be used to report abusive videos
list_caption_tracks

List Captions of a Video
list_channel_sections

List Channel Sections
list_channel_resources

Returns List of Requested Channel Resources
get_comment_threads

Get Comments Threads
get_comments

Get Comments
list_captions

Upload Video to Youtube
list_videos

List (Most Popular) Videos
read_sbv

Read SBV file
get_playlists

Get Playlists
tuber_POST

POST
tuber_GET

GET
list_channel_videos

Returns List of Requested Channel Videos
get_playlist_items

Get Playlist Items
list_guidecats

Get list of categories that can be associated with YouTube channels
upload_video

Upload Video to Youtube
get_subscriptions

Get Subscriptions
yt_oauth

Set up Authorization
list_channel_activities

List Channel Activity
get_video_details

Get Details of a Video or Videos
yt_token

Check if authentication token is in options
yt_search

Search YouTube
get_related_videos

Get Related Videos
list_langs

List Languages That YouTube Currently Supports
list_regions

List Content Regions That YouTube Currently Supports
get_stats

Get statistics of a Video
list_videocats

List of Categories That Can be Associated with Videos
tuber_check

Request Response Verification
upload_caption

Upload Video Caption to Youtube
list_my_videos

List My videos
tuber

tuber provides access to the YouTube API V3.
tuber_DELETE

DELETE
yt_topic_search

Search YouTube by Topic It uses the Freebase list of topics
delete_comments

Delete a Particular Comment
delete_playlists

Delete a Playlist
get_all_channel_video_stats

Get statistics on all the videos in a Channel
delete_videos

Delete a Video
delete_captions

Delete a Particular Caption Track
get_captions

Get Particular Caption Track
get_channel_stats

Get statistics of a Channel
delete_playlist_items

Delete a Playlist Item
delete_channel_sections

Delete Channel Sections