YouTube Channel Results API

When a YouTube search contains channel results, they are parsed and exist within the channel_results array in the JSON output.

API Examples

Channel results overview

When SerpApi encounters channel results, we add them to our JSON output as the array channel_results. For each channel result, we are able to extract its position_on_page, title, link, verified (returns true if channel is verified), handle, subscribers description, thumbnail and more.

Channel results overview

Code to integrate

  • require 'google_search_results' 
    
    params = {
      engine: "youtube",
      search_query: "red hot chili peppers",
      api_key: "secret_api_key"
    }
    
    search = GoogleSearch.new(params)
    channel_results = search.get_hash[:channel_results]
    

JSON Example

{
  ...
  "channel_results": [
    {
      "position_on_page": 2,
      "title": "Red Hot Chili Peppers",
      "link": "https://www.youtube.com/@RedHotChiliPeppers",
      "verified": true,
      "handle": "@RedHotChiliPeppers",
      "subscribers": 7740000,
      "description": "The official YouTube channel of the Red Hot Chili Peppers.",
      "thumbnail": "https://yt3.googleusercontent.com/XpOIk4Lh0Xk7ImNJ-eltmJ91TiZsZzCUFz22hlackXPk5gGBXx8KRp6ZBYx5d6kLFdb2TiOg=s88-c-k-c0x00ffffff-no-rj-mo"
    }
  ],
  ...
}

SerpApi results for ""