Learn R Programming

tuber (version 3.0.0)

get_all_channel_video_stats: Get statistics on all the videos in a Channel

Description

Efficiently collects all video IDs from a channel's uploads playlist, then fetches statistics and details using batch processing for optimal API quota usage.

Usage

get_all_channel_video_stats(
  channel_id = NULL,
  mine = FALSE,
  auth = if (mine) "token" else "key"
)

Value

A data frame with one row per video and the columns `video_id`, `title`, `published_at`, `description`, `channel_id`, `channel_title`, `view_count`, `like_count`, `comment_count` (numeric) and `url`. A channel with no uploads returns the same columns and zero rows. An unknown `channel_id` is an error.

Arguments

channel_id

Character. Id of the channel

mine

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

auth

Authentication method, `"key"` or `"token"`. `mine = TRUE` requires OAuth.

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")
}

Run the code above in your browser using DataLab