YouTube-Web-V2-API

获取视频字幕异步任务结果/Get video captions async job result

Changed on

[中文]

用途:

  • 查询字幕异步任务的处理结果
  • 视频较大时 /get_video_captions 会返回 status="processing" 和 job_id, 用该 job_id 调用本接口即可获取最终字幕
  • 本接口为单次查询、不阻塞等待,由调用方按需重复调用直到任务完成

参数:

  • job_id: 异步任务ID(由 /get_video_captions 返回)
  • format: 字幕格式(仅任务完成时生效)
    • srt: SubRip 字幕格式(带时间轴)
    • xml: XML 格式
    • json3: JSON 格式
    • txt: 纯文本(无时间轴)

返回数据:

处理中:

{ "job_id": "123e4567-e89b-12d3-a456-426614174000", "status": "queued" }
  • status 为 queued(排队中)或 active(处理中),稍后重试即可

已完成:

{
  "job_id": "123e4567-e89b-12d3-a456-426614174000",
  "status": "completed",
  "language_code": "en",
  "language_name": "English",
  "format": "srt",
  "content": "<字幕内容>",
  "available_languages": ["en", "ja"]
}

注意事项:

  • 任务失败时返回错误
  • 建议轮询间隔 2-5 秒(本接口有 RPS 限制,请勿高频轮询)
  • job_id 仅创建它的账号可查询,他人查询返回 403

价格:

  • 免费($0 USD / 请求)

[English]

Purpose:

  • Get the result of an asynchronous caption job
  • For large videos, /get_video_captions returns status="processing" with a job_id; use that job_id here to retrieve the final captions
  • Single-shot, non-blocking query; poll it until the job completes

Parameters:

  • job_id: Async job ID (returned by /get_video_captions)
  • format: Caption format (applies only when the job is completed)
    • srt: SubRip subtitle format (with timestamps)
    • xml: XML format
    • json3: JSON format
    • txt: Plain text (no timestamps)

Returns:

Processing:

{ "job_id": "123e4567-e89b-12d3-a456-426614174000", "status": "queued" }
  • status is queued or active; retry later

Completed:

{
  "job_id": "123e4567-e89b-12d3-a456-426614174000",
  "status": "completed",
  "language_code": "en",
  "language_name": "English",
  "format": "srt",
  "content": "<caption content>",
  "available_languages": ["en", "ja"]
}

Notes:

  • Returns an error if the job failed
  • Recommended polling interval: 2-5 seconds (this endpoint is rate-limited, please do not poll aggressively)
  • A job_id may only be queried by the account that created it; others get 403

Price:

  • Free ($0 USD / request)

[示例/Example]

GET /get_video_captions_result?job_id=123e4567-e89b-12d3-a456-426614174000&format=srt

get/api/v1/youtube/web_v2/get_video_captions_result

Request

  • Base URL
    https://api.tikhub.io (the document declares no server; this is the origin it was published from)
  • Auth
    HTTP bearer

Query parameters

job_idstring required

异步任务ID/Async job ID

format'srt' | 'xml' | 'json3' | 'txt'

字幕格式/Caption format

Response

Successful Response

codeinteger

HTTP status code | HTTP状态码

request_idstring nullable

Unique request identifier | 唯一请求标识符

messagestring

Response message (EN-US) | 响应消息 (English)

message_zhstring

Response message (ZH-CN) | 响应消息 (中文)

supportstring

Support message | 支持消息

timestring

The time the response was generated | 生成响应的时间

time_stampinteger

The timestamp the response was generated | 生成响应的时间戳

time_zonestring

The timezone of the response time | 响应时间的时区

docsstring nullable

Link to the API Swagger documentation for this endpoint | 此端点的 API Swagger 文档链接

cache_messagestring nullable

Cache message (EN-US) | 缓存消息 (English)

cache_message_zhstring nullable

Cache message (ZH-CN) | 缓存消息 (中文)

cache_urlstring nullable

The URL to access the cached result | 访问缓存结果的 URL

routerstring

The endpoint that generated this response | 生成此响应的端点

paramsunknown
dataunknown

Changes