YouTube 视频转录文本 API
按 URL 或 ID 获取视频或 Short 的字幕转录文本,每个片段都带有开始和结束时间戳。
US$0.90/千次请求,按请求付费,无需订阅。
Transcript
{"start": 18.2,"end": 21,"text": "Never gonna give you up","durationSeconds": number,"startSeconds": number}
价格与服务商
YouTube 视频转录文本 API 价格:一个 API,5 个可互换的服务商
最便宜的服务商优先响应。如果它失败,下一个会在同一次调用中接手。
参考
一个请求,一种响应结构。
你发送的每个字段和收到的每个字段,都附有真实示例。
最近验证于 2026-11-14 · 可用率和延迟按 30d 统计
请求体
JSON,POST 到这个接口。
- idstring
YouTube 视频 ID。Short 与其他视频一样使用视频 ID。
- urlstring
https://www.youtube.com/watch?v=dQw4w9WgXcQ
Full YouTube video URL carrying the video id. Shorts (youtube.com/shorts/...), youtu.be, live, and embed URLs all work. A link without the video id, such as https://www.youtube.com/watch?v= or a channel link, is refused as invalid input, with no charge; send the video's link or its id instead.
响应
JSON,每个字段一个示例值。
- languagestring
en
Populated whenever the provider has data for the entity.
- transcriptstring
Populated whenever the provider has data for the entity.
Timed transcript segments in source order when the serving lane supplies caption timing.
- durationSecondsnumber
Segment duration in seconds.
- startSecondsnumber
Segment start offset in seconds.
- textstring
Never gonna give you up
Text of this transcript segment.
- foundboolean
true
- reason"not_found"
Present only when `found` is false, and says why there is no result. `not_found`: the source states the target does not exist, or returned nothing for it. A `found: false` answer is a successful call, not an error, and `costUsd` is what it actually cost.
常见问题
关于 YouTube 视频转录文本 API
AnyAPI 的 YouTube 视频转录文本 API 只需一次 POST 请求 /v1/run/youtube.video_transcript,就以统一格式的 JSON 返回 YouTube 数据。按 URL 或 ID 获取视频或 Short 的字幕转录文本,每个片段都带有开始和结束时间戳。AnyAPI 会在 5 个数据源之间路由每个请求,某个数据源失败时自动切换。费用:每千次请求 US$0.90 起,以美元计价,无需订阅,也没有每月最低消费。过去 30 天,通过 AnyAPI 发起的 YouTube 视频转录文本 API 调用中有 100.0% 成功,响应时间中位数为 7.2 秒,共测量 272,699 次调用。