Google::Apis::YoutubeV3::YouTubeService
Inherits Google::Apis::Core::BaseService < Reference < Object
Constructors
Creates a new YouTubeService client configured for the YouTube Data API v3.
The base URL is set to www.googleapis.com/youtube/v3/.
Instance methods
Sets the authorization credentials using an OAuth2 client. Extracts a valid access token from the client and applies it to all subsequent API requests. See https://developers.google.com/youtube/v3/guides/authentication
Sets the authorization credentials using a service account. Extracts a valid access token from the service account credentials and applies it to all subsequent API requests. See https://developers.google.com/youtube/v3/guides/authentication
Executes multiple API requests in a single HTTP connection using batch processing (max 50 requests).
Yields a BatchRequest object to which individual requests can be added.
Returns an array of HTTP responses, one per batched request.
Binds a live broadcast to a live stream, or removes an existing binding.
The id is the broadcast ID. Set stream_id to bind, or omit it to unbind the current stream.
Returns the updated LiveBroadcast resource.
See https://developers.google.com/youtube/v3/live/docs/liveBroadcasts/bind
Deletes a caption track identified by id.
Returns Nil on success.
See https://developers.google.com/youtube/v3/docs/captions/delete
Deletes a channel section identified by id.
Returns Nil on success.
See https://developers.google.com/youtube/v3/docs/channelSections/delete
Deletes a comment identified by id.
Returns Nil on success.
See https://developers.google.com/youtube/v3/docs/comments/delete
Deletes a live broadcast identified by id.
The broadcast must be in "complete" or "testing" status to be deleted.
Returns Nil on success.
See https://developers.google.com/youtube/v3/live/docs/liveBroadcasts/delete
Removes a ban from a live chat, allowing the user to send messages again.
The id is the ban ID. Returns Nil on success.
See https://developers.google.com/youtube/v3/live/docs/liveChatBans/delete
Deletes a live chat message identified by id.
Only the message author or a chat moderator can delete a message. Returns Nil on success.
See https://developers.google.com/youtube/v3/live/docs/liveChatMessages/delete
Removes a moderator from a live chat identified by id.
Returns Nil on success.
See https://developers.google.com/youtube/v3/live/docs/liveChatModerators/delete
Deletes a live stream identified by id.
Returns Nil on success.
See https://developers.google.com/youtube/v3/live/docs/liveStreams/delete
Deletes a playlist identified by id.
Returns Nil on success. Requires authorization.
See https://developers.google.com/youtube/v3/docs/playlists/delete
Deletes a playlist image identified by id.
Returns Nil on success.
See https://developers.google.com/youtube/v3/docs/playlistImages/delete
Removes an item from a playlist by its id.
Returns Nil on success.
See https://developers.google.com/youtube/v3/docs/playlistItems/delete
Removes a subscription identified by id.
Returns Nil on success.
See https://developers.google.com/youtube/v3/docs/subscriptions/delete
Deletes a third-party link identified by linking_token and type.
Returns Nil on success.
See https://developers.google.com/youtube/v3/docs/thirdPartyLinks/delete
Deletes a YouTube video identified by id.
Requires authorization with the appropriate scope. Returns Nil on success.
See https://developers.google.com/youtube/v3/docs/videos/delete
Downloads a caption track file. The id is the caption track ID. Use tfmt to specify the output format (e.g., "srt", "vtt", "sbv"). Use tlang to request a translated caption. The file is written to download_dest (file path or IO). See https://developers.google.com/youtube/v3/docs/captions/download
Retrieves the rating (like/dislike/none) that the authorized user gave to a video.
The id parameter is a comma-separated list of video IDs.
Returns a JSON::Any containing rating information for each requested video.
See https://developers.google.com/youtube/v3/docs/videos/getRating
Retrieves trainability information for a video.
The id parameter specifies the video ID. Returns a VideoTrainability resource.
See https://developers.google.com/youtube/v3/docs/videos
Submits an abuse report for a YouTube resource (e.g., video, comment, channel).
The abuse_report_object contains the report details as JSON. Returns the created report as JSON::Any.
See https://developers.google.com/youtube/v3/docs/abuseReports/insert
Uploads a caption track for a video.
The caption_object must include the video ID and language. Set sync to true to auto-sync timing.
Returns the newly created Caption resource.
See https://developers.google.com/youtube/v3/docs/captions/insert
Uploads a channel banner image. The returned URL can then be used with update_channel to set the banner.
Provide the image via upload_source (file path or IO) with the appropriate content_type.
Returns a ChannelBannerResource containing the URL to use in the channel branding settings.
See https://developers.google.com/youtube/v3/docs/channelBanners/insert
Creates a new channel section (e.g., featured playlists, recent activity) on a channel page.
The channel_section_object defines the section type and content.
Returns the newly created ChannelSection resource.
See https://developers.google.com/youtube/v3/docs/channelSections/insert
Creates a reply to an existing comment.
The comment_object must include the parent comment ID and text content.
Returns the newly created Comment resource.
See https://developers.google.com/youtube/v3/docs/comments/insert
Creates a new top-level comment thread on a video or channel.
The comment_thread_object must include the channel/video ID and the top-level comment text.
Returns the newly created CommentThread resource.
See https://developers.google.com/youtube/v3/docs/commentThreads/insert
Creates a new live broadcast event.
The live_broadcast_object must include title, scheduled start time, and privacy status.
Returns the newly created LiveBroadcast resource.
See https://developers.google.com/youtube/v3/live/docs/liveBroadcasts/insert
Inserts a cuepoint (ad break) into a live broadcast.
The id is the broadcast ID. The cuepoint_object contains cuepoint settings such as duration.
Returns the created Cuepoint resource.
See https://developers.google.com/youtube/v3/live/docs/liveBroadcasts/cuepoint
Bans a user from a live chat, preventing them from sending messages.
The live_chat_ban_object must include the live chat ID, banned user channel ID, and ban type ("permanent" or "temporary").
Returns the newly created LiveChatBan resource.
See https://developers.google.com/youtube/v3/live/docs/liveChatBans/insert
Sends a message to a live broadcast's chat.
The live_chat_message_object must include the live chat ID and message text.
Returns the newly created LiveChatMessage resource.
See https://developers.google.com/youtube/v3/live/docs/liveChatMessages/insert
Adds a moderator to a live chat.
The live_chat_moderator_object must include the live chat ID and the channel ID of the user to promote.
Returns the newly created LiveChatModerator resource.
See https://developers.google.com/youtube/v3/live/docs/liveChatModerators/insert
Creates a new live stream for the authenticated user.
The live_stream_object must include CDN settings and a title.
Returns the newly created LiveStream resource with ingestion info.
See https://developers.google.com/youtube/v3/live/docs/liveStreams/insert
Creates a new playlist for the authenticated user.
The part parameter specifies which properties are set in playlist_object (e.g., "snippet,status").
Returns the newly created Playlist resource.
See https://developers.google.com/youtube/v3/docs/playlists/insert
Uploads and associates an image with a playlist.
Provide the image via upload_source (file path or IO) with the appropriate content_type.
If no upload_source is given, creates the image from playlist_image_object metadata only.
Returns the newly created PlaylistImage resource.
See https://developers.google.com/youtube/v3/docs/playlistImages/insert
Adds a resource (video) to a playlist.
The playlist_item_object must include the playlist ID and the resource to add.
Returns the newly created PlaylistItem resource.
See https://developers.google.com/youtube/v3/docs/playlistItems/insert
Subscribes the authenticated user to a channel.
The subscription_object must include the channel ID to subscribe to.
Returns the newly created Subscription resource.
See https://developers.google.com/youtube/v3/docs/subscriptions/insert
Inserts a test item (internal/testing endpoint).
The test_item_object contains the test data. Returns the created TestItem.
Creates a new third-party link between a YouTube channel and an external platform.
The third_party_link_object defines the link details. Returns the newly created ThirdPartyLink.
See https://developers.google.com/youtube/v3/docs/thirdPartyLinks/insert
Uploads a video to YouTube with the given metadata.
The part parameter specifies which properties are included in the video_object (e.g., "snippet,status").
Set notify_subscribers to false to suppress notification to channel subscribers.
Returns the newly created Video resource.
See https://developers.google.com/youtube/v3/docs/videos/insert
Retrieves a list of channel activity events (uploads, likes, favorites, etc.).
The part parameter specifies which properties to include (e.g., "snippet,contentDetails").
Filter by channel_id or mine. Use published_after/published_before for date ranges.
Returns a ListActivitiesResponse with pagination support.
See https://developers.google.com/youtube/v3/docs/activities/list
Retrieves a list of caption tracks associated with the specified video.
The video_id is required. Optionally filter by id (comma-separated caption track IDs).
Returns a ListCaptionsResponse.
See https://developers.google.com/youtube/v3/docs/captions/list
Retrieves a list of channel sections for the specified channel.
The part parameter specifies which properties to include (e.g., "snippet,contentDetails").
Filter by channel_id, id, or mine. Returns a ListChannelSectionsResponse.
See https://developers.google.com/youtube/v3/docs/channelSections/list
Retrieves a list of YouTube channels matching the specified criteria.
The part parameter specifies which properties to include (e.g., "snippet,statistics,contentDetails").
Filter by id, for_username, for_handle, mine (authenticated user's channel), or category_id.
Returns a ListChannelsResponse with pagination support.
See https://developers.google.com/youtube/v3/docs/channels/list
Retrieves a list of comments matching the specified criteria.
The part parameter specifies which properties to include (e.g., "snippet").
Filter by id for specific comments or parent_id for replies to a top-level comment.
Returns a ListCommentsResponse with pagination support.
See https://developers.google.com/youtube/v3/docs/comments/list
Retrieves a list of application languages that the YouTube website supports.
Use hl to specify the language for localized names. Returns a ListI18nLanguagesResponse.
See https://developers.google.com/youtube/v3/docs/i18nLanguages/list
Retrieves a list of content regions that the YouTube website supports.
Use hl to specify the language for localized region names. Returns a ListI18nRegionsResponse.
See https://developers.google.com/youtube/v3/docs/i18nRegions/list
Retrieves a list of live broadcasts matching the specified criteria.
The part parameter specifies which properties to include (e.g., "snippet,status,contentDetails").
Filter by broadcast_status ("active", "all", "completed", "upcoming"), id, or mine.
Returns a ListLiveBroadcastsResponse with pagination support.
See https://developers.google.com/youtube/v3/live/docs/liveBroadcasts/list
Retrieves live chat messages from a live broadcast's chat.
The live_chat_id identifies the chat. Use page_token for polling new messages.
Returns a LiveChatMessageListResponse with messages and a polling interval.
See https://developers.google.com/youtube/v3/live/docs/liveChatMessages/list
Retrieves a list of moderators for a live chat.
The live_chat_id identifies the chat. Returns a LiveChatModeratorListResponse with pagination support.
See https://developers.google.com/youtube/v3/live/docs/liveChatModerators/list
Retrieves a list of live streams owned by the authenticated user.
The part parameter specifies which properties to include (e.g., "snippet,cdn,status").
Filter by id or mine. Returns a ListLiveStreamsResponse with pagination support.
See https://developers.google.com/youtube/v3/live/docs/liveStreams/list
Retrieves a list of channel members (sponsors) for the authenticated user's channel.
Filter by filter_by_member_channel_id for specific members, or has_access_to_level for a membership level.
The mode parameter controls listing mode ("list_by_member" or "list_by_newest").
Returns a MemberListResponse with pagination support.
See https://developers.google.com/youtube/v3/docs/members/list
Retrieves all membership levels defined for the authenticated user's channel.
Returns a MembershipsLevelListResponse containing the available pricing levels.
See https://developers.google.com/youtube/v3/docs/membershipsLevels/list
Retrieves a list of images associated with a playlist.
Use parent to specify the playlist ID. Returns a PlaylistImageListResponse with pagination support.
See https://developers.google.com/youtube/v3/docs/playlistImages/list
Retrieves a list of items in a playlist.
The part parameter specifies which properties to include (e.g., "snippet,contentDetails").
Filter by playlist_id to get items from a specific playlist, or id for specific item IDs.
Returns a ListPlaylistItemsResponse with pagination support.
See https://developers.google.com/youtube/v3/docs/playlistItems/list
Retrieves a list of playlists matching the specified criteria.
The part parameter specifies which properties to include (e.g., "snippet,contentDetails").
Filter by channel_id, id (comma-separated playlist IDs), or mine for the authenticated user's playlists.
Returns a ListPlaylistsResponse with pagination support.
See https://developers.google.com/youtube/v3/docs/playlists/list
Searches for YouTube resources (videos, channels, playlists) matching the given query parameters.
The part parameter specifies the resource properties to include (e.g., "snippet").
Filter by q (search query), type (video/channel/playlist), channel_id, region_code, and many more.
Returns a SearchListsResponse containing matching results with pagination support via page_token.
See https://developers.google.com/youtube/v3/docs/search/list
Retrieves a list of subscriptions matching the specified criteria.
The part parameter specifies which properties to include (e.g., "snippet,contentDetails").
Filter by channel_id, mine (authenticated user), my_subscribers, or id.
Returns a ListSubscriptionsResponse with pagination support.
See https://developers.google.com/youtube/v3/docs/subscriptions/list
Retrieves a list of Super Chat events for the authenticated user's channel.
Super Chat events represent paid messages from viewers during live streams.
Returns a SuperChatEventListResponse with pagination support.
See https://developers.google.com/youtube/v3/docs/superChatEvents/list
Retrieves a list of third-party links associated with a channel.
Filter by linking_token, type, or external_channel_id.
Returns a ThirdPartyLinkListResponse.
See https://developers.google.com/youtube/v3/docs/thirdPartyLinks/list
Retrieves the list of valid reasons for reporting a video as abusive.
Use hl for localized reason descriptions. Returns a ListVideoAbuseReportReasonResponse.
See https://developers.google.com/youtube/v3/docs/videoAbuseReportReasons/list
Retrieves a list of video categories available in the specified region.
Filter by id (comma-separated category IDs) or region_code. Use hl for localized category names.
Returns a ListVideoCategoriesResponse.
See https://developers.google.com/youtube/v3/docs/videoCategories/list
Retrieves a list of videos matching the specified criteria.
The part parameter specifies which resource properties to include (e.g., "snippet,contentDetails,statistics").
Filter by id (comma-separated video IDs), chart (mostPopular), or my_rating (like/dislike).
Returns a ListVideosResponse with pagination support via page_token.
See https://developers.google.com/youtube/v3/docs/videos/list
Flags one or more comments as spam. The id parameter is a comma-separated list of comment IDs to flag. See https://developers.google.com/youtube/v3/docs/comments/markAsSpam
Adds a like or dislike rating to a video, or removes a rating. The id is the video ID and rating must be one of "like", "dislike", or "none". See https://developers.google.com/youtube/v3/docs/videos/rate
Reports a video as abusive by submitting a video abuse report.
The video_abuse_report_object must include the video ID, reason ID, and optionally a secondary reason ID.
Returns Nil on success.
See https://developers.google.com/youtube/v3/docs/videos/reportAbuse
Sets the moderation status of one or more comments. The moderation_status can be "published", "heldForReview", or "rejected". Set ban_author to true to also ban the comment author from making future comments. See https://developers.google.com/youtube/v3/docs/comments/setModerationStatus
Sets a custom thumbnail image for a video.
The video_id identifies the video to set the thumbnail for.
Returns a SetThumbnailResponse containing the thumbnail URLs.
See https://developers.google.com/youtube/v3/docs/thumbnails/set
Sets a watermark image for a channel's videos.
The channel_id identifies the target channel and invideo_branding_object contains the watermark configuration.
Returns Nil on success.
See https://developers.google.com/youtube/v3/docs/watermarks/set
Streams live chat messages via a persistent connection for real-time updates.
The live_chat_id identifies the chat. Use page_token for continuation.
Returns a LiveChatMessageListResponse with messages and polling metadata.
Transitions a live broadcast to a new status (e.g., "testing", "live", "complete").
The broadcast_status specifies the target status. The broadcast must be bound to a stream first.
Returns the updated LiveBroadcast resource.
See https://developers.google.com/youtube/v3/live/docs/liveBroadcasts/transition
Transitions a live chat message to a new status.
The id is the message ID and status is the target status.
Returns Nil on success.
Removes the watermark image from a channel's videos.
The channel_id identifies the channel to remove the watermark from.
Returns Nil on success.
See https://developers.google.com/youtube/v3/docs/watermarks/unset
Updates an existing caption track's metadata or replaces the caption data.
Set sync to true to have YouTube auto-sync the updated caption timing.
Returns the updated Caption resource.
See https://developers.google.com/youtube/v3/docs/captions/update
Updates a channel's metadata (e.g., branding settings, localized info).
The part parameter specifies which properties in channel_object will be updated.
Returns the updated Channel resource.
See https://developers.google.com/youtube/v3/docs/channels/update
Updates an existing channel section's metadata.
The channel_section_object must include the section ID and updated properties.
Returns the updated ChannelSection resource.
See https://developers.google.com/youtube/v3/docs/channelSections/update
Updates an existing comment's text.
The comment_object must include the comment ID and updated text.
Returns the updated Comment resource.
See https://developers.google.com/youtube/v3/docs/comments/update
Updates an existing comment thread (e.g., modifies the top-level comment text).
The comment_thread_object must include the thread ID and updated properties.
Returns the updated CommentThread resource.
See https://developers.google.com/youtube/v3/docs/commentThreads
Updates an existing live broadcast's metadata (e.g., title, description, scheduled times).
The live_broadcast_object must include the broadcast ID and updated properties.
Returns the updated LiveBroadcast resource.
See https://developers.google.com/youtube/v3/live/docs/liveBroadcasts/update
Updates an existing live stream's metadata.
The live_stream_object must include the stream ID and updated properties.
Returns the updated LiveStream resource.
See https://developers.google.com/youtube/v3/live/docs/liveStreams/update
Updates a playlist's metadata (e.g., title, description, privacy status).
The part parameter specifies which properties in playlist_object will be updated.
Returns the updated Playlist resource.
See https://developers.google.com/youtube/v3/docs/playlists/update
Updates an existing playlist image, optionally replacing the image data.
Provide a new image via upload_source (file path or IO) with the appropriate content_type.
Returns the updated PlaylistImage resource.
See https://developers.google.com/youtube/v3/docs/playlistImages/update
Updates a playlist item (e.g., changes its position in the playlist or updates the video note).
The playlist_item_object must include the item ID and updated properties.
Returns the updated PlaylistItem resource.
See https://developers.google.com/youtube/v3/docs/playlistItems/update
Updates an existing third-party link's metadata.
The third_party_link_object must include the link ID and updated properties.
Returns the updated ThirdPartyLink resource.
See https://developers.google.com/youtube/v3/docs/thirdPartyLinks/update
Updates a video's metadata.
The part parameter specifies which properties in video_object will be updated.
The video ID must be set in the video_object. Returns the updated Video resource.
See https://developers.google.com/youtube/v3/docs/videos/update