How to get youtube notifications

Viewed 1435

Is there's a parameter in Youtube-Api that I can get all the notifications coming from my channel? For example, a user comments on my video then I want to get the user comment. But this seems impossible if I just get the comments for each videos. What I want is to get the new comments coming from my channel using the youtube notification. [1]: https://i.stack.imgur.com/xMVm1.png I'm currently using python.

from googleapiclient.discovery import build

api_key = '**'

youtube = build('youtube', 'v3', developerKey=api_key)

request = youtube.channels().list(
    part='statistics',
    id='UCoAlE_uI3N6MWuiQQc-EZgw'
)

response = request.execute()

print(response)
1 Answers

Getting notifications for changes is called pub sub or push notifications.

Push notifications only support the following

Your PubSubHubbub callback server receives Atom feed notifications when a channel does any of the following activities:

  • uploads a video
  • updates a video's title
  • updates a video's description

The YouTube data api does not have a pub sub endpoint for telling you when a comment was posted.

I would do a file.list and just poll for the information.

Related