获取视频详情 V2/Get video information V2
Changed on[中文]
用途:
- 获取 YouTube 视频详情(备用获取路径,字段提取更稳定)
- 适用场景: v1 /get_video_info 返回 title/author 为空时 (年龄限制、未公开、部分音乐视频等)
下载与代理:
- 调用本详情接口无需自带代理,也不接受 proxy_url;原始数据中即使有媒体 URL, 也不保证可从不同公网出口下载。
- 下载请使用 get_video_streams_v3:首选固定出口或粘性会话的美国住宅代理, 或固定公网出口的静态住宅/ISP 代理;数据中心代理不作为首选。 美国并非强制地区,地区受限视频应选择允许访问的国家/地区并保持同一下载出口。
参数详解:
📌 必选参数(二选一):
video_id (string)
- 作用: 视频ID
- 示例: "dQw4w9WgXcQ"
video_url (string)
- 作用: 视频URL(如果提供 video_id 则忽略此参数)
- 示例: "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
⚙️ 可选参数:
need_format (bool, 可选)
- 作用: 是否返回清洗后的字段字典
- 默认值: True
- True: 返回精简的字段字典(title / author / view_count 等)
- False: 返回完整原始数据
与 get_video_info 的区别:
- get_video_info: 字段更全(含 like_count_text / merchandise / endscreen / super_title / subscriber_count_text / is_verified 等),但部分场景下字段提取不稳定
- get_video_info_v2 (本接口): 核心字段更稳定,但 v1 独有的部分附加字段不再返回
返回字段(need_format=True):
- 视频: video_id / video_url / embed_url / title / description
- 频道: author / channel_name / channel_id / channel_handle / channel_url / channel_follower_count / channel_is_verified
- 时间与状态: publish_date / published_at / upload_date / length_seconds / duration_string / availability / live_status / age_limit
- 互动与分类: view_count / like_count / comment_count / rating / keywords / categories / language
- 媒体辅助: thumbnail_url / thumbnails / playability_status / captions / caption_count / chapters
[English]
Purpose:
- Fetch YouTube video details via an alternative extraction path (more stable field extraction)
- Use when v1 /get_video_info returns empty title/author (age-gated, unlisted, music videos, etc.)
Download and proxy:
- No proxy is required from you to call this detail endpoint, and it does not accept proxy_url. Media URLs in raw data, if any, are not guaranteed to download from a different public exit.
- For downloading, use get_video_streams_v3. Prefer a US residential proxy with a fixed exit or sticky session, or a static residential/ISP proxy with a fixed public exit; datacenter proxies are not the first choice. The US is not mandatory: choose a region where the video is available and keep the same actual exit for downloading.
Parameters:
📌 Required (one of):
video_id (string) - Video ID, e.g. "dQw4w9WgXcQ"
video_url (string) - Full video URL (ignored if video_id provided)
⚙️ Optional:
need_format (bool) - Whether to return cleaned payload. Default True
Difference from get_video_info:
- get_video_info: Richer field set (like_count_text / merchandise / endscreen / super_title / subscriber_count_text / is_verified, etc.), but less stable extraction in some scenarios
- get_video_info_v2 (this): More stable core fields, drops v1-only ancillary fields
Return fields (need_format=True):
Video identity, channel details, publish and duration values, availability and live status, engagement counts, categories, thumbnails, captions, and chapters.
[示例/Examples]
通过 video_id 获取 / Fetch by video_id
GET /youtube_web/get_video_info_v2?video_id=dQw4w9WgXcQ
通过 video_url 获取 / Fetch by video_url
GET /youtube_web/get_video_info_v2?video_url=https://www.youtube.com/watch?v=dQw4w9WgXcQ
返回原始数据 / Return raw payload
GET /youtube_web/get_video_info_v2?video_id=dQw4w9WgXcQ&need_format=false
Request
- Base URLhttps://api.tikhub.io (the document declares no server; this is the origin it was published from)
- AuthHTTP bearer
Query parameters
视频ID/Video ID
视频URL/Video URL (如果提供 video_id 则忽略此参数)
是否需要清洗数据,提取关键字段/Whether to return cleaned payload
Response
Successful Response
Changes
- info
added the optional property
//to the response with the status - info
added the optional property
//to the response with the status
- info
- info
endpoint added
- info