超能文献(Suppr)提供 AI 驱动的多语言文档翻译服务,支持 Word、Excel、PowerPoint、PDF、TXT、HTML 等格式。
https://api.suppr.wilddata.cnAuthorization: Bearer <your_api_key>text
POST https://api.suppr.wilddata.cn/v1/translations
Content-Type: multipart/form-data
Authorization: Bearer <your_api_key>
参数:
参数类型必填说明fileFile与 file_url 二选一要翻译的文档文件file_urlString与 file 二选一文档的 URL 地址file_nameString否使用 file_url 时指定文件名from_langString否源语言代码,默认 auto(自动检测)to_langString是目标语言代码optimize_math_formulaBoolean否是否优化数学公式(仅 PDF 有效),默认 false
仅支持 file_url 模式。
text
POST https://api.suppr.wilddata.cn/v1/translations
Content-Type: application/json
Authorization: Bearer <your_api_key>
{
"file_url": "https://example.com/document.docx",
"file_name": "document.docx",
"from_lang": "en",
"to_lang": "zh-cn",
"optimize_math_formula": false
}
text
GET https://api.suppr.wilddata.cn/v1/translations/{task_id}
Authorization: Bearer <your_api_key>
text
GET https://api.suppr.wilddata.cn/v1/translations?offset=0&limit=20
Authorization: Bearer <your_api_key>
查询参数:
参数类型默认值说明offsetInteger0分页偏移量limitInteger20每页数量(1-100)task_idString-可选,若提供则返回单个任务
text
POST https://api.suppr.wilddata.cn/v1/translations/{task_id}/stop?reason=用户取消
Authorization: Bearer <your_api_key>
格式扩展名Word.docxExcel.xlsxPowerPoint.pptxPDF.pdf纯文本.txt网页.html
最大文件大小:2GB
代码语言auto任意语言(仅 from_lang,自动检测)en英语zh-cn简体中文zh-tw繁体中文ja日语ko韩语es西班牙语fr法语pt葡萄牙语ru俄语de德语pl波兰语it意大利语
所有响应使用统一格式:
json
{
"code": 0,
"data": { ... },
"msg": ""
}
code 为 0 表示成功,非 0 表示错误。
状态说明INIT任务已创建,等待处理PROGRESS翻译进行中DONE翻译完成STOPPING正在停止
status 字段DONE 时,从响应中的 target_file_url 下载译文bash
# 步骤 1:创建任务
curl -X POST https://api.suppr.wilddata.cn/v1/translations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"file_url": "https://example.com/paper.pdf", "from_lang": "en", "to_lang": "zh-cn"}'
# 步骤 2:查询状态(使用返回的 task_id)
curl https://api.suppr.wilddata.cn/v1/translations/TASK_ID \
-H "Authorization: Bearer YOUR_API_KEY"
# 步骤 3:当 status 为 DONE 时,从 target_file_url 下载译文
json
{
"code": 0,
"data": {
"task_id": "02a6c6d1-3f70-4a5a-80bc-971d53a37bb1",
"status": "INIT",
"consumed_point": 453,
"source_lang": "auto",
"target_lang": "ko",
"optimize_math_formula": false
},
"msg": ""
}
json
{
"code": 0,
"data": {
"task_id": "taskid-1234",
"status": "DONE",
"progress": 1,
"consumed_point": 453,
"source_file_name": "example.docx",
"source_file_url": "https://example.com/source.docx",
"target_file_url": "https://example.com/target.docx",
"source_lang": "auto",
"target_lang": "ko",
"error_msg": null,
"optimize_math_formula": false
},
"msg": ""
}