webhook for youtube comments - youtube

first of all im using youtube api to create my app. im in progress to creating an app to get every comment from my youtube channel and reply to it. it's mainly used for customer relationship activity. right now im using a script which call youtube api to pull its data (all comments from my channel) every 30 seconds. but it takes a lot of time and burdens my server. its not quota friendly too.
so here are my questions
is there no webhook or something on youtube so i can get a notification / event every time there's comment on my channel and reply to it. something similar to facebook webhook.

Related

Youtube subscriber detection

I can't find any documentation with yt api to fire an event whenever a new user subscribes, but I wonder how people on live streams add new subscriber info on their videos whenever someone subscribes.
I'm trying to get the same youtube subscriber notification like people do when they are in livestreams.
But I can't find any way to do it.
I thought of setting interval of checking channel, like if the sub count increases, check the latest subscriber from subscription list.
But this is kinda complicated and can't handle multiple users when they subscribe.
So my question is how does the youtuber's subscriber notification works and how can I replicate it in a nodejs project for example:
async function newSub(sub){ myWeb.send(user.name+ " Thank you for subscribing"); }

Is there a function to view donation information via YouTube Data API?

I am hoping to pull live stream donation information every 5 minutes onto my server. I am making a script to check that information for the names of the crew and send them payments automatically. Is there a way with the YouTube Data API to handle donation information?
None of the YouTube apis support this functionality. The main issue is that the YouTube apis are more then ten years old. They just give you basic access to the videos on YOuTube.
What you are looking for would be access to data used in the YouTube web app that being donations which is a relatively new future, and again part of the web app. Not just video data. Its just not something YouTube has released an api for yet.
Try and submit a feature request Issue tracker
As DalmTo mentioned, the YouTube Data API v3 doesn't have such feature.
However I recommend you to try out my open-source YouTube operational API. Indeed by requesting https://yt.lemnoslife.com/lives?part=donations&id=VIDEO_ID you will get in item["donations"] the donations currently displayed in the YouTube live chat. Especially may interest you:
Donation timestamp: donation["timestampUsec"] (example: 1654111675007219)
Donator channel id: donation["authorExternalChannelId"] (example: UC_PkX-rSBPWJqoK2zRRalfQ)
Donation amount: donation["purchaseAmountText"]["simpleText"] (example: 100,00\u00a0$US)
Donation message: donation["message"]["runs"][0] (example: FOR JUSTICE!)

Does the YouTube API have a webhook or a socket? Notify me when there is a new comment? [cerrada]

I have developed a program with the youtube api that get all the live chat (Message in live of youtube)
Now, I am looking for that every time there is a new message in the live chat,
This is because I want to create a bot so that when someone puts "Twitter!" the bot responds with my twitter.
Since I couldn't find a stream of the new messages, what I did was get the messages. And then get them back in 10 seconds. And then select the messages that you had not obtained before

How do I get the bot to send embed message when a new video is posted?

I'm trying to use the YouTube API to get my discord bot to send me a message when I post a new video, but since I'm a beginner I do not know how to do this. The idea is that it looks like this: http://prntscr.com/j8je80 , the embed is ready but the api part of youtube is still missing.
You needed to subscribe to push notification.
The YouTube Data API (v3) supports push notifications via
PubSubHubbub, a server-to-server publish/subscribe protocol for
Web-accessible resources. Notifications are pushed out to subscribers
via HTTP webhooks, which is much more efficient than polling-based
solutions. With PubSubHubbub, your server finds out about events in
near real-time, without having to determine the optimal polling
interval or repeatedly fetching data that hasn’t changed.
So these are the following activities that will trigger the push notification:
uploads a video
updates a video's title
updates a video's description
To be able to implement these, there is a step by step explanation on how to subscribe.

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