获取 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屋!