API Reference
AI video translation — query preview API
GET
video-translation-preview-query-api
ID 34
Query a video-translation preview task.
GET
https://xiaoapis.com/api/video_translation/query_preview
Overview
- task 查询
- 返回预览产物
Use cases
- 轮询预览进度
Conventions
- Gateway ·
https://xiaoapis.com - Auth · send
key(query or JSON body, as this API specifies) - Response · JSON. Check the business code and the HTTP status, not only HTTP 200
Authentication
Send the platform API key (query parameter key or JSON field key, as this page specifies). Create one in API key management.
GET https://xiaoapis.com/api/video_translation/query_preview
Content-Type: application/json
{
"key": "YOUR_API_KEY"
}
Request example
https://xiaoapis.com/api/video_translation/query_preview?task_id=你的task_id&key=你的密钥
Details
请求参数说明:
| 名称 | 必填 | 类型 | 示例值 | 说明 |
|---|---|---|---|---|
| task_id | 是 | string | abc123-def456-ghi789 | 创建预览任务时返回的task_id |
返回参数说明:
| task_id | string | 任务ID |
| status | int | 任务状态(1-处理中,2-完成,3-失败) |
| progress | int | 任务进度(0-100) |
| result.source_subtitles | array | 原始字幕列表 |
| result.translated_subtitles | array | 翻译字幕列表 |
| result.translated_audio_url | string | 翻译后的音频URL |
Response example
{"code":200,"msg":"查询成功","data":{"task_id":"abc123-def456-ghi789","status":2,"progress":100,"result":{"source_subtitles":[],"translated_subtitles":[],"translated_audio_url":"https://example.com/audio.mp3"}}}
FAQ
何时调用?
创建预览任务之后,直到成功或失败。
需要什么参数?
Key 与预览 task_id。
成功返回什么?
可能含译文字幕、试听音频等,见文档。
失败怎么办?
根据错误信息检查源视频与语种参数。
任务会过期吗?
以平台任务留存策略为准,尽早拉取结果。
Related APIs
Full console doc (with the debugger):/doc/34