curl --request POST 'https://api.voicecheap.ai/v1/actions/youtube_transcript_history_get' \
--header "x-api-key: $VOICECHEAP_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"historyId":"history_20261016_001"}'
const input = {
historyId: 'history_20261016_001',
};
const response = await fetch('https://api.voicecheap.ai/v1/actions/youtube_transcript_history_get', {
method: 'POST',
headers: {
'x-api-key': process.env.VOICECHEAP_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify(input),
});
const body = await response.json();
if (!response.ok) throw new Error(body.code + ': ' + body.message);
console.log(body);
import os
import requests
response = requests.post(
"https://api.voicecheap.ai/v1/actions/youtube_transcript_history_get",
headers={"x-api-key": os.environ["VOICECHEAP_API_KEY"]},
json={"historyId": "history_20261016_001"},
timeout=120,
)
body = response.json()
if not response.ok:
raise RuntimeError(f"{body.get('code')}: {body.get('message')}")
print(body)
{
"data": {
"historyId": "history_20261016_001",
"youtubeUrl": "https://www.youtube.com/watch?v=abcdefghijk",
"videoId": "abcdefghijk",
"videoTitle": "Product tutorial",
"channelName": "Example channel",
"language": "en",
"durationSeconds": 60,
"durationMinutes": 1,
"createdAt": 1792152000000,
"updatedAt": 1792152000000,
"status": "success",
"transcriptSegmentCount": 1,
"response": {
"source": "youtube_caption",
"language": "en",
"video": {
"videoId": "abcdefghijk",
"sourceUrl": "https://www.youtube.com/watch?v=abcdefghijk",
"canonicalUrl": "https://www.youtube.com/watch?v=abcdefghijk",
"title": "Product tutorial",
"channelName": "Example channel",
"durationSeconds": 60
},
"segments": [
{
"index": 0,
"startSeconds": 0,
"endSeconds": 1.5,
"text": "Hello world."
}
],
"text": "Hello world.",
"srt": "1\n00:00:00,000 --> 00:00:01,500\nHello world.",
"createdAt": 1792152000000
}
}
}
转写
获取 YouTube 转写结果
读取一个已保存的 YouTube 转写结果,包括输出文本或媒体 URL。
POST
/
v1
/
actions
/
youtube_transcript_history_get
curl --request POST 'https://api.voicecheap.ai/v1/actions/youtube_transcript_history_get' \
--header "x-api-key: $VOICECHEAP_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"historyId":"history_20261016_001"}'
const input = {
historyId: 'history_20261016_001',
};
const response = await fetch('https://api.voicecheap.ai/v1/actions/youtube_transcript_history_get', {
method: 'POST',
headers: {
'x-api-key': process.env.VOICECHEAP_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify(input),
});
const body = await response.json();
if (!response.ok) throw new Error(body.code + ': ' + body.message);
console.log(body);
import os
import requests
response = requests.post(
"https://api.voicecheap.ai/v1/actions/youtube_transcript_history_get",
headers={"x-api-key": os.environ["VOICECHEAP_API_KEY"]},
json={"historyId": "history_20261016_001"},
timeout=120,
)
body = response.json()
if not response.ok:
raise RuntimeError(f"{body.get('code')}: {body.get('message')}")
print(body)
{
"data": {
"historyId": "history_20261016_001",
"youtubeUrl": "https://www.youtube.com/watch?v=abcdefghijk",
"videoId": "abcdefghijk",
"videoTitle": "Product tutorial",
"channelName": "Example channel",
"language": "en",
"durationSeconds": 60,
"durationMinutes": 1,
"createdAt": 1792152000000,
"updatedAt": 1792152000000,
"status": "success",
"transcriptSegmentCount": 1,
"response": {
"source": "youtube_caption",
"language": "en",
"video": {
"videoId": "abcdefghijk",
"sourceUrl": "https://www.youtube.com/watch?v=abcdefghijk",
"canonicalUrl": "https://www.youtube.com/watch?v=abcdefghijk",
"title": "Product tutorial",
"channelName": "Example channel",
"durationSeconds": 60
},
"segments": [
{
"index": 0,
"startSeconds": 0,
"endSeconds": 1.5,
"text": "Hello world."
}
],
"text": "Hello world.",
"srt": "1\n00:00:00,000 --> 00:00:01,500\nHello world.",
"createdAt": 1792152000000
}
}
}
读取一个已保存的 YouTube 转写结果,包括输出文本或媒体 URL。
所需权限:
POST https://api.voicecheap.ai/v1/actions/youtube_transcript_history_get
身份验证和权限
string
必填
在此请求头中发送 VoiceCheap API 密钥。也支持通过 Authorization: Bearer 发送同一 API 密钥。OAuth 访问令牌仅适用于 MCP,此 REST 端点不接受 OAuth
访问令牌。
transcription:read.
需要有效的付费订阅。权限不会改变团队角色、资源归属、媒体额度或套餐限制。
参数
string
必填
文本值。最小长度: 1. 最大长度: 160. 匹配模式:
^[A-Za-z0-9_-]+$.完整输入架构
完整输入架构
以下 JSON Schema 保留了发现接口公开的确切字段名、嵌套类型、默认值、范围和可接受值。其他跨字段规则列于操作说明中。
{
"type": "object",
"properties": {
"historyId": {
"type": "string",
"minLength": 1,
"maxLength": 160,
"pattern": "^[A-Za-z0-9_-]+$"
}
},
"required": ["historyId"],
"additionalProperties": false
}
请求示例
请将示例资源标识符和媒体键替换为账户返回的值。重试同一次修改操作时,请保持请求标识符不变。curl --request POST 'https://api.voicecheap.ai/v1/actions/youtube_transcript_history_get' \
--header "x-api-key: $VOICECHEAP_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"historyId":"history_20261016_001"}'
const input = {
historyId: 'history_20261016_001',
};
const response = await fetch('https://api.voicecheap.ai/v1/actions/youtube_transcript_history_get', {
method: 'POST',
headers: {
'x-api-key': process.env.VOICECHEAP_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify(input),
});
const body = await response.json();
if (!response.ok) throw new Error(body.code + ': ' + body.message);
console.log(body);
import os
import requests
response = requests.post(
"https://api.voicecheap.ai/v1/actions/youtube_transcript_history_get",
headers={"x-api-key": os.environ["VOICECHEAP_API_KEY"]},
json={"historyId": "history_20261016_001"},
timeout=120,
)
body = response.json()
if not response.ok:
raise RuntimeError(f"{body.get('code')}: {body.get('message')}")
print(body)
响应
首次执行成功时返回 HTTP 200,操作结果位于 data 下。重放请求时可能改为返回已保存的请求状态。示例展示了一种支持的响应,并未包含所有可选字段。 当前账户拥有的完整 YouTube 转写历史记录项,包括其输出内容。{
"data": {
"historyId": "history_20261016_001",
"youtubeUrl": "https://www.youtube.com/watch?v=abcdefghijk",
"videoId": "abcdefghijk",
"videoTitle": "Product tutorial",
"channelName": "Example channel",
"language": "en",
"durationSeconds": 60,
"durationMinutes": 1,
"createdAt": 1792152000000,
"updatedAt": 1792152000000,
"status": "success",
"transcriptSegmentCount": 1,
"response": {
"source": "youtube_caption",
"language": "en",
"video": {
"videoId": "abcdefghijk",
"sourceUrl": "https://www.youtube.com/watch?v=abcdefghijk",
"canonicalUrl": "https://www.youtube.com/watch?v=abcdefghijk",
"title": "Product tutorial",
"channelName": "Example channel",
"durationSeconds": 60
},
"segments": [
{
"index": 0,
"startSeconds": 0,
"endSeconds": 1.5,
"text": "Hello world."
}
],
"text": "Hello world.",
"srt": "1\n00:00:00,000 --> 00:00:01,500\nHello world.",
"createdAt": 1792152000000
}
}
}
结果字段
| 字段 | 说明 |
|---|---|
data.historyId | 当前账户拥有的网页工具历史条目 ID。 |
data.createdAt | Unix 时间戳,单位为毫秒。 |
data.updatedAt | Unix 时间戳,单位为毫秒。 |
data.response | 完整的已保存 YouTube 工具响应,包括视频元数据和生成的文本。 |
data.response.segments | 带时间信息的转写文本条目:index、startSeconds、endSeconds 和 text。 |
data.response.srt | 序列化为 SRT 的完整转写文本。 |
data.response.text | 纯文本转写内容。 |
data.transcriptSegmentCount | 带时间信息的转写条目数。 |
操作说明
- 需要付费订阅和操作权限。执行时会重新检查调用者的个人工具套餐;已保存的工具和上传引用均属于该调用者,包括凭据与团队关联时。
- 成功操作会消耗一次 API/MCP 共用的每月调用次数。Beginner 每月 500 次、Starter 5,000 次、Creator 25,000 次;Pro、Scale 和 Enterprise 无每月上限。每分钟限制仍然适用,分别为 30、60、120、180、300 和 600 次。工具生成限额单独计算。
- historyId 必须来自对应的当前账户拥有的 history_list 或成功生成结果。其他用户或其他历史集合的 ID 不授予访问权限。
- 此读取操作返回完整的已保存工具历史记录,而不是持久化的集成 resultId。不会再次生成、消耗上传次数或使用每日工具生成次数。
- response 包含 text、srt 和带时间信息的片段;片段时间的单位为秒。公开输出中已移除内部转写来源信息。
用量
每次成功调用消耗一次月度 API/MCP 调用额度。媒体额度和操作本身的生成限额也适用。错误
| HTTP 状态 | 代码 | 含义或恢复方式 |
|---|---|---|
| 400 | CREDENTIAL_IN_QUERY | 凭证通过 access_token 或 api_key 查询参数提供。请在标头中发送凭证。 |
| 400 | VALIDATION_ERROR | 参数不符合操作架构,或提供了未知参数。 |
| 401 | API_KEY_EXPIRED | API 密钥已过期。 |
| 401 | INVALID_API_KEY | 请提供有效且未过期的 API 密钥。 |
| 401 | INVALID_CREDENTIAL | Authorization 标头格式错误或与 x-api-key 冲突。 |
| 401 | MISSING_CREDENTIAL | 未提供可用的请求头凭据,或其长度超过 4096 个字符。 |
| 401 | USER_NOT_FOUND | 该凭据对应的账户已不存在。 |
| 403 | AMBIGUOUS_TEAM_API_KEY | 此凭据对应的用户属于多个团队,因此计费上下文不明确。 |
| 403 | INSUFFICIENT_SCOPE | API 密钥或 MCP 连接缺少所需的操作权限。 |
| 403 | INTEGRATION_PLAN_UNSUPPORTED | 无法验证该账户的集成限制。 |
| 403 | PAID_SUBSCRIPTION_REQUIRED | 此工具操作执行时,已认证的调用者已无付费订阅。 |
| 403 | SUBSCRIPTION_REQUIRED | 请使用有效的付费订阅。 |
| 403 | TEAM_OWNER_NOT_FOUND | 找不到实际生效的团队所有者账户。 |
| 404 | YOUTUBE_TRANSCRIPT_HISTORY_NOT_FOUND | 未找到属于调用者账户的所请求 YouTube 转写历史记录。 |
| 429 | INTEGRATION_MONTHLY_LIMIT_REACHED | 已使用和待处理的调用次数已达到共享的每月 API/MCP 限额。 |
| 429 | INTEGRATION_RATE_LIMIT_REACHED | 该账户已达到每分钟集成调用上限;请检查 retryAfterSeconds。 |
| 500 | INTERNAL_ERROR | 无法读取已保存的历史内容。 |
| 503 | SERVER_RESTARTING | 服务器正在重启。请稍后重试;对于修改操作,请保持请求标识符不变。 |
{
"code": "INSUFFICIENT_SCOPE",
"message": "This credential does not permit the requested action.",
"status": 403,
"details": {
"requiredScopes": ["transcription:read"]
}
}
此页面对您有帮助吗?

