请求URL:http://www.8tool.vip/index.php?c=other_api&a=fanyi&api_name=translation.get&from=auto&to=需要翻译的语种&keywords=翻译文本&user_id=用户ID&user_key=用户KEY&user_secret=用户密钥 复制
请求方式:GET
返回格式:JSON
请求参数:
| 名称 | 代码 | 名称 | 代码 | 名称 | 代码 |
|---|---|---|---|---|---|
| 自动检测 | auto | 中文 | zh | 英语 | en |
| 粤语 | yue | 文言文 | wyw | 日语 | jp |
| 韩语 | kor | 法语 | fra | 西班牙语 | spa |
| 泰语 | th | 阿拉伯语 | ara | 俄语 | ru |
| 葡萄牙语 | pt | 德语 | de | 意大利语 | it |
| 希腊语 | el | 荷兰语 | nl | 波兰语 | pl |
| 保加利亚语 | bul | 爱沙尼亚语 | est | 丹麦语 | dan |
| 芬兰语 | fin | 捷克语 | cs | 罗马尼亚语 | rom |
| 斯洛文尼亚语 | slo | 瑞典语 | swe | 匈牙利语 | hu |
| 繁体中文 | cht | 越南语 | vie |
| 参数名称 | 类型 | 默认值 | 示例值 | 必须 | 描述 |
|---|---|---|---|---|---|
| keywords | string | 你好 | 是 | UTF-8编码 | |
| from | string | auto | 是 | 翻译源语言,可设置为auto | |
| to | string | en | 是 | 翻译目标语言,不可设置为auto |
返回参数:
| 参数名称 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| from | string | zh | 源语言 |
| to | string | en | 目标语言 |
| trans_result.*.src | string | 你好 | 原文 |
| trans_result.*.dst | string | Hello | 译文 |
返回示例:
stdClass Object
(
[from] => zh
[to] => en
[trans_result] => Array
(
[0] => stdClass Object
(
[src] => 你好
[dst] => Hello
)
)
)错误代码:
| 错误码 | 编码 | 错误信息 |
|---|---|---|
| error_code | 54001 | Invalid Sign |
@2015-2022 WWW.8TOOL.VIP ALL RIGHTS RESERVED. 8TOOL在线工具集合
本网站所列接口及文档全部由 江门市鸿振网络科技 技术支持, POWERED BY WWW.MXSZPT.COM