# YouTube视频文本演练

YouTube视频文本演练。结合YouTube的接口合同、示例和可复核步骤，在本地验证输入与结果；真实调用保持关闭。

规范页面: https://datanavoapi.com/tools/youtube-transcript/

当前为本地模拟模式；样本由程序生成，不代表平台实时数据，也不证明真实供应商的可用性。

## 输入与结果

该工具将任务映射到 youtube.videos.transcript.get。先核对下面的参数，再在本地调试台运行；结果为固定模拟内容。

## 输入合同

按所选方法查看参数含义、示例和条件规则；view 与 fields 控制返回内容，不改变 TEST 单价。

- GET：id / url 必须恰好提供一个。

| 方法 | 字段 | 类型 | 要求 | 含义 | 枚举或边界 | 示例 |

| --- | --- | --- | --- | --- | --- | --- |

| GET | id | string | 可选/条件 | Video ID | — | "dQw4w9WgXcQ" |

| GET | url | string | 可选/条件 | Link to the video: a watch, shorts, embed, live or youtu.be link | — | — |

| GET | lang | string | 可选/条件 | Which language of captions to get, as a language code (en, es, ja, zh-Hans, say); left out, the captions of the video's own language come first. A video without captions in that language is answered as one without captions | — | — |

| GET | view | string | 可选/条件 | How much of each item: compact (the most used fields, long text cut short), standard, or full (adds `ext`). | ["compact","standard","full"] | — |

| GET | fields | array | 可选/条件 | Return only these fields of each item, by path (`author.name`). | maxItems: 64 | — |

## 在本地试一次

先使用 demo 验证字段，再用客户测试 Key 显式选择 simulated 演练结算。不要把客户 Key 写入网址。

```json
{
  "capability": "youtube.videos.transcript.get",
  "method": "GET",
  "params": {
    "id": "dQw4w9WgXcQ"
  }
}
```

- [打开这条能力的调试台](https://datanavoapi.com/console/?mode=demo&capability=youtube.videos.transcript.get&method=GET&params=%7B%22id%22%3A%22dQw4w9WgXcQ%22%7D)

## 返回字段与解释

统一对象 transcript 允许空值；缺失字段不能替换成零。当前页展示主要结构，完整嵌套字段见对象文档。

| 字段 | 类型 | 含义 | 字段来源 |

| --- | --- | --- | --- |

| post_id | string \| null | ID of the post it belongs to | YouTube |

| lang | string \| null | Language code | YouTube |

| text | string \| null | The whole text | YouTube |

| segments | array \| null | Timed segments (standard view and up) | YouTube |

| segments[].start | number \| null | Start, in seconds (standard view and up) | YouTube |

| segments[].end | number \| null | End, in seconds (standard view and up) | YouTube |

| segments[].text | string \| null | Text of the segment (standard view and up) | YouTube |

| approximate | array \| null | Which numbers of this item are approximate or lower bounds; absent when all are exact | YouTube |

| approximate[].field | string \| null | Path of the field, such as metrics.views | YouTube |

| approximate[].kind | string \| null | Approximate, or a lower bound | YouTube |

| ext | object | The platform's own fields (full view). | YouTube |

- [完整对象字段](https://datanavoapi.com/docs/objects/transcript/)

## 相关页面

- [YouTube 视频字幕](https://datanavoapi.com/apis/youtube/videos/transcript/get/)
- [YouTube接口](https://datanavoapi.com/apis/youtube/)
- [YouTube MCP](https://datanavoapi.com/mcp/youtube/)
- [转写文本字段](https://datanavoapi.com/docs/objects/transcript/)
- [视频文本整理工作流](https://datanavoapi.com/skills/transcripts/)

[English](https://datanavoapi.com/en/tools/youtube-transcript/)
