接口说明

YouTube Home API 获取 YouTube 主页资料及首屏作品数据。

使用 Pangolinfo API Key 调用,返回结构化 JSON 数据。

请求URL

POST https://scrapeapi.pangolinfo.com/api/v1/social/youtube-home

请求头

参数名参数值类型说明
Content-Typeapplication/jsonstring数据格式
AuthorizationBearer xxxstring认证凭证

采集最长约75秒,客户端超时建议设为90秒。

请求参数

参数必填类型说明
targetYesstring主页链接; 也可直接传频道 id (UC…) 或 @handle
optionsNoobject仅处理下列开放参数;未列出的字段忽略,内部参数不可覆盖。

options 参数说明

参数必填类型说明
tabNostring作品 tab, 默认按 URL 或 videos;可选值:videos / shorts / streams / playlists / featured / home
可用值: [“videos”, “shorts”, “streams”, “playlists”, “featured”, “home”]
includeAboutNoboolean额外拉 about 面板 (简介 / 国家 / 链接), 默认 true
includeFeaturedNoboolean额外拉首页 tab: profile.featured = {trailer 预告片, channels 精选频道, shelves 首页货架}; 默认 false

仅处理本页列出的请求参数,其他字段忽略。分页游标原样传回,不编码、解码或转换格式。

附带首屏作品;更多作品请使用对应作品接口(如提供)。

响应值

返回值类型说明
codeinteger状态码,0 表示成功
messagestring响应信息,成功时为 ok
pointCostnumber本次请求实际消耗的积点
dataobject返回数据,结构见下表
metaobject请求标识及耗时(毫秒)
billingobject计费条数、单价及规则版本

返回参数 data 说明

返回值类型说明
typestringType
可用值: [“home”]
profileobjectProfile
worksobject[]作品 (默认 videos tab, URL 或 options.tab 指定)
paginationobject作品分页

data.profile 字段说明

返回值类型说明
avatarstring | null头像
nicknamestring | null频道名
handlestring | null@handle
accountIdstring | null频道 id
channelIdstring | null频道 id (同 accountId)
profileUrlstring频道链接
verifiedboolean是否认证
subscribernumber | null订阅数
videosnumber | null视频数
playnumber | null总播放数
introTextstring | null简介
biostring | null简介 (同 introText)
countrystring | null国家 / 地区
registerTimeobject注册时间
linksobject[]频道外链
externalLinksstring[]外链地址
businessEmailstring | null商务邮箱; 匿名需人机验证, 通常为 null
contactEmailstring | null同 businessEmail
businessEmailRequiresLoginboolean | null商务邮箱是否需要登录查看
keywordsstring | null频道关键词 (空格分隔)
familySafeboolean | null是否适合家庭
unlistedboolean | null是否不公开
bannerobject[]横幅图各尺寸
tabsobject[]频道 tab 列表
hasPodcastsboolean是否有 Podcasts tab
featuredobject | null频道首页内容; 只有 options.includeFeatured 才有, 取不到为 null
targetUrlstring请求的链接
tabstring作品取自哪个 tab: videos / shorts / streams / playlists …

data.profile.registerTime 字段说明

返回值类型说明
textstring | null原文, 如 Joined Jun 3, 2008
timestampnumber | null毫秒时间戳

data.profile.links[] 字段说明

返回值类型说明
titlestring | null链接标题
urlstring | null链接
faviconstring | null图标

data.profile.banner[] 字段说明

返回值类型说明
urlstringUrl
widthnumber宽
heightnumber高

data.profile.tabs[] 字段说明

返回值类型说明
titlestring | nulltab 名
urlstring | nulltab 链接
返回值类型说明
trailerobject | null频道预告片
channelsobject[]首页推荐的其他频道
shelvesobject[]首页各货架 (热门视频 / 直播 / 播放列表 …)

data.works[] 字段说明

返回值类型说明
workIdstring | null作品 id (视频 id / 播放列表 id)
videoIdstring | null视频 id; 播放列表为 null
workTypestring作品类型
可用值: [“video”, “short”, “playlist”, “lockup”]
kindstring同 workType
可用值: [“video”, “short”, “playlist”, “lockup”]
urlstring | null链接
titlestring | null标题
thumbnailstring | null封面 (最大尺寸)
coverstring | null封面 (同 thumbnail)
viewsnumber | null播放数 (由文案解析, 如 1.2M → 1200000)
publishTimestring | null发布时间文案, 如 7 days ago; Shorts 没有
durationTextstring | null时长文案, 如 9:18; Shorts 没有
durationSecnumber | null时长 (秒); Shorts 没有
playlistIdstring | null播放列表 id; 视频为 null
contentIdstring | null上游内容 id
contentTypestring | null上游内容类型, 如 LOCKUP_CONTENT_TYPE_VIDEO
channelIdstring | null所属频道 id (推荐视频才有; 频道自己的作品为 null)
channelHandlestring | null所属频道 @handle
channelNamestring | null所属频道名 (推荐视频的第一行文案; 直播预告可能是 “12 waiting”)
accessibilityTextstring | null仅 Shorts: 无障碍描述

data.pagination 字段说明

返回值类型说明
cursorstring | null下一页游标, 传回 options.cursor 续取
hasMoreboolean是否还有更多

请求示例

curl --request POST \
  --url https://scrapeapi.pangolinfo.com/api/v1/social/youtube-home \
  --header 'Authorization: Bearer YOUR_PANGOLINFO_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "target": "https://www.youtube.com/@NASA"
}'

返回示例

下例截取实际响应中的首条列表记录,长文本与链接作了缩写;pointCost 为该次完整响应的实际费用。完整字段结构可在在线调试页查看。

{
  "code": 0,
  "message": "ok",
  "pointCost": 0.8,
  "data": {
    "type": "home",
    "profile": {
      "avatar": "https://yt3.googleusercontent.com/eIf5fNPcIcj9ig-wZBeq4stFy1lgjWTW1nLT5dYlFkHZprZ03QBiMcbpwNMB6XSBjrSFGtAGQg=s160-c-k-c0x00ffffff-no-rj",
      "nickname": "NASA",
      "handle": "@NASA",
      "accountId": "UCLA_DiR1FfKNvjuUpBHmylQ",
      "channelId": "UCLA_DiR1FfKNvjuUpBHmylQ",
      "profileUrl": "https://www.youtube.com/channel/UCLA_DiR1FfKNvjuUpBHmylQ",
      "verified": false,
      "subscriber": 15100000,
      "videos": 6197,
      "play": 1134128588,
      "introText": "NASA's mission is to pioneer the future in space exploration, scientific discovery, and aeronautics research.\r\n\r\nTo do that, we have worked around the world—...",
      "bio": "NASA's mission is to pioneer the future in space exploration, scientific discovery, and aeronautics research.\r\n\r\nTo do that, we have worked around the world—...",
      "country": null,
      "registerTime": {
        "text": "Joined Jun 3, 2008",
        "timestamp": 1212451200000
      },
      "links": [
        {
          "title": "nasa.gov",
          "url": "https://www.nasa.gov",
          "favicon": "https://encrypted-tbn2.gstatic.com/favicon-tbn?q=tbn:ANd9GcSEKV8ZD6yVWabVEXRkx3en2yMjBGOWYRwKz_2GeVQL8u7Z_wXyXxdXJOcDzImKp4wMt3pvXoHEtR1VRjHwEpxQgJiowW_JG9Mq..."
        }
      ],
      "externalLinks": [
        "https://www.nasa.gov"
      ],
      "businessEmail": null,
      "contactEmail": null,
      "businessEmailRequiresLogin": false,
      "keywords": "nasa space iss shuttle 50th astronauts planets earth rockets hubble telescopes NASA TV galaxy apollo gemini mercury sta Moon Artemis \"solar system\"",
      "familySafe": true,
      "unlisted": false,
      "banner": [
        {
          "url": "https://yt3.googleusercontent.com/y8Srh-oCcilLvBO8jAPI546m1bn0puA5DIvQiBZ1cSxc_rZfKxKSFlTCtoCQCtB6viUf1NGsaQ=w1060-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-n...",
          "width": 1060,
          "height": 175
        }
      ],
      "tabs": [
        {
          "title": "Home",
          "url": "https://www.youtube.com/@NASA/featured"
        }
      ],
      "hasPodcasts": true,
      "targetUrl": "https://www.youtube.com/@NASA",
      "tab": "videos"
    },
    "works": [
      {
        "workId": "Zezt6EsG9WE",
        "videoId": "Zezt6EsG9WE",
        "playlistId": null,
        "contentId": "Zezt6EsG9WE",
        "contentType": "LOCKUP_CONTENT_TYPE_VIDEO",
        "workType": "video",
        "kind": "video",
        "url": "https://www.youtube.com/watch?v=Zezt6EsG9WE",
        "title": "NASA Moon Base: Rovers and Lunar Terrain Vehicles (October 2026 Update)",
        "thumbnail": "https://i.ytimg.com/vi/Zezt6EsG9WE/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLD89hXnM_XZRxc5qbhG2g_q050geQ",
        "cover": "https://i.ytimg.com/vi/Zezt6EsG9WE/hq720.jpg?sqp=-oaymwEcCNAFEJQDSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLD89hXnM_XZRxc5qbhG2g_q050geQ",
        "views": 1000000,
        "publishTime": "2 weeks ago",
        "durationText": "9:18",
        "durationSec": 558,
        "channelId": null,
        "channelHandle": null,
        "channelName": null
      }
    ],
    "pagination": {
      "cursor": null,
      "hasMore": true
    }
  },
  "meta": {
    "requestId": "pg-audit-r1-youtube-home-1793954295679869400",
    "durationMs": 25011
  },
  "billing": {
    "unitPrice": 0.8,
    "ruleVersion": "social-primary-v2",
    "billedCount": 1,
    "pointCost": 0.8
  }
}

积点消耗说明

每份主页资料消耗 0.8 积点,附带作品免费。

空结果、失败响应不扣费。同一响应中相同 ID 只计一次,独立调用和续页分别计费。详见 社媒评论 API 计费说明。

在线调试