libre 翻译
POST
/api/libreTranslate最后修改时间: 4 个月前
请求参数
Query 参数
key
string
必需
示例值:
6tRiPmeoqYz3yOm15xN259zsTZpn6s6t6EMNtRD1nHrwfmm4ffCcY8slalqyPMwy
Body 参数application/json
from
string
源语言
to
string
目标语言
text
array[string]
翻译内容
platform
string
必需
使用那个平台翻译不传入自动选择
示例1
{
"from": "auto", // 源语言
"to": "zh-CHS", // 目标语言
"text": [ // 翻译内容
"Hello",
"world"
],
"platform": "Google" // 使用那个平台翻译不传入自动选择
}
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
originalText
array[string]
原文
originalTextLen
integer
原文长度
platform
string
平台类型
to
string
目标语言
translate
array [object {2}]
翻译结果
text
string
必需
fromLang
string
必需
示例
{
"originalText": [
"Hello",
"world"
],
"originalTextLen": 10,
"platform": "Google",
"to": "zh-CHS",
"translate": [
{
"text": "你好",
"fromLang": "en"
},
{
"text": "世界",
"fromLang": "en"
}
]
}
最后修改时间: 4 个月前