mrobbins5
mrobbins5

Reputation: 11

YouTube Data API V3 not returning Livestream from Channel ID

I'm working on a project that requires me to get a YouTube live stream's chat for use in my program. Everything was working perfectly with this js package, but it seems that google has changed something because it suddenly stopped working. I have regenerated keys, and am well below my quota, so I know that isn't the problem.

Strangely, when I use the YouTube data API "try this api" section in their online documentation, the same problem is happening where the live stream is not found by the id. I've tried it on many different live channels, and all have returned an empty "items" array. Anyone else have this issue?

  function execute() {
return gapi.client.youtube.search.list({
  "part": "snippet, id",
  "channelId": "UCSJ4gkVC6NrvII8umztf0Ow",
  "eventType": "live",
  "type": "video"
})
    .then(function(response) {
            // Handle the results here (response.result has the parsed body).
            console.log("Response", response);
          },
          function(err) { console.error("Execute error", err); });
 }

Results from the request:

{
 "kind": "youtube#searchListResponse",
 "etag": "\"8jEFfXBrqiSrcF6Ee7MQuz8XuAM/4y-zlkAvKOyrH7TNQpxpBtYUxKU\"",
 "regionCode": "US",
 "pageInfo": {
  "totalResults": 0,
  "resultsPerPage": 5
 },
 "items": []
}

Upvotes: 1

Views: 552

Answers (2)

terryoboy
terryoboy

Reputation: 154

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 leave channelId blank it will return all of YouTube's live streams.

Google's instructions for getting help say to add the tag google-apis-explorer to your post. I have submitted an edit to add that tag to your original post. Hopefully we'll all get some answers soon.

Upvotes: 0

user3206911
user3206911

Reputation: 117

I can confirm this issue but the issue is a bug from Google. Hope it gets fixed soon.

Upvotes: 0

Related Questions