在YouTube上获取游戏直播流的列表 [英] Get list of gaming live streams on Youtube
问题描述
我正在尝试使用Youtube Data API来获取当前与游戏相关的直播流的列表,但是我找不到适合我需要的端点并返回每个频道的观看人数.
I'm trying to use the Youtube Data API to grab the list of currently gaming related live streams but I can't find any endpoint that fit what I need and return the number of viewers for each of those channels.
你们对我如何做到这一点有任何想法吗?
Do you guys have any idea of how I could manage to do that ?
谢谢.
推荐答案
List of gaming live streams:
https://www.googleapis.com/youtube/v3/search?part=snippet&eventType=live&type=video&videoCategoryId=20®ionCode=US&maxResults=50&key={YOUR_API_KEY_HERE}
videoCategoryId = 20是游戏"
videoCategoryId=20 is "Gaming"
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}
用适当的值替换{}
中这些链接的部分.
Substitue the parts of these links that are in {}
with your appropriate values.
这篇关于在YouTube上获取游戏直播流的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!