View source: R/report_helpers.R
| get_top_videos | R Documentation |
Retrieves performance metrics for individual videos, sorted by views.
get_top_videos(
date_range,
end_date = NULL,
ids = "channel==MINE",
max_results = 10,
metrics = c("views", "likes", "comments"),
...
)
date_range |
Date range string or start date |
end_date |
End date (only needed if date_range is a specific start date) |
ids |
Channel identifier (default: "channel==MINE") |
max_results |
Number of top videos to return (default: 10) |
metrics |
Vector of metrics to include (default: views, likes, comments) |
... |
Additional arguments passed to get_report() |
API response with top videos data
## Not run:
# Top 10 videos by views in last 30 days
get_top_videos("last_30_days")
# Top 25 videos with more metrics
get_top_videos("this_month", max_results = 25,
metrics = c("views", "likes", "comments", "shares", "estimatedMinutesWatched"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.