获取 Youtube 上的游戏直播列表 [英] Get list of gaming live streams on Youtube

查看:76
本文介绍了获取 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 ?

谢谢.

推荐答案

游戏直播列表:
https://www.googleapis.com/youtube/v3/search?part=snippet&eventType=live&type=video&videoCategoryId=20&regionCode=US&maxResults=50&key={YOUR_API_KEY_HERE}

List of gaming live streams:
https://www.googleapis.com/youtube/v3/search?part=snippet&eventType=live&type=video&videoCategoryId=20&regionCode=US&maxResults=50&key={YOUR_API_KEY_HERE}

videoCategoryId=20 是游戏"

videoCategoryId=20 is "Gaming"

获取直播详情(如观众人数):
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}

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆