YouTube 频道直播 API
按用户名或频道 ID 列出 YouTube 频道正在进行和已结束的直播,支持游标分页(标题、观看次数、时长、发布时间)。
US$1.20/千次请求,按请求付费,无需订阅。
@pixelforgegg
RANKED GRIND to Diamond - road to top 500 !builds !coach
3,140 views · Streamed 4 hours ago
{"id": "kQ7mZ2vT8pL","url": "https://www.youtube.com/watch?v=kQ7mZ2vT8pL","title": "RANKED GRIND to Diamond - road to top 500 !builds !coach","views": 3140,"lengthText": "3:12:08","publishedTime": "Streamed 4 hours ago","image": "https://i.ytimg.com/vi/kQ7mZ2vT8pL/hqdefault.jpg"}
价格与服务商
YouTube 频道直播 API 价格:一个 API,2 个可互换的服务商
最便宜的服务商优先响应。如果它失败,下一个会在同一次调用中接手。
试一试
一个请求获取 YouTube 频道直播
这个示例展示了 12 个字段中的 11 个。查看全部字段
{
"found": true,
"data": {
"nextCursor": "Eg0SC1BpeGVsZm9yZ2UxQoABAQ",
"lives": [
{
"id": "kQ7mZ2vT8pL",
"url": "https://www.youtube.com/watch?v=kQ7mZ2vT8pL",
"title": "RANKED GRIND to Diamond - road to top 500 !builds !coach",
"views": 3140,
"lengthText": "3:12:08",
"publishedTime": "Streamed 4 hours ago",
"image": "https://i.ytimg.com/vi/kQ7mZ2vT8pL/hqdefault.jpg"
},
{
"id": "nR4wY9uX2sK",
"url": "https://www.youtube.com/watch?v=nR4wY9uX2sK",
"title": "Sunday chill stream - new patch reactions and viewer games",
"views": 8720,
"lengthText": "2:45:51",
"publishedTime": "Streamed 3 days ago",
"image": "https://i.ytimg.com/vi/nR4wY9uX2sK/hqdefault.jpg"
},
{
"id": "vB1cD6eF3gH",
"url": "https://www.youtube.com/watch?v=vB1cD6eF3gH",
"title": "Charity marathon for local food bank - 12 hour stream",
"views": 15600,
"lengthText": "12:03:44",
"publishedTime": "Streamed 2 weeks ago",
"image": "https://i.ytimg.com/vi/vB1cD6eF3gH/hqdefault.jpg"
}
]
}
}完整的参数与响应参考:这个接口的每个字段、类型和示例。
参考
一个请求,一种响应结构。
你发送的每个字段和收到的每个字段,都附有真实示例。
最近验证于 2026-11-14 · 可用率和延迟按 30d 统计
请求体
JSON,POST 到这个接口。
- channelIdstring
YouTube 频道 ID。
- cursorstring
上一次响应返回的续传令牌,用于分页。
- handlestring
@pixelforgegg
YouTube 频道用户名。
- requireFieldsarray
可选;省略时路由不变,由最便宜的数据源处理。列出本次请求必须能返回的输出字段,例如 `lengthText`,请求就只会由能返回全部这些字段的数据源处理。未列出的字段,只要处理请求的数据源有,仍会照常返回。这可能提高你的价格:最便宜的数据源无法返回某个列出的字段时,会改由更贵的数据源处理,并按它的价格报价和扣费。如果某个直播确实没有某个列出的字段,该字段仍可能缺失。如果列出的字段组合没有任何单一数据源能同时返回,请求会作为无效输入被拒绝,不扣费。在分页遍历中,它只作用于第一页;后续页面沿用该页选定的数据源,按当时的报价计费。
响应
JSON,每个字段一个示例值。
Populated whenever the provider has data for the entity.
- idstring
kQ7mZ2vT8pL
Populated whenever the provider has data for the entity.
- imagestring
https://i.ytimg.com/vi/kQ7mZ2vT8pL/hqdefault.jpg
URL of the live stream thumbnail image, tracking query parameters stripped.
- lengthTextstring可设为必填
3:12:08
Stream length as YouTube shows it, such as 3:29:31, or LIVE while it is streaming; null when the serving source does not report it.
- publishedTimestring
Streamed 4 hours ago
Populated whenever the provider has data for the entity.
- titlestring
RANKED GRIND to Diamond - road to top 500 !builds !coach
Populated whenever the provider has data for the entity.
- urlstring
https://www.youtube.com/watch?v=kQ7mZ2vT8pL
Populated whenever the provider has data for the entity.
- viewsinteger
3140
Views of a past stream, or people watching a stream that is live now. Every source reads it from YouTube's rounded label ("60K watching" is 60000), so it is approximate.
- nextCursorstring
Eg0SC1BpeGVsZm9yZ2UxQoABAQ
Opaque cursor for the next page of live streams, or null when this lane has no more. Pass it back as cursor to continue.
- foundboolean
true
- reason"not_found"
Present only when `found` is false, and says why there is no result. `not_found`: the source states the target does not exist, or returned nothing for it. A `found: false` answer is a successful call, not an error, and `costUsd` is what it actually cost.
常见问题
关于 YouTube 频道直播 API
AnyAPI 的 YouTube 频道直播 API 只需一次 POST 请求 /v1/run/youtube.channel_lives,就以统一格式的 JSON 返回 YouTube 数据。按用户名或频道 ID 列出 YouTube 频道正在进行和已结束的直播,支持游标分页(标题、观看次数、时长、发布时间)。AnyAPI 会在 2 个数据源之间路由每个请求,某个数据源失败时自动切换。费用:每千次请求 US$1.20 起,以美元计价,无需订阅,也没有每月最低消费。过去 30 天,通过 AnyAPI 发起的 YouTube 频道直播 API 调用中有 100.0% 成功,响应时间中位数为 1.1 秒,共测量 1,266 次调用。