if (FALSE) {
# Single video
details <- get_video_details("yJXTXN4xrI8")
# Multiple videos - automatically batched
video_ids <- c("yJXTXN4xrI8", "LDZX4ooRsWs", "kJQP7kiw5Fk")
details <- get_video_details(video_ids)
# Get as data frame
df <- get_video_details(video_ids, simplify = TRUE)
# Get specific parts
stats <- get_video_details(video_ids, part = c("statistics", "contentDetails"))
# Preserve the nested API resource when that is easier to inspect:
details <- get_video_details("yJXTXN4xrI8", simplify = FALSE)
title <- details$items[[1]]$snippet$title
}
Run the code above in your browser using DataLab