Skip to content

TroyHernandez/tuber

This branch is 15 commits ahead of, 10 commits behind gojiplus/tuber:refs/heads/master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f1e10ea Â· Jul 18, 2024
Dec 16, 2021
Jul 18, 2024
Jan 28, 2018
Feb 15, 2021
Feb 1, 2018
Nov 22, 2017
Jun 26, 2015
Mar 19, 2024
Jul 1, 2020
Apr 13, 2021
Jul 18, 2024
Jun 29, 2023
Apr 4, 2024
Jun 28, 2023
Nov 20, 2016
Jun 11, 2020
Apr 4, 2024
Oct 10, 2015
Jul 18, 2024
Jun 29, 2023
Feb 26, 2021
Feb 26, 2021
Apr 10, 2018
Jun 30, 2019
Aug 5, 2020
May 9, 2018

Repository files navigation

🍠 tuber: Access YouTube API via R

Build status Build Status CRAN_Status_Badge codecov

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 the Google Developer Console (see https://developers.google.com/youtube/v3/getting-started). Enable all the YouTube APIs. 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")

Note: It was previously possible to get captions for all videos that had “Community contributions” enabled. However, since YouTube removed that option in September 2020, the get_captions function now only works for videos created with the same account as the API credentials you use. An alternative for collecting YouTube video captions is the youtubecaption package.

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.

About

🍠 Access YouTube from R

Resources

License

Citation

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • R 100.0%