I’m trying to make a system where I fetch all YouTube comments
using YouTube v3 API and my agents will reply to those comments from the system and that’s will be published into YouTube.
Now the problem is if I want to get all comments in a short time then every time I have to crawl all videos and comment’s for checking a new comment. Which is very costly in API calls.
Now I’m searching for webhooks, which will notify or send me the new comment, expecting like what I get from Facebook Webhooks.
2
Answers
YouTube webhook for comment or like Not available yet. Only way to hit their server for find new comment. It's have a API which give all comment of a channel.
As you said there isn’t any such YouTube webhook to get notified when a new comment is posted.
However I would recommend you to use CommentThreads: list with
allThreadsRelatedToChannelId
which has by default ordertime
(most recent first). Likewise by just making a single YouTube Data API v3 request periodically you will get fastly and without spending a lot of your quota the latest comments on your YouTube channel (on your videos and also on you "Community" tab). If more thanmaxResults
(maximum 50) comments are published during a period you can usenextPageToken
to continue to browse these new comments.