Learn R Programming

tuber (version 1.1.0)

get_all_channel_video_stats: Get statistics on all the videos in a Channel

Description

Iterates through the channel's uploads playlist, collecting video IDs from each page until no further pages are available. Statistics and details are then fetched for every video.

Usage

get_all_channel_video_stats(channel_id = NULL, mine = FALSE, ...)

Value

A data.frame containing video metadata along with view, like, dislike and comment counts.

If the channel_id is mistyped or there is no information, an empty list is returned

Arguments

channel_id

Character. Id of the channel

mine

Boolean. TRUE if you want to fetch stats of your own channel. Default is FALSE.

...

Additional arguments passed to tuber_GET.

References

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

Examples

Run this code
if (FALSE) {

# Set API token via yt_oauth() first

get_all_channel_video_stats(channel_id="UCxOhDvtaoXDAB336AolWs3A")
get_all_channel_video_stats(channel_id="UCMtFAi84ehTSYSE9Xo") # Incorrect channel ID
}

Run the code above in your browser using DataLab