Videos
Query YouTube Videos.
Table Specific Information
Select
By default, SupportEnhancedSQL is set to true, and the following will be passed to YouTube Analytics if present. Other filters will be executed client side. If SupportEnhancedSQL is set to false, only the following filters will be honored.
By default, if no filters are specified, the driver will return all videos owned by the authenticated user.
Only one of the following columns may be filtered by at a time: Id, MyRating, ChannelId, or Chart. Extra columns supported are ForMine, Language, ForContentOwner, OnBehalfOfContentOwner.
A search against all videos on Youtube may be executed by specifying SearchTerms, RelatedToVideoId, VideoDuration, VideoCategoryId, or Region.
All columns support the '=' operator. PublishedAt also supports these additional operators: '>', '>=', '<', and '<='. Id and ChannelId supports IN.
Order by is supported for the Date, Rating, Relevance and Title columns.
SELECT * FROM Videos WHERE Id = '12345679' SELECT * FROM Videos WHERE PublishedAt >= '2016-01-01T20:30:00Z' LIMIT 10 SELECT Description FROM Videos WHERE ForMine = True ORDER BY Date
Note: Ordering is not supported when specifying one of the colums used for searching channels such as SearchTerms.
The IN operator can be used to specify a list of channels. This call returns a list of videos for each specified channel.
SELECT * FROM Videos WHERE ChannelId IN (a, b, c) SELECT * FROM Videos WHERE ChannelId IN (SELECT Id FROM Channels)
IN operator can also be used for getting data for multiple videos.
SELECT * FROM Videos WHERE Id IN (a, b, c)
Columns
Name | Type | Dimension | DefaultMetric | DefaultDimension | Description |
Id [KEY] | String | The Id that YouTube uses to uniquely identify the video. | |||
ChannelId | String | The Id that YouTube uses to uniquely identify the channel that the video was uploaded to. | |||
CategoryId | String | The YouTube video category associated with the video. | |||
Title | String | The title of the video. | |||
ChannelTitle | String | Channel title for the channel that the video belongs to. | |||
PublishedAt | Datetime | The date and time that the video was published. Note that this time might be different than the time that the video was uploaded. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. | |||
Description | String | The description of the video. | |||
Duration | String | The length of the video. The property value is an ISO 8601 duration. | |||
ViewCount | Long | The number of times the video has been viewed. | |||
LikeCount | Long | The number of users who have indicated that they liked the video. | |||
DislikeCount | Long | The number of users who have indicated that they disliked the video. In conjunction with changes to make video dislike counts private across the entire YouTube platform, this field is returned only if the API request was authenticated by the video owner. | |||
CommentCount | Long | The number of comments for the video. | |||
EmbedHtml | String | An iframe tag that embeds a player that will play the video. | |||
PublicStatsViewable | Boolean | This value indicates whether the extended video statistics on the watch page are publicly viewable. By default, those statistics are viewable, and statistics like the viewcount and ratings will still be publicly visible even if this value is set to false. | |||
TagsAggregate | String | A list of keyword tags associated with the video. | |||
LiveBroadcastContent | String | Indicates if the video is an upcoming/active live broadcast. A value of none indicates the video is not an upcoming/active live broadcast. Valid values for this column: live, none, upcoming. | |||
Dimension | String | Indicates whether the video is available in 3D or in 2D. | |||
Definition | String | Indicates whether the video is available in high definition HD or only in standard definition. Valid values for this column: hd,sd. | |||
Caption | String | Indicates whether captions are available for the video. Valid values for this column: false, true. | |||
LicensedContent | Boolean | Indicates whether the video represents licensed content, which means that the content was uploaded to a channel linked to a YouTube content partner and then claimed by that partner. | |||
AllowedAggregate | String | A list of region codes that identify countries where the video is viewable. | |||
BlockedAggregate | String | A list of region codes that identify countries where the video is blocked. | |||
Projection | String | Specifies the projection format of the video. Valid values: 360, rectangular. | |||
PrivacyStatus | String | The privacy status of the playlist. Valid values: private, public, unlisted. | |||
MadeForKids | Boolean | This value indicates whether the video is Made For Kids. | |||
License | String | The license. Valid values: creativeCommon, youtube. | |||
Embeddable | Boolean | This value indicates whether the video can be embedded on another website. | |||
ThumbnailsDefaultUrl | String | The URL of the default image. | |||
DefaultLanguage | String | This column is confidential to trusted testers. The language of the text in the Title and Description columns. | |||
DefaultAudioLanguage | String | The default_audio_language column specifies the language spoken in the default audio track of the video. | |||
UploadStatus | String | The status of the uploaded video. Valid values for this column: deleted, failed, processed, rejected, uploaded. | |||
FailureReason | String | This value explains why a video failed to upload. This column only has a value if the UploadStatus column indicates that the upload failed. Valid values for this column: codec, conversion, emptyFile, invalidFile, tooSmall, uploadAborted. | |||
RejectionReason | String | This value explains why YouTube rejected an uploaded video. This column only has a value if the UploadStatus column indicates that the upload was rejected. Valid values for this column: claim, copyright, duplicate, inappropriate, length, termsOfUse, trademark, uploaderAccountClosed, uploaderAccountSuspended. | |||
RecordingDate | Datetime | The date and time when the video was recorded. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sssZ) format. | |||
SearchTerms | String | The query term to search for. |
Pseudo-Columns
SELECT ステートメントのWHERE 句では、疑似カラムフィールドを使用して、データソースから返されるタプルを詳細に制御することができます。
Name | Type | Description |
SafeSearch | String | Indicates whether the search results should include restricted content as well as standard content. Acceptable values: moderate, none, or strict. |
EventType | String | The eventType parameter restricts a search to broadcast events. Acceptable values are: COMPLETED, LIVE, UPCOMING.
使用できる値は次のとおりです。COMPLETED, LIVE, UPCOMING |
RelatedToVideoId | String | Retrieves a list of videos that are related to the video that the column value identifies. |
VideoDuration | String | Filters video search results based on their duration. Acceptable values: any, long, medium or short. |
VideoCategoryId | String | The videoCategoryId parameter identifies the video category for which the chart should be retrieved. |
Region | String | Instructs the API to select a video chart available in the specified region. This column can only be used in conjunction with the chart column. The parameter value is an ISO 3166-1 alpha-2 country code. |
ForMine | String | Restricts the search to only retrieve videos owned by the authenticated user. It is false by default. |
Chart | String | The chart parameter identifies the chart that you want to retrieve. Acceptable values are: mostPopular - Return the most popular videos for the specified content region and video category.
使用できる値は次のとおりです。mostPopular |
MyRating | String | The rating of the authenticated user. Acceptable values: like or dislike.
使用できる値は次のとおりです。like, dislike |
Language | String | Retrieve localized resource metadata for a specific application language that the YouTube website supports. |
ForContentOwner | String | Restricts the search to only retrieve videos owned by the content owner specified by the OnBehalfOfContentOwner parameter. |
OnBehalfOfContentOwner | String | This parameter is intended exclusively for YouTube content partners. |