1.4 KiB
1.4 KiB
title, type, tags, last_updated
| title | type | tags | last_updated | ||||
|---|---|---|---|---|---|---|---|
| YouTube Data API v3 | concept |
|
2026-04-23 |
Overview
YouTube Data API v3 是 Google 官方提供的 YouTube 编程接口,允许开发者通过 API Key 访问 YouTube 频道、视频、播放列表等数据,是解决 YouTube 爬虫限制的最稳定方案。
Key Capabilities
- 获取频道信息(标题、描述、缩略图)
- 获取频道最新视频列表
- 获取播放列表内容
- 免费额度: 每月 10,000 单位(足够个人用户正常使用)
How to Get API Key
- 访问 Google Cloud Console
- 创建新项目,命名如
My-RSSHub - 启用 YouTube Data API v3
- 在「凭据」页面创建 API 密钥
- (推荐)为密钥设置 API 限制,仅允许 YouTube Data API v3
Usage in This Wiki
- RSSHub 通过
YOUTUBE_KEY环境变量使用此 API 稳定获取 YouTube 频道更新 - 配合本地 HTTP 代理(
HTTP_PROXY)可在容器内绕过网络限制
Security Best Practice
- 为 API Key 设置 HTTP 来源限制(Referrer Restrictions)
- 仅在 YouTube Data API v3 中启用该密钥,防止 Key 泄露后被滥用
Connections
- RSSHub ← requires ← YouTube Data API v3
- YouTube Content Pipeline ← uses ← YouTube Data API v3
Aliases
- YouTube API
- YouTube Data API
- YouTube Data API v3
- YOUTUBE_KEY