9

I wrote an application that uses YouTube Data API V3's search.list, which was able to pull active live streams for a specified channel (working since 2018) using the following:

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

The above no longer returns any results for me as of September 12, 2019.

Broadening the search to all videos for a specified channel also no longer shows the active live stream:

https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCSJ4gkVC6NrvII8umztf0Ow&order=date&key={MYAPIKEY}

However, searching the ID of the active live stream itself works to return information about the video, which leads me to believe there may still be a way to accomplish this:

https://www.googleapis.com/youtube/v3/videos?part=snippet&id=hHW1oY26kxQ&key=

I am looking for a new solution that would be able to query a channel to see if they have an active live stream running, and grab the properties for that live stream.

dvh
  • 91
  • 1
  • 5
  • I'm having the same issue, and noticed that the live videos are showing as "liveBroadcastContent": "upcoming" in the API search results even though they are currently live and streaming. – bendur Sep 17 '19 at 15:46

5 Answers5

2

Update: It seems the problem is fixed by Google, and it works as normal.

I got the same problem, the search API eventType=live gives no results anymore and coding it without eventType shows all videos including the live ones, but there's no way to sort it out because livebroadcastcontent says none even if it is a live one. I hope it's a temporary failure. Changing channelId to channelId doesn't do the thing.

I got a temporary solution as follows. Remove channelId and use a keyword instead q=... this returns a live broadcast. It's not the best or most handy solution, but it helped me a bit. I think YouTube has to solve our problem n with eventType-live for a channelId it still doesn't work.

karel
  • 5,489
  • 46
  • 45
  • 50
prox
  • 21
  • 2
  • Are you able to query for **active** streams or just previously broadcasted videos? Using search.list, without including eventType I am still unable to see active streams. – dvh Sep 14 '19 at 13:24
  • 2
    Same problem here. My use case is that I need to find a live stream for a specific channel. If I remove the **eventType** parameter the live video is returned but there is no way of telling that it is live because all the results have `liveBroadcastContent: none` Because I know the exact title of the video I am able to use a workaround for now and find it by using `q=videoname` and `eventType=live`. The live video search using `channelId` as a parameter seems to be broken. – Darius Janušauskas Sep 19 '19 at 11:47
  • Unfortunately your temporary solution does not work for my use case as keywords cannot sufficiently narrow down to a single channel. I cannot guarantee that the channel I am querying will consistently use a unique keyword. – dvh Sep 21 '19 at 05:58
2

It looks like something changed on google's end. Change 'channelId' to 'channelID' and it should work. Their documentation still says channelId, though, so maybe they are going to change it back.

Brendon
  • 59
  • 2
  • 1
    Are you using [search.list](https://developers.google.com/youtube/v3/guides/implementation/search)? channelId is working fine for me to narrow down to 1 channel. channelID does not filter results. – dvh Sep 21 '19 at 05:52
1

Your kind of search query (that is relative to a given channel) can be replaced with a proper query to the respective channel's uploads playlist.

Upon doing that, do query the Videos endpoint for the set of videos that you determined to be newly added (via the previous call you did to the PlaylistItems endpoint).

For each such video, then reach for the property liveBroadcastContent.

stvar
  • 6,551
  • 2
  • 13
  • 28
  • 1
    Querying a channel's uploads playlist does not seem to return the active live stream. This is the playlist I am testing with, which does not contain the active live stream: https://www.youtube.com/playlist?list=UUSJ4gkVC6NrvII8umztf0Ow `https://www.googleapis.com/youtube/v3/playlistItems?key=APP_KEY&part=contentDetails&fields=items/contentDetails&playlistId=UUSJ4gkVC6NrvII8umztf0Ow&order=date` – dvh Sep 14 '19 at 13:20
1

There is definitely something going on with the YouTube Data API. If you give it a try on the on the Deverloper Console for Search: list it won't work if you are providing channelId. However, if you provide channelId it will always return 0 results. I've tried this with several other channels who are live streaming right now.

There are several other people posting about this same issue. So we are not the only ones experiencing this issue. Google needs to fix something.

terryoboy
  • 136
  • 2
  • 12
  • Was this possibly an intermittent issue for you? I am able to query and get results while providing `channelId`. The results are just missing the live stream, but regular videos will show up. – dvh Sep 21 '19 at 06:02
0

I hope my contribution isn't coming too late. I had the same issue, when my query (q) was left at news, but the moment i changed it to a term common to my channel uploads, i got the right response. part=snippet&type=video&event_type=live&channel_id=****&key=******&q=[youchanneltitleorkeyword]