Is it possible to get a list of users in a Youtube

2019-08-15 18:24发布

问题:

I am working with the Youtube Live Streaming api. I don't see this, but I am wondering if there is a way to get a list of all viewers.

回答1:

If you have the specific stream's videoId you can use the undocumented live_stats endpoint to get the number of viewers:

https://www.youtube.com/live_stats?v={videoid}


回答2:

@JAL - your answer works great. Thanks, I have also found success using this url:

Getting the live stream details (like viewer numbers):

https://www.googleapis.com/youtube/v3/videos?part=snippet%2CliveStreamingDetails&id={VIDEO_ID_HERE}&fields=items(id%2Csnippet(title%2CliveBroadcastContent)%2CliveStreamingDetails%2FconcurrentViewers)&key={YOUR_API_KEY_HERE}

I found this url from another question: Get list of gaming live streams on Youtube.