Вы можете получить эту статистику, запросив часть liveStreamingDetails
при запросе подробностей видео. Вот пример запроса HTTPS ( ref ):
GET https://www.googleapis.com/youtube/v3/videos?part=snippet%2Cstatistics%2CliveStreamingDetails&id=21X5lGlDOfg&key=[YOUR_API_KEY] HTTP/1.1
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
И результат:
{
"kind": "youtube#videoListResponse",
"etag": "\"Bdx4f4ps3xCOOo1WZ91nTLkRZ_c/ARYNDpdj0hFzJ8zKV9SLVLV4PWE\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": [
{
"kind": "youtube#video",
"etag": "\"Bdx4f4ps3xCOOo1WZ91nTLkRZ_c/_SdqmAfikf6n_Jny6hfytlYz1wY\"",
"id": "21X5lGlDOfg",
"snippet": {
"publishedAt": "2018-12-28T18:40:15.000Z",
"channelId": "UCLA_DiR1FfKNvjuUpBHmylQ",
"title": "NASA Live: Official Stream of NASA TV",
"description": "Direct from America's space program to YouTube, watch NASA TV live streaming here to get the latest from our..."
},
"statistics": {
"viewCount": "8512883",
"likeCount": "130811",
"dislikeCount": "6836",
"favoriteCount": "0",
"commentCount": "0"
},
"liveStreamingDetails": {
"actualStartTime": "2018-12-28T18:41:30.221Z",
"scheduledStartTime": "2018-12-28T19:00:00.000Z",
"concurrentViewers": "108"
}
}
]
}
Посмотрите на элемент concurrentViewers
.