2

How do you query multiple channels to see if they are streaming at that moment?

I tried to add multiple channelIds in this query:

https://www.googleapis.com/youtube/v3/search?part=snippet&channelId={channels_seperated_by_comma_and_http_query}&eventType=live&type=video&key={my_key}

That only gives the result of the first key

Mind gem
  • 134
  • 1
  • 10
  • This question already has an answer here: http://stackoverflow.com/questions/32454238/how-to-check-if-youtube-channel-is-streaming-live – paolo Aug 18 '16 at 22:31
  • My specific question is to query more then one channel in a request without the need to loop and do for every channel a request – Mind gem Aug 19 '16 at 15:10

1 Answers1

1

You can use Channels:list, which returns a collection of more than one channel.

HTTP request

GET https://www.googleapis.com/youtube/v3/channels

From the parameter part, it will give you contentDetails part=contentDetails

Response

If successful, this method returns a response body with the following structure:

{
  "kind": "youtube#channelListResponse",
  "etag": etag,
  "nextPageToken": string,
  "prevPageToken": string,
  "pageInfo": {
    "totalResults": integer,
    "resultsPerPage": integer
  },
  "items": [
    channel Resource
  ]
}

Based from Ibrahim Ulukaya, you can not add comma separated channels here. Either you can leave it blank to search all channels, or you can have a request per each channel and merge results. There is no multichannel search API.

Community
  • 1
  • 1
Android Enthusiast
  • 4,826
  • 2
  • 15
  • 30
  • 1
    Thanks for the answer... Too bad you cant search for multiple channels without using a loop. My users give in their channel ID and periodically they are checked for streaming. For Twitch accounts I can add the ID's in the query – Mind gem Aug 19 '16 at 15:14
  • 1
    Hi Mind gem, you can file a feature request here: https://code.google.com/p/gdata-issues/issues/entry?template=YouTube%20(Enhancement%20Request) – Android Enthusiast Oct 14 '16 at 06:37