Youtube search results that match the criteria you gave in your API call is returned. You may set up searches to exclusively get a certain kind of resource; by default, a search result set identifies matched video, channel, and playlist resources.
component string for necessary parameters
The part argument defines a list of one or more search resource characteristics, separated by commas, that will be included in the API response. Set snippet as the value for the argument.
Filters forContentOwner boolean (specify 0 or 1 of the following parameters).
This parameter is solely meant for YouTube content partners and may only be used in properly approved requests.
- The onBehalfOfContentOwner option identifies the content owner, and the forContentOwner parameter limits the search to only return movies that belong to that content owner.
- If forContentOwner is set to true, the following conditions must also be met by the request:
- It must have the onBehalfOfContentOwner argument.
- The user approving the request must be logged in as the designated content owner’s account.
- Video must be chosen as the value for the type parameter.
- The following additional parameters cannot be changed: Definition, dimension, duration, licence, ability to be embedded or syndicated, and kind of video.
Only requests that have been properly approved may use this option. Only videos posted via the developer’s application or website may be found using the forDeveloper search restriction. The API server recognises the developer using the request’s authorisation credentials. The q parameter and other optional search parameters may be used with the for Developer parameter.
Also LIke: Top 15 YouTubers with the Most Subscribers
With this functionality, the project ID of the developer’s application in the Google Developers Console is automatically added to each submitted video.
The API server utilises the request’s permission credentials to determine the developer when a search request later updates the forDeveloper argument to true. As a consequence, a developer may limit the videos that appear in search results to those that were posted via their own app or website but not those that were uploaded through other applications or websites.
Only requests that have been properly approved may use this option. Only videos owned by the authorised user may be found using the forMine option. If you set this parameter to true, video must also be specified as the value of the type parameter. Moreover, none of the other parameters listed below may be specified in the same request: Definition, dimension, duration, licence, ability to be embedded or syndicated, and kind of video.
A list of videos that are connected to the video that the relatedToVideoId parameter’s value indicates may be retrieved. If you are utilising this option, the type parameter must be set to video, and the parameter value must be a YouTube video ID.
- The only additional options that are available if the relatedToVideoId parameter is set are part, maxResults, pageToken, regionCode, relevanceLanguage,
- safeSearch, type (which must be set to video), and fields.
- The channelId option specifies that only resources produced by the channel should be included in the API response.
- If your request contains a value for the channelId parameter and sets the type parameter value to video but does not additionally select one of the forContentOwner, forDeveloper, or forMine filters, the
- number of videos that may be found in the search results is limited to 500.
- You may limit a search to just certain types of channels by using the channelType argument.
- The following are valid values: any – Return all channels.
- only obtain shows when using show.
By specifying eventType, a search is limited to broadcast events. You must also set the type parameter’s value to video if you supply a value for this parameter.
- Valid values include:
- Completed: Only count broadcasts that have already aired.
- only live broadcasts are included.
- only include broadcasts that are currently airing.
In addition to defining a circular geographic region, the location parameter together with the locationRadius parameter limit a search to movies whose metadata include a geographic location that is inside that area. The string that is the parameter value contains the latitude and longitude information, for example (37.42307,-122.08427).
- The area’s geographic centre is indicated by the location parameter value.
- The greatest distance that the location associated with a video may be from that point, as specified by
- the locationRadius parameter, without the video being removed from the search results.
- If your request just includes a value for the location parameter and nothing for the locationRadius parameter, the API will return an error.
- You must also set the value of the type parameter to video if you supply a value for this parameter.
A circular geographic region is defined by the locationRadius and location parameters together.
A floating point number followed by a measuring unit must be the parameter value. The accepted units of measurement are m, km, ft, and mi. Valid parameter values, for instance, are 1500m, 5km, 10000ft, and 0.75mi. Values for the locationRadius parameter greater than 1000 kilometres are not supported by the API.
Unsigned integer maxResults
The maximum number of items that should be returned in the result set is specified by the maxResults argument. The range of valid values is 0 to 50 inclusive. the string on Behalf Of ContentOwner is set to 5 by default.
Only requests that have been properly approved may use this option. Remember that only YouTube content partners should use this option.
The onBehalfOfContentOwner argument specifies that a YouTube CMS user who is operating on behalf of the content owner supplied in the parameter value is identified by the request’s authorisation credentials. The target audience for this parameter is YouTube content partners that run a variety of YouTube channels.
Instead of needing to enter login information for each individual channel, it enables content owners to authenticate only once to access all of their video and channel data. The user must login using a CMS account that is connected to the designated YouTube content owner.