Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

YouTube Data API no longer returns active live streams from search.list

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.

like image 349
dvh Avatar asked Sep 13 '19 20:09

dvh


People also ask

Why is YouTube API not working?

My YouTube API Key is Not Working Your API key may not be working because you're using it for the wrong project. Be sure you're using the key for the project that you created it for, especially if you created multiple projects at the same time. If it's still not working, consider creating a new API key entirely.

Did YouTube change its API?

July 12, 2022. The YouTube API Services Terms of Service has been updated.

Can you still use YouTube API v2?

You can continue using the v2 API for comments and uploading video captions for now, and we'll be adding this functionality into the v3 API soon.

What is the YouTube Live Streaming API?

The YouTube Live Streaming API lets you create, update, and manage live events on YouTube. Using the API, you can schedule events (broadcasts) and associate them with video streams, which represent the actual broadcast content.

What data format does the live streaming API use?

JSON is a common, language-independent data format that provides a simple text representation of arbitrary data structures. For more information, see json.org. As noted above, the Live Streaming API uses functionality that is technically part of either the YouTube Data API or the YouTube Content ID API.

How do I use the YouTube Data API?

You can use the YouTube Data API to update metadata about the video, such as the recording location or the regions where the broadcast will be viewable. Defines the advertising settings for a video (or broadcast).

How do I claim a live video on YouTube?

When claiming live video, you need to create your claim before the video actually exists. The API does support this, and the life of a broadcast document explains the YouTube Content ID API calls that enable you to create your claim. Upon receiving your inbound video stream, YouTube can then broadcast that video on two different outbound streams:


2 Answers

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.

like image 100
Brendon Avatar answered Oct 11 '22 11:10

Brendon


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.

like image 2
prox Avatar answered Oct 11 '22 09:10

prox