YouTube Search

It returns a list of resources based on the search query parameters, and a resource can be a channel, playlist, or video.

Search request allows only one method to retrieve a list.

It has a quota cost of 100 per request. So, make sure we use it appropriately.

API Documentation: https://developers.google.com/youtube/v3/docs/search

Sample Request

Name Value Notes
Request URL https://www.googleapis.com/youtube/v3/search URL specifies the resource
Request Method GET GET method for list
Query Parameters key=API_KEY API_KEY for authorization
  part=snippet This determines what data to be included in the response. Value "snippet" is one of the valid part values for a search resource.
  q=randomcodez Query string to search for a specific text.
  type=video Determines the type of results, and value "video" is one of the valid values.
  channelId=CHANNEL_ID

Determines the search be applied only on a specific channel.

CHANNEL_ID to be replaced with valid channel ID.

  maxResults=20 Determines the maximum number of results in the API response.
  order=data Determines the order of the results in the API response.

HTTP Request URL: https://www.googleapis.com/youtube/v3/search

  • Method: GET
  • Optional Parameter for search by a keyword: q=randomcodez
  • Some of the other query parameters that can be passed along with the request are
    •  

Here is the sample POSTMAN request for YouTube API for search.

 

Sample Response

 

POSTMAN Collection

The POSTMAN collection can be downloaded from the below GitHub repository.

Overall

We understood the YouTube Data API search request and have successfully executed a simple search request.