Live events not showing in YouTube Data API v3 - youtube

I'm sending a get request to a link like this:
https://www.googleapis.com/youtube/v3/search?part=snippet&channel_id=[MyChannelId]&type=video&eventType=live&key=[MyKey].
The purpose of it is to get the live events of a specific channel for which I provided its ID.
The problem is this does not work all the time.
When I go checking in YouTube, the channel is streaming, but I don't get any data through this link.
What are the possible mistakes that may cause this?
Or is it just a problem from their servers?
Is there an alternative reliable way?

Related

What is YouTube's NEW Live Stream permanent url?

I was using this url to embed our livestream in our website
https://www.youtube.com/embed/live_stream?channel=CHANNEL_ID
Unfortunately it's not working anymore, I think it has been deprecated by YouTube :(
Any idea what is the alternative?
I want to avoid using the YouTube search API due to it's limitations, and the fact that the broadcast has to start so the API can find it.
Also I don't want to keep updating the url YouTube creates every time I start a stream...
Please help

Is there a way to use the Youtube API v3 to grab past subscriber counts?

From everything I have researched I have not been able to find a way to grab past subscriber count on a certain date. If I can't do it through Youtube API is there any other site that would have this kind of data I could grab for a bunch of different channels?
I'm not sure if this is possible with all of the updates to YouTube showing rounded subscriber counts. I would recommend checking out the YouTube Analytics & Reporting APIs at https://developers.google.com/youtube/analytics. Other than that, I would say not.

Permanent Stream Now link for embedding 2019/2020

I've found multiple links to embed YouTube livestreams across Stack:
https://www.youtube.com/embed/live_stream?channel={CHANNEL_ID}
https://www.youtube.com/channel/{ChannelID}/live
But no one works when I use my correct channel id. It looks like YouTube doesn't support permanent links for unlisted live streams anymore. Can anyone confirm this, or does it still exist?
Or can I use the YouTube API to know what the next Stream Now video id is going to be. That could also solve my problems. However, up until now I haven't found a way to retrieve this data.
P.s. Our stream must be UNLISTED. We don't want to stream publicly.

How to know when a user complete viewing a video with youtube api?

I currently working on a project where I send a youtube video id and show it to the user. And I want to know if there are a method to know when the video is completely viewed by the user. In my application's client, I send a response to the server when the view is completed, and I want to prevent receiving falsed data from untrusted user. And that's why I want to know if youtube api make a things like that. I have seen other similar topics, but I haven't found a safe way to secure communication between client and server for this problem.
Thank you.
From this SO post, it was mentioned that you can use onStateChange event to log that a user viewed a video. But the general idea here is about safety which I think is more important, from there I don't think you can do this as per the privacy of a user. You can understand more about YouTube Reporting and Analytics here.

How can I get the status of a user's stream?

I'm building a thing that tells people when a YouTube stream goes live. In order to build this, I need to know when a stream goes live, be it via push notification, polling, or some other method.
With Twitch, it's dead easy. All you have to do is send a GET to https://api.twitch.tv/kraken/streams/[STREAMER_USERNAME_HERE] and you get a JSON object with everything you'd ever hope to know (try it in your browser, it's great). I have combed through the YouTube Streaming and Data API's and nothing even close to this feature seems to exist.
I know that something, somewhere is alerting something when a stream goes live, because my phone gets a notification when the people I am subscribed to start streaming. But if there are no public calls in the API, I'm left with no other option than scraping the HTML off a page every couple seconds, which is bad for both me and YouTube.
Further on this, YouTube's push notification API for regular videos famously doesn't work [1] [2] [3] [4], and every dev is left to either use the deprecated XML feeds (which update sometimes up to an hour slow) or scrape HTML off youtube.com pages (the only current solution for instant updates). So, even if there's something off the API that I missed, it's moot if it doesn't actually work.
That said, am I missing something? Is it possible to get a notification if a stream goes live? It's kind of a deal-breaker for YouTube vs Twitch if there isn't.
It is currently not possible to do what you are asking with the public YouTube API.
You can only retrieve information about your own liveStream or liveBroadcast objects, not anyone else's. Additionally, there is no public API to get a notification when another user goes live.

Resources