YouTube 视频转录文本(完整版) API
获取 YouTube 视频或 Short 的转录文本,包含带时间的片段及其来源:文字是创作者编写的字幕,还是机器语音识别的结果。
US$2.00/千次请求,按请求付费,无需订阅。
Transcript
{"text": "welcome back to the channel today we're going to talk about","startSeconds": 0,"endSeconds": 4.2}
价格与服务商
YouTube 视频转录文本(完整版) API 价格:一个 API,2 个可互换的服务商
最便宜的服务商优先响应。如果它失败,下一个会在同一次调用中接手。
标记为暂停服务的服务商因响应不稳定,已移出轮换,你的调用会转到其他服务商。它恢复稳定响应后会自动重新加入。
试一试
一个请求获取 YouTube 视频转录文本(完整版)
这个示例展示了 25 个字段中的 24 个。查看全部字段
{
"found": true,
"data": {
"transcript": "welcome back to the channel today we're going to talk about how sourdough starters actually work at a chemistry level first let's talk about the flour you use because that changes everything about fermentation speed",
"language": "en",
"isAutoGenerated": false,
"isAiGenerated": null,
"title": "The Science of Sourdough, Explained Simply",
"channel": "Kitchen Chemistry with Owen",
"durationSeconds": 612,
"segments": [
{
"text": "welcome back to the channel today we're going to talk about",
"startSeconds": 0,
"endSeconds": 4.2
},
{
"text": "how sourdough starters actually work at a chemistry level",
"startSeconds": 4.2,
"endSeconds": 9.1
},
{
"text": "first let's talk about the flour you use because that changes",
"startSeconds": 9.1,
"endSeconds": 14.6
},
{
"text": "everything about fermentation speed",
"startSeconds": 14.6,
"endSeconds": 17.8
}
],
"videoId": "nS3oOb6VwJq",
"url": "https://www.youtube.com/watch?v=nS3oOb6VwJq",
"description": "A deep dive into the microbiology and chemistry behind a healthy sourdough starter, with tips for troubleshooting a sluggish rise.",
"views": 341000,
"likes": 18900,
"authorId": "UC5sTr3u6vBzPq8fWdZgX9Lm",
"authorUrl": "https://www.youtube.com/@kitchenchemistrywithowen",
"image": "https://i.ytimg.com/vi/nS3oOb6VwJq/hqdefault.jpg",
"createdUtc": 1757462400,
"keywords": [
"sourdough",
"baking science",
"fermentation"
],
"category": "Education"
}
}完整的参数与响应参考:这个接口的每个字段、类型和示例。
参考
一个请求,一种响应结构。
你发送的每个字段和收到的每个字段,都附有真实示例。
最近验证于 2026-11-14 · 可用率和延迟按 30d 统计
请求体
JSON,POST 到这个接口。
- urlstring
https://www.youtube.com/watch?v=nS3oOb6VwJq
YouTube 视频或 Short 的 URL(例如 "https://www.youtube.com/watch?v=dQw4w9WgXcQ" 或 "https://www.youtube.com/shorts/Fir1x9cw2vg")。
- captionKindenum
接受哪种字幕轨道:"manual" 只接受创作者编写的字幕,"automatic" 只接受 YouTube 的语音识别,"any" 接受现有的任一种。
- languagestring
首选字幕语言代码(例如 "en"、"es")。默认为英语。如果视频没有该语言的字幕,你会得到该视频已有的其他语言的转录文本;结果中的 `language` 字段会说明是哪种语言。将 `captionKind` 设为 "manual" 或 "automatic" 时,不会返回其他语言。
- requireFieldsarray
可选;省略时路由不变,由最便宜的数据源处理。列出本次请求必须能返回的输出字段,例如 `views`,请求就只会由能返回全部这些字段的数据源处理。未列出的字段,只要处理请求的数据源有,仍会照常返回。这可能提高你的价格:最便宜的数据源无法返回某个列出的字段时,会改由更贵的数据源处理,并按它的价格报价和扣费。如果某个转录文本确实没有某个列出的字段,该字段仍可能缺失。如果列出的字段组合没有任何单一数据源能同时返回,请求会作为无效输入被拒绝,不扣费。
响应
JSON,每个字段一个示例值。
- authorIdstring可设为必填
UC5sTr3u6vBzPq8fWdZgX9Lm
YouTube channel ID of the publishing channel.
- authorUrlstring可设为必填
https://www.youtube.com/@kitchenchemistrywithowen
Canonical URL of the publishing channel, tracking query parameters stripped.
- categorystring可设为必填
Education
YouTube category the video is filed under, for example "Music".
- channelstring
Kitchen Chemistry with Owen
Channel name that published the video.
- createdUtcnumber可设为必填
1757462400
UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds.
- descriptionstring可设为必填
A deep dive into the microbiology and chemistry behind a healthy sourdough starter, with tips for troubleshooting a sluggish rise.
Full video description text.
- durationSecondsnumber
612
Video duration in seconds.
- imagestring可设为必填
https://i.ytimg.com/vi/nS3oOb6VwJq/hqdefault.jpg
URL of the video thumbnail image.
- isAiGeneratedboolean
null
True when the words were recognized from the audio by the serving lane rather than read from any YouTube caption track, or null when the serving source does not say.
- isAutoGeneratedboolean
false
True when YouTube generated the caption track by speech recognition rather than the creator supplying it. Automatic captions carry recognition errors, especially on names and jargon. Populated whenever the provider has data for the entity.
- keywordsstring[]可设为必填
Keywords the uploader tagged the video with.
- languagestring
en
Caption language code (e.g. "en"). Populated whenever the provider has data for the entity.
- likesinteger可设为必填
18900
Number of likes.
- titlestring
The Science of Sourdough, Explained Simply
Video title.
- transcriptstring
welcome back to the channel today we're going to talk about how sourdough starters actually work at a chemistry level first let's talk about the flour you use because that changes everything about fermentation speed
Full transcript text, segments joined in playback order. Populated whenever the provider has data for the entity.
- urlstring
https://www.youtube.com/watch?v=nS3oOb6VwJq
Watch URL of the video.
- videoIdstring
nS3oOb6VwJq
Unique identifier of the video.
- viewsinteger可设为必填
341000
Number of views.
Timed transcript segments in playback order. Populated whenever the provider has data for the entity.
- endSecondsnumber
4.2
Segment end offset in seconds.
- startSecondsnumber
0
Segment start offset in seconds.
- textstring
welcome back to the channel today we're going to talk about
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_full,就以统一格式的 JSON 返回 YouTube 数据。获取 YouTube 视频或 Short 的转录文本,包含带时间的片段及其来源:文字是创作者编写的字幕,还是机器语音识别的结果。AnyAPI 会在 2 个数据源之间路由每个请求,某个数据源失败时自动切换。费用:每千次请求 US$2 起,以美元计价,无需订阅,也没有每月最低消费。过去 30 天,通过 AnyAPI 发起的 YouTube 视频转录文本(完整版) API 调用中有 100.0% 成功,响应时间中位数为 5.9 秒,共测量 16,030 次调用。