View source: R/get_related_videos.R
| get_related_videos | R Documentation |
'r lifecycle::badge("deprecated")'
Takes a video id and returns related videos.
**Note:** YouTube deprecated the 'relatedToVideoId' parameter in August 2023.
This function will return an error as the API endpoint no longer works.
Consider using yt_search with relevant keywords instead.
get_related_videos(
video_id = NULL,
max_results = 50,
safe_search = "none",
...
)
video_id |
Character. Required. No default. |
max_results |
Maximum number of items that should be returned. Integer. Optional. Default is 50. Values over 50 trigger multiple requests and may increase API quota usage. |
safe_search |
Character. Optional. Takes one of three values:
|
... |
Additional arguments passed to |
data.frame with 16 columns: video_id, rel_video_id,
publishedAt, channelId, title, description,
thumbnails.default.url, thumbnails.default.width, thumbnails.default.height,
thumbnails.medium.url,
thumbnails.medium.width, thumbnails.medium.height, thumbnails.high.url,
thumbnails.high.width,
thumbnails.high.height, channelTitle, liveBroadcastContent
https://developers.google.com/youtube/v3/docs/search/list
## Not run:
# Set API token via yt_oauth() first
# NOTE: This function no longer works due to YouTube API deprecation
get_related_videos(video_id = "yJXTXN4xrI8")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.