YouTube
YouTube Home API
获取 YouTube 主页资料及首屏作品数据。
接口说明
YouTube Home API 获取 YouTube 主页资料及首屏作品数据。
使用 Pangolinfo API Key 调用,返回结构化 JSON 数据。
请求URL
请求头
| 参数名 | 参数值 | 类型 | 说明 |
|---|---|---|---|
| Content-Type | application/json | string | 数据格式 |
| Authorization | Bearer xxx | string | 认证凭证 |
采集最长约75秒,客户端超时建议设为90秒。
请求参数
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
| target | Yes | string | 主页链接; 也可直接传频道 id (UC…) 或 @handle |
| options | No | object | 仅处理下列开放参数;未列出的字段忽略,内部参数不可覆盖。 |
options 参数说明
| 参数 | 必填 | 类型 | 说明 |
|---|---|---|---|
| tab | No | string | 作品 tab, 默认按 URL 或 videos;可选值:videos / shorts / streams / playlists / featured / home 可用值: [“videos”, “shorts”, “streams”, “playlists”, “featured”, “home”] |
| includeAbout | No | boolean | 额外拉 about 面板 (简介 / 国家 / 链接), 默认 true |
| includeFeatured | No | boolean | 额外拉首页 tab: profile.featured = {trailer 预告片, channels 精选频道, shelves 首页货架}; 默认 false |
仅处理本页列出的请求参数,其他字段忽略。分页游标原样传回,不编码、解码或转换格式。
附带首屏作品;更多作品请使用对应作品接口(如提供)。
响应值
| 返回值 | 类型 | 说明 |
|---|---|---|
| code | integer | 状态码,0 表示成功 |
| message | string | 响应信息,成功时为 ok |
| pointCost | number | 本次请求实际消耗的积点 |
| data | object | 返回数据,结构见下表 |
| meta | object | 请求标识及耗时(毫秒) |
| billing | object | 计费条数、单价及规则版本 |
返回参数 data 说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| type | string | Type 可用值: [“home”] |
| profile | object | Profile |
| works | object[] | 作品 (默认 videos tab, URL 或 options.tab 指定) |
| pagination | object | 作品分页 |
data.profile 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| avatar | string | null | 头像 |
| nickname | string | null | 频道名 |
| handle | string | null | @handle |
| accountId | string | null | 频道 id |
| channelId | string | null | 频道 id (同 accountId) |
| profileUrl | string | 频道链接 |
| verified | boolean | 是否认证 |
| subscriber | number | null | 订阅数 |
| videos | number | null | 视频数 |
| play | number | null | 总播放数 |
| introText | string | null | 简介 |
| bio | string | null | 简介 (同 introText) |
| country | string | null | 国家 / 地区 |
| registerTime | object | 注册时间 |
| links | object[] | 频道外链 |
| externalLinks | string[] | 外链地址 |
| businessEmail | string | null | 商务邮箱; 匿名需人机验证, 通常为 null |
| contactEmail | string | null | 同 businessEmail |
| businessEmailRequiresLogin | boolean | null | 商务邮箱是否需要登录查看 |
| keywords | string | null | 频道关键词 (空格分隔) |
| familySafe | boolean | null | 是否适合家庭 |
| unlisted | boolean | null | 是否不公开 |
| banner | object[] | 横幅图各尺寸 |
| tabs | object[] | 频道 tab 列表 |
| hasPodcasts | boolean | 是否有 Podcasts tab |
| featured | object | null | 频道首页内容; 只有 options.includeFeatured 才有, 取不到为 null |
| targetUrl | string | 请求的链接 |
| tab | string | 作品取自哪个 tab: videos / shorts / streams / playlists … |
data.profile.registerTime 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| text | string | null | 原文, 如 Joined Jun 3, 2008 |
| timestamp | number | null | 毫秒时间戳 |
data.profile.links[] 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| title | string | null | 链接标题 |
| url | string | null | 链接 |
| favicon | string | null | 图标 |
data.profile.banner[] 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| url | string | Url |
| width | number | 宽 |
| height | number | 高 |
data.profile.tabs[] 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| title | string | null | tab 名 |
| url | string | null | tab 链接 |
data.profile.featured 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| trailer | object | null | 频道预告片 |
| channels | object[] | 首页推荐的其他频道 |
| shelves | object[] | 首页各货架 (热门视频 / 直播 / 播放列表 …) |
data.works[] 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| workId | string | null | 作品 id (视频 id / 播放列表 id) |
| videoId | string | null | 视频 id; 播放列表为 null |
| workType | string | 作品类型 可用值: [“video”, “short”, “playlist”, “lockup”] |
| kind | string | 同 workType 可用值: [“video”, “short”, “playlist”, “lockup”] |
| url | string | null | 链接 |
| title | string | null | 标题 |
| thumbnail | string | null | 封面 (最大尺寸) |
| cover | string | null | 封面 (同 thumbnail) |
| views | number | null | 播放数 (由文案解析, 如 1.2M → 1200000) |
| publishTime | string | null | 发布时间文案, 如 7 days ago; Shorts 没有 |
| durationText | string | null | 时长文案, 如 9:18; Shorts 没有 |
| durationSec | number | null | 时长 (秒); Shorts 没有 |
| playlistId | string | null | 播放列表 id; 视频为 null |
| contentId | string | null | 上游内容 id |
| contentType | string | null | 上游内容类型, 如 LOCKUP_CONTENT_TYPE_VIDEO |
| channelId | string | null | 所属频道 id (推荐视频才有; 频道自己的作品为 null) |
| channelHandle | string | null | 所属频道 @handle |
| channelName | string | null | 所属频道名 (推荐视频的第一行文案; 直播预告可能是 “12 waiting”) |
| accessibilityText | string | null | 仅 Shorts: 无障碍描述 |
data.pagination 字段说明
| 返回值 | 类型 | 说明 |
|---|---|---|
| cursor | string | null | 下一页游标, 传回 options.cursor 续取 |
| hasMore | boolean | 是否还有更多 |
请求示例
返回示例
下例截取实际响应中的首条列表记录,长文本与链接作了缩写;pointCost 为该次完整响应的实际费用。完整字段结构可在在线调试页查看。
积点消耗说明
每份主页资料消耗 0.8 积点,附带作品免费。
空结果、失败响应不扣费。同一响应中相同 ID 只计一次,独立调用和续页分别计费。详见 社媒评论 API 计费说明。

