问题
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.
来源:https://stackoverflow.com/questions/37715244/is-it-possible-to-get-a-list-of-users-in-a-youtube-gaming-live-stream