List
|
|||||
|
|
Returns a collection of search results that match the query parameters specified in the API request. By default, a search result set identifies matching video, channel, and playlist resources, but you can also configure queries to only retrieve a specific type of resource
Authorization
To use this building block you will have to grant access to at least one of the following scopes:
- Manage your YouTube account
- See, edit, and permanently delete your YouTube videos, ratings, comments and captions
- View your YouTube account
- View and manage your assets and associated content on YouTube
Input
This building block consumes 31 input parameters
Name | Format | Description |
---|---|---|
part Required |
STRING |
The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. Set the parameter value to snippet |
channelId |
STRING |
The channelId parameter indicates that the API response should only contain resources created by the channel |
channelType |
ENUMERATION |
The channelType parameter lets you restrict a search to a particular type of channel |
eventType |
ENUMERATION |
The eventType parameter restricts a search to broadcast events. If you specify a value for this parameter, you must also set the type parameter's value to video |
forContentOwner |
BOOLEAN |
Note: This parameter is intended exclusively for YouTube content partners. The forContentOwner parameter restricts the search to only retrieve resources owned by the content owner specified by the onBehalfOfContentOwner parameter. The user must be authenticated using a CMS account linked to the specified content owner and onBehalfOfContentOwner must be provided |
forDeveloper |
BOOLEAN |
The forDeveloper parameter restricts the search to only retrieve videos uploaded via the developer's application or website. The API server uses the request's authorization credentials to identify the developer. Therefore, a developer can restrict results to videos uploaded through the developer's own app or website but not to videos uploaded through other apps or sites |
forMine |
BOOLEAN |
The forMine parameter restricts the search to only retrieve videos owned by the authenticated user. If you set this parameter to true, then the type parameter's value must also be set to video |
location |
STRING |
The location parameter, in conjunction with the locationRadius parameter, defines a circular geographic area and also restricts a search to videos that specify, in their metadata, a geographic location that falls within that area. The parameter value is a string that specifies latitude/longitude coordinates e.g. (37.42307,-122.08427).
|
locationRadius |
STRING |
The locationRadius parameter, in conjunction with the location parameter, defines a circular geographic area. The parameter value must be a floating point number followed by a measurement unit. Valid measurement units are m, km, ft, and mi. For example, valid parameter values include 1500m, 5km, 10000ft, and 0.75mi. The API does not support locationRadius parameter values larger than 1000 kilometers. Note: See the definition of the location parameter for more information |
maxResults |
INTEGER |
The maxResults parameter specifies the maximum number of items that should be returned in the result set |
onBehalfOfContentOwner |
STRING |
Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner |
order |
ENUMERATION |
The order parameter specifies the method that will be used to order resources in the API response |
pageToken |
STRING |
The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved |
publishedAfter |
DATE_TIME |
The publishedAfter parameter indicates that the API response should only contain resources created after the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z) |
publishedBefore |
DATE_TIME |
The publishedBefore parameter indicates that the API response should only contain resources created before the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z) |
q |
STRING |
The q parameter specifies the query term to search for. Your request can also use the Boolean NOT (-) and OR (|) operators to exclude videos or to find videos that are associated with one of several search terms. For example, to search for videos matching either "boating" or "sailing", set the q parameter value to boating|sailing. Similarly, to search for videos matching either "boating" or "sailing" but not "fishing", set the q parameter value to boating|sailing -fishing. Note that the pipe character must be URL-escaped when it is sent in your API request. The URL-escaped value for the pipe character is %7C |
regionCode |
STRING |
The regionCode parameter instructs the API to return search results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code |
relatedToVideoId |
STRING |
The relatedToVideoId parameter retrieves a list of videos that are related to the video that the parameter value identifies. The parameter value must be set to a YouTube video ID and, if you are using this parameter, the type parameter must be set to video |
relevanceLanguage |
STRING |
The relevanceLanguage parameter instructs the API to return search results that are most relevant to the specified language. The parameter value is typically an ISO 639-1 two-letter language code. However, you should use the values zh-Hans for simplified Chinese and zh-Hant for traditional Chinese. Please note that results in other languages will still be returned if they are highly relevant to the search query term |
safeSearch |
ENUMERATION |
The safeSearch parameter indicates whether the search results should include restricted content as well as standard content |
topicId |
STRING |
The topicId parameter indicates that the API response should only contain resources associated with the specified topic. The value identifies a Freebase topic ID |
type |
STRING |
The type parameter restricts a search query to only retrieve a particular type of resource. The value is a comma-separated list of resource types |
videoCaption |
ENUMERATION |
The videoCaption parameter indicates whether the API should filter video search results based on whether they have captions. If you specify a value for this parameter, you must also set the type parameter's value to video |
videoCategoryId |
STRING |
The videoCategoryId parameter filters video search results based on their category. If you specify a value for this parameter, you must also set the type parameter's value to video |
videoDefinition |
ENUMERATION |
The videoDefinition parameter lets you restrict a search to only include either high definition (HD) or standard definition (SD) videos. HD videos are available for playback in at least 720p, though higher resolutions, like 1080p, might also be available. If you specify a value for this parameter, you must also set the type parameter's value to video |
videoDimension |
ENUMERATION |
The videoDimension parameter lets you restrict a search to only retrieve 2D or 3D videos. If you specify a value for this parameter, you must also set the type parameter's value to video |
videoDuration |
ENUMERATION |
The videoDuration parameter filters video search results based on their duration. If you specify a value for this parameter, you must also set the type parameter's value to video |
videoEmbeddable |
ENUMERATION |
The videoEmbeddable parameter lets you to restrict a search to only videos that can be embedded into a webpage. If you specify a value for this parameter, you must also set the type parameter's value to video |
videoLicense |
ENUMERATION |
The videoLicense parameter filters search results to only include videos with a particular license. YouTube lets video uploaders choose to attach either the Creative Commons license or the standard YouTube license to each of their videos. If you specify a value for this parameter, you must also set the type parameter's value to video |
videoSyndicated |
ENUMERATION |
The videoSyndicated parameter lets you to restrict a search to only videos that can be played outside youtube.com. If you specify a value for this parameter, you must also set the type parameter's value to video |
videoType |
ENUMERATION |
The videoType parameter lets you restrict a search to a particular type of videos. If you specify a value for this parameter, you must also set the type parameter's value to video |
= Parameter name
= Format
part STRING Required The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. Set the parameter value to snippet |
channelId STRING The channelId parameter indicates that the API response should only contain resources created by the channel |
channelType ENUMERATION The channelType parameter lets you restrict a search to a particular type of channel |
eventType ENUMERATION The eventType parameter restricts a search to broadcast events. If you specify a value for this parameter, you must also set the type parameter's value to video |
forContentOwner BOOLEAN Note: This parameter is intended exclusively for YouTube content partners. The forContentOwner parameter restricts the search to only retrieve resources owned by the content owner specified by the onBehalfOfContentOwner parameter. The user must be authenticated using a CMS account linked to the specified content owner and onBehalfOfContentOwner must be provided |
forDeveloper BOOLEAN The forDeveloper parameter restricts the search to only retrieve videos uploaded via the developer's application or website. The API server uses the request's authorization credentials to identify the developer. Therefore, a developer can restrict results to videos uploaded through the developer's own app or website but not to videos uploaded through other apps or sites |
forMine BOOLEAN The forMine parameter restricts the search to only retrieve videos owned by the authenticated user. If you set this parameter to true, then the type parameter's value must also be set to video |
location STRING The location parameter, in conjunction with the locationRadius parameter, defines a circular geographic area and also restricts a search to videos that specify, in their metadata, a geographic location that falls within that area. The parameter value is a string that specifies latitude/longitude coordinates e.g. (37.42307,-122.08427).
|
locationRadius STRING The locationRadius parameter, in conjunction with the location parameter, defines a circular geographic area. The parameter value must be a floating point number followed by a measurement unit. Valid measurement units are m, km, ft, and mi. For example, valid parameter values include 1500m, 5km, 10000ft, and 0.75mi. The API does not support locationRadius parameter values larger than 1000 kilometers. Note: See the definition of the location parameter for more information |
maxResults INTEGER The maxResults parameter specifies the maximum number of items that should be returned in the result set |
onBehalfOfContentOwner STRING Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner |
order ENUMERATION The order parameter specifies the method that will be used to order resources in the API response |
pageToken STRING The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved |
publishedAfter DATE_TIME The publishedAfter parameter indicates that the API response should only contain resources created after the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z) |
publishedBefore DATE_TIME The publishedBefore parameter indicates that the API response should only contain resources created before the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z) |
q STRING The q parameter specifies the query term to search for. Your request can also use the Boolean NOT (-) and OR (|) operators to exclude videos or to find videos that are associated with one of several search terms. For example, to search for videos matching either "boating" or "sailing", set the q parameter value to boating|sailing. Similarly, to search for videos matching either "boating" or "sailing" but not "fishing", set the q parameter value to boating|sailing -fishing. Note that the pipe character must be URL-escaped when it is sent in your API request. The URL-escaped value for the pipe character is %7C |
regionCode STRING The regionCode parameter instructs the API to return search results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code |
relatedToVideoId STRING The relatedToVideoId parameter retrieves a list of videos that are related to the video that the parameter value identifies. The parameter value must be set to a YouTube video ID and, if you are using this parameter, the type parameter must be set to video |
relevanceLanguage STRING The relevanceLanguage parameter instructs the API to return search results that are most relevant to the specified language. The parameter value is typically an ISO 639-1 two-letter language code. However, you should use the values zh-Hans for simplified Chinese and zh-Hant for traditional Chinese. Please note that results in other languages will still be returned if they are highly relevant to the search query term |
safeSearch ENUMERATION The safeSearch parameter indicates whether the search results should include restricted content as well as standard content |
topicId STRING The topicId parameter indicates that the API response should only contain resources associated with the specified topic. The value identifies a Freebase topic ID |
type STRING The type parameter restricts a search query to only retrieve a particular type of resource. The value is a comma-separated list of resource types |
videoCaption ENUMERATION The videoCaption parameter indicates whether the API should filter video search results based on whether they have captions. If you specify a value for this parameter, you must also set the type parameter's value to video |
videoCategoryId STRING The videoCategoryId parameter filters video search results based on their category. If you specify a value for this parameter, you must also set the type parameter's value to video |
videoDefinition ENUMERATION The videoDefinition parameter lets you restrict a search to only include either high definition (HD) or standard definition (SD) videos. HD videos are available for playback in at least 720p, though higher resolutions, like 1080p, might also be available. If you specify a value for this parameter, you must also set the type parameter's value to video |
videoDimension ENUMERATION The videoDimension parameter lets you restrict a search to only retrieve 2D or 3D videos. If you specify a value for this parameter, you must also set the type parameter's value to video |
videoDuration ENUMERATION The videoDuration parameter filters video search results based on their duration. If you specify a value for this parameter, you must also set the type parameter's value to video |
videoEmbeddable ENUMERATION The videoEmbeddable parameter lets you to restrict a search to only videos that can be embedded into a webpage. If you specify a value for this parameter, you must also set the type parameter's value to video |
videoLicense ENUMERATION The videoLicense parameter filters search results to only include videos with a particular license. YouTube lets video uploaders choose to attach either the Creative Commons license or the standard YouTube license to each of their videos. If you specify a value for this parameter, you must also set the type parameter's value to video |
videoSyndicated ENUMERATION The videoSyndicated parameter lets you to restrict a search to only videos that can be played outside youtube.com. If you specify a value for this parameter, you must also set the type parameter's value to video |
videoType ENUMERATION The videoType parameter lets you restrict a search to a particular type of videos. If you specify a value for this parameter, you must also set the type parameter's value to video |
Output
This building block provides 27 output parameters
Name | Format | Description |
---|---|---|
etag |
STRING |
Etag of this resource |
eventId |
STRING |
Serialized EventId of the request which produced this response |
items[] |
OBJECT |
A search result contains information about a YouTube video, channel, or playlist that matches the search parameters specified in an API request. While a search result points to a uniquely identifiable resource, like a video, it does not have its own persistent data |
items[].etag |
STRING |
Etag of this resource |
items[].id |
OBJECT |
A resource id is a generic reference that points to another YouTube resource |
items[].id.channelId |
STRING |
The ID that YouTube uses to uniquely identify the referred resource, if that resource is a channel. This property is only present if the resourceId.kind value is youtube#channel |
items[].id.kind |
STRING |
The type of the API resource |
items[].id.playlistId |
STRING |
The ID that YouTube uses to uniquely identify the referred resource, if that resource is a playlist. This property is only present if the resourceId.kind value is youtube#playlist |
items[].id.videoId |
STRING |
The ID that YouTube uses to uniquely identify the referred resource, if that resource is a video. This property is only present if the resourceId.kind value is youtube#video |
items[].kind |
STRING |
Identifies what kind of resource this is. Value: the fixed string "youtube#searchResult" |
items[].snippet |
OBJECT |
Basic details about a search result, including title, description and thumbnails of the item referenced by the search result |
items[].snippet.channelId |
STRING |
The value that YouTube uses to uniquely identify the channel that published the resource that the search result identifies |
items[].snippet.channelTitle |
STRING |
The title of the channel that published the resource that the search result identifies |
items[].snippet.description |
STRING |
A description of the search result |
items[].snippet.liveBroadcastContent |
ENUMERATION |
It indicates if the resource (video or channel) has upcoming/active live broadcast content. Or it's "none" if there is not any upcoming/active live broadcasts |
items[].snippet.publishedAt |
DATE_TIME |
The creation date and time of the resource that the search result identifies. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format |
items[].snippet.thumbnails |
OBJECT |
Internal representation of thumbnails for a YouTube resource |
items[].snippet.title |
STRING |
The title of the search result |
kind |
STRING |
Identifies what kind of resource this is. Value: the fixed string "youtube#searchListResponse" |
nextPageToken |
STRING |
The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set |
pageInfo |
OBJECT |
Paging details for lists of resources, including total number of items available and number of resources returned in a single page |
pageInfo.resultsPerPage |
INTEGER |
The number of results included in the API response |
pageInfo.totalResults |
INTEGER |
The total number of results in the result set |
prevPageToken |
STRING |
The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set |
regionCode |
STRING |
|
tokenPagination |
OBJECT |
Stub token pagination template to suppress results |
visitorId |
STRING |
The visitorId identifies the visitor |
= Parameter name
= Format
etag STRING Etag of this resource |
eventId STRING Serialized EventId of the request which produced this response |
items[] OBJECT A search result contains information about a YouTube video, channel, or playlist that matches the search parameters specified in an API request. While a search result points to a uniquely identifiable resource, like a video, it does not have its own persistent data |
items[].etag STRING Etag of this resource |
items[].id OBJECT A resource id is a generic reference that points to another YouTube resource |
items[].id.channelId STRING The ID that YouTube uses to uniquely identify the referred resource, if that resource is a channel. This property is only present if the resourceId.kind value is youtube#channel |
items[].id.kind STRING The type of the API resource |
items[].id.playlistId STRING The ID that YouTube uses to uniquely identify the referred resource, if that resource is a playlist. This property is only present if the resourceId.kind value is youtube#playlist |
items[].id.videoId STRING The ID that YouTube uses to uniquely identify the referred resource, if that resource is a video. This property is only present if the resourceId.kind value is youtube#video |
items[].kind STRING Identifies what kind of resource this is. Value: the fixed string "youtube#searchResult" |
items[].snippet OBJECT Basic details about a search result, including title, description and thumbnails of the item referenced by the search result |
items[].snippet.channelId STRING The value that YouTube uses to uniquely identify the channel that published the resource that the search result identifies |
items[].snippet.channelTitle STRING The title of the channel that published the resource that the search result identifies |
items[].snippet.description STRING A description of the search result |
items[].snippet.liveBroadcastContent ENUMERATION It indicates if the resource (video or channel) has upcoming/active live broadcast content. Or it's "none" if there is not any upcoming/active live broadcasts |
items[].snippet.publishedAt DATE_TIME The creation date and time of the resource that the search result identifies. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format |
items[].snippet.thumbnails OBJECT Internal representation of thumbnails for a YouTube resource |
items[].snippet.title STRING The title of the search result |
kind STRING Identifies what kind of resource this is. Value: the fixed string "youtube#searchListResponse" |
nextPageToken STRING The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set |
pageInfo OBJECT Paging details for lists of resources, including total number of items available and number of resources returned in a single page |
pageInfo.resultsPerPage INTEGER The number of results included in the API response |
pageInfo.totalResults INTEGER The total number of results in the result set |
prevPageToken STRING The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set |
regionCode STRING |
tokenPagination OBJECT Stub token pagination template to suppress results |
visitorId STRING The visitorId identifies the visitor |