1

With the Twitch API (Get Followed Streams) you can get a list of channels that your account follows, and you can use a stream_type parameter to only get streams that are live.

Is there a way to do something like this with the YouTube API?

cowtongue
  • 11
  • 2
  • It looks like I can use [`Subscriptions:list`](https://developers.google.com/youtube/v3/docs/subscriptions/list) to get the list of subscribed to channels and then use each ID from that on [`Search:list`](https://developers.google.com/youtube/v3/docs/search/list) with `eventType: live`, but is there another way? – cowtongue Jul 06 '17 at 00:17
  • I could also do it the other way around. Get every single live stream with `Search:list` using `nextPageToken`, get the list of subscribed to channels with `Subscriptions:list`, and then finally filter it out on my end. Both the method in the first comment and this one would take up too many API quota costs, though. Still trying to find if there's something I'm missing. – cowtongue Jul 06 '17 at 14:09
  • Turns out the method in the second comment won't work. Using `nextPageToken` returns an empty list of channels after a couple calls, so it's impossible to get every single live stream. I wish `Subscriptions:list` just had an `eventType: live`! – cowtongue Jul 06 '17 at 14:47
  • Yes, you're correct you can use the [Subscriptions: list](https://developers.google.com/youtube/v3/docs/subscriptions/list) to return all channels that your account subscribe. You can verify it [here](https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.subscriptions.list?part=snippet&channelId=UCTEAryTk0JGFSLNZ0tBIw2w&_h=3&). Now, for the Live part in the Youtube, I think that is the best way to do it. Check this [SO question](https://stackoverflow.com/questions/32454238/how-to-check-if-youtube-channel-is-streaming-live) for more information. – KENdi Jul 06 '17 at 15:37
  • Thank you! I've tested it out a little. The 100+ quota cost per search call is a little cumbersome. If a user is subscribed to 200 channels, then that's a cost of a little over 20,000. My app will continuously do this call every 5ish minutes to have an updated state of people who are live. That's over 400,000 calls in one hour. Do you know if there's something I'm misunderstanding with the quota costs? I may have to switch to a system that makes users manually add Youtube channels that they wish to track. – cowtongue Jul 06 '17 at 17:02

0 Answers0