API 文档

YouTube 视频详情 API

YouTube 视频详情 API,支持真实 JSON 示例与在线测试;空结果和失败免费。

测试 API

YouTube 视频详情 API 查询公开业务数据,支持 URL 优先输入、真实 JSON 示例与在线测试。

打开产品页与 API Tester

接口与鉴权

POST https://api.goanyapi.com/api/v1/youtube/video/detail

同步返回,无任务和轮询。使用 API Key 或受支持的 OAuth Bearer 凭证;没有 Path 或 Query 参数。

输入参数

参数 位置 类型 必填 默认值 范围与说明
Authorization Header string 是 — Bearer YOUR_API_KEY
Content-Type Header string 是 application/json application/json
url JSON body string 是 — 优先输入完整 HTTPS 视频链接,兼容 11 位视频 ID;支持 watch?v=、youtu.be/、shorts、embed、live 和 v 路径。 pattern: ^(?:[A-Za-z0-9_-]{11}|https://(?:(?:www.|m.)?youtube.com/(?:watch?[^\s]v=[A-Za-z0-9_-]{11}[^\s]|(?:shorts|embed|live|v)/[A-Za-z0-9_-]{11}/?(?:[?#][^\s])?)|(?:www.)?youtu.be/[A-Za-z0-9_-]{11}/?(?:[?#][^\s])?))$ minLength: 1

输出字段

字段 类型 说明
code string 成功为 ok,失败为公开错误码
message string 状态说明
data.result object / null 公开业务结果;空值与缺失按实际结果保留
data.creditsUsed integer 当前配置对应的实际扣费;空结果为 0
data.remainingCredits number 结算后余额
data.result.videoId string 实际业务字段;可为空或缺失,文本计数不是精确整数
data.result.title string 实际业务字段;可为空或缺失,文本计数不是精确整数
data.result.description string 实际业务字段;可为空或缺失,文本计数不是精确整数
data.result.playabilityStatus string 实际业务字段;可为空或缺失,文本计数不是精确整数
data.result.duration number 视频时长,秒
data.result.viewCount number 实际业务字段;可为空或缺失,文本计数不是精确整数
data.result.publishDate string 实际业务字段;可为空或缺失,文本计数不是精确整数
data.result.likeCount string 实际业务字段;可为空或缺失,文本计数不是精确整数
data.result.keywords array 实际业务字段;可为空或缺失,文本计数不是精确整数
data.result.isLive boolean 实际业务字段;可为空或缺失,文本计数不是精确整数
data.result.channel object 实际业务字段;可为空或缺失,文本计数不是精确整数
data.result.channel.id string 实际业务字段;可为空或缺失,文本计数不是精确整数
data.result.channel.name string 实际业务字段;可为空或缺失,文本计数不是精确整数
data.result.thumbnail string 实际业务字段;可为空或缺失,文本计数不是精确整数

本接口不支持分页,不接受 cursor。列表长度是本次实际返回条数,不是全部记录总数。

请求示例

curl -X POST 'https://api.goanyapi.com/api/v1/youtube/video/detail' -H 'Authorization: Bearer YOUR_API_KEY' -H 'Content-Type: application/json' --data '{"url":"https://www.youtube.com/watch?v=Y334D183ofE"}'

真实响应示例

下列示例来自真实请求;仅省略实时 data.creditsUsed 与 data.remainingCredits。媒体和字幕 URL 可能已过期。

{
  "code": "ok",
  "message": "ok",
  "data": {
    "result": {
      "videoId": "Y334D183ofE",
      "title": "Jensen Huang: The Man Behind NVIDIA (April 2026)",
      "description": "Jensen Huang spent 33 years building Nvidia into one of the most valuable companies of all time. But when Guy Raz asked whether he'd do it all over again, his answer was surprising: no.\n\nIn this unusually personal conversation, recorded in April 2026, Jensen opens up about the family moments he missed, the stress and \"humiliation\" of building Nvidia, and why he finds it painful to look back on his life. He also reflects on his childhood, his demanding approach to leadership, the enormous gamble that put Nvidia at the center of the AI revolution, his disagreements with those warning about AI's dangers, and the possibility of conflict between China and Taiwan.\n\nNote: This interview was recorded before revelations involving Jensen's personal life and national security concerns emerged. Jensen resigned Nvidia's CEO in November 2026. Those developments are not discussed here.\n\nSubscribe to How I Built This:    / @howibuiltthis  \n\n00:00:00 - Introduction\n00:01:17 - Why Jensen wouldn't build NVIDIA again\n00:06:15 - The personal cost of success: family and sacrifice\n00:12:58 - Jensen's childhood and journey to America\n00:24:50 - Taking the leap to start NVIDIA\n00:30:35 - NVIDIA's early failures and near-collapse\n00:36:53 - The gamble on CUDA and the rise of AI\n01:09:03 - Jensen on AI fears and the future of work\n01:18:42 - China, Taiwan, and the risk of conflict\n\n#HowIBuiltThis #JensenHuang #Nvidia #GuyRaz #AI #ArtificialIntelligence #Entrepreneurship #BusinessPodcast\n\nABOUT HOW I BUILT THIS\nOn How I Built This, Guy Raz interviews the world's best-known entrepreneurs to learn how they built their iconic brands.\nSubscribe to the channel for more conversations with the founders behind the world's most successful companies.\n\nLISTEN TO HOW I BUILT THIS\nApple Podcasts: https://podcasts.apple.com/us/podcast...\nSpotify: https://open.spotify.com/show/6E709HR...\n\nFOLLOW HOW I BUILT THIS\nInstagram:   / howibuiltthis  \nFacebook:   / howibuiltthis  \nX: https://x.com/howibuiltthis\n\nFOLLOW GUY RAZ\nInstagram:   / guy.raz  \nWebsite: https://guyraz.com/\n\nHow I Built This is produced by Podcast Pointman and part of the Vox Media Podcast Network.",
      "playabilityStatus": "UNPLAYABLE",
      "duration": 5239,
      "viewCount": 117783,
      "publishDate": "2026-11-12",
      "likeCount": "1.1K",
      "keywords": [
        "How I Built This",
        "How I Built This with Guy Raz",
        "Guy Raz",
        "Guy Roz",
        "Guy Rass",
        "HIBT",
        "How I Build This",
        "business podcast",
        "entrepreneur podcast",
        "entrepreneurship",
        "founder stories",
        "founder interview",
        "startup stories",
        "how to start a business",
        "how to grow a business"
      ],
      "isLive": false,
      "channel": {
        "id": "UCpgddymxIIzX914mF6BnzzQ",
        "name": "How I Built This"
      },
      "thumbnail": "https://i.ytimg.com/vi/Y334D183ofE/hqdefault.jpg"
    }
  }
}

计费与状态码

…

每个接口独立读取数据库价格;仅非空成功结果收费,空结果和失败免费,每页单独结算。可选标题、描述缺失不影响有效记录。媒体接口无视频与字幕时为空。

HTTP 含义
200 查询完成,可能为空
400 JSON 或参数不合法
401 鉴权失败
402 积分不足
429 请求过于频繁,遵循 Retry-After
502 数据请求失败
503 接口或价格尚未配置