获取视频详情 /Get video information

YouTubeapi

About

获取视频详情 /Get video information

Documentation

获取视频详情 /Get video information

[中文]

用途:

  • 获取YouTube视频详情信息
  • 返回原始完整数据(包含 playerResponse 和 initialData)

参数详解:

📌 必选参数:

video_id (string)

  • 作用: 视频ID
  • 获取方式: 从视频URL中提取,例如 https://www.youtube.com/watch?v=oaSNBz4qMQY,video_id 就是 oaSNBz4qMQY
  • 示例: "oaSNBz4qMQY"

⚙️ 可选参数:

language_code (string, 可选)

  • 作用: 设置语言偏好
  • 默认值: "zh-CN"
  • 可用值: "zh-CN", "en-US", "ja-JP", "ko-KR"

返回数据结构:

{
  "playerResponse": {
    "videoDetails": {},
    "streamingData": {
      "formats": [],
      "adaptiveFormats": []
    },
    "microformat": {},
    ...
  },
  "initialData": {
    "contents": {
      "twoColumnWatchNextResults": {
        "results": {
          "results": {
            "contents": [
              {
                "videoPrimaryInfoRenderer": {...},
                "videoSecondaryInfoRenderer": {...}
              }
            ]
          }
        }
      }
    },
    ...
  }
}

主要字段说明:

  • playerResponse: YouTube 播放器响应数据
    • videoDetails: 视频基本信息(可能为空,取决于YouTube的返回)
    • streamingData: 视频流数据(包含 formats 和 adaptiveFormats,包含 googlevideo.com 的URL)
    • microformat: 元数据信息
  • initialData: YouTube 页面初始化数据
    • videoPrimaryInfoRenderer: 主要信息(标题、观看次数、点赞数等)
    • videoSecondaryInfoRenderer: 次要信息(频道信息、描述等)

[English]

Purpose:

  • Get YouTube video details
  • Returns raw complete data (includes playerResponse and initialData)

Parameters:

📌 Required:

video_id (string)

  • Purpose: Video ID
  • How to get: Extract from video URL, e.g., https://www.youtube.com/watch?v=oaSNBz4qMQY, video_id is oaSNBz4qMQY
  • Example: "oaSNBz4qMQY"

⚙️ Optional:

language_code (string, optional)

  • Purpose: Set language preference
  • Default: "zh-CN"
  • Values: "zh-CN", "en-US", "ja-JP", "ko-KR", etc.

Response Structure:

{
  "playerResponse": {
    "videoDetails": {},
    "streamingData": {
      "formats": [],
      "adaptiveFormats": []
    },
    "microformat": {},
    ...
  },
  "initialData": {
    "contents": {
      "twoColumnWatchNextResults": {
        "results": {
          "results": {
            "contents": [
              {
                "videoPrimaryInfoRenderer": {...},
                "videoSecondaryInfoRenderer": {...}
              }
            ]
          }
        }
      }
    },
    ...
  }
}

Key Fields:

  • playerResponse: YouTube player response data
    • videoDetails: Basic video info (may be empty depending on YouTube's response)
    • streamingData: Video stream data (includes formats and adaptiveFormats with googlevideo.com URLs)
    • microformat: Metadata information
  • initialData: YouTube page initialization data
    • videoPrimaryInfoRenderer: Primary info (title, view count, like count, etc.)
    • videoSecondaryInfoRenderer: Secondary info (channel info, description, etc.)

[示例/Examples]

获取视频详情数据 / Get video details

GET /youtube_web/get_video_info?video_id=oaSNBz4qMQY

指定语言 / Specify language

GET /youtube_web/get_video_info?video_id=oaSNBz4qMQY&language_code=en-US

Imported from a validated TikHub OpenAPI document. Pricing must be reviewed before enabling.

Try 获取视频详情 /Get video information

Test this model in the Sandbase Playground with your own prompts.

Open in Playground

Related Models