## 语言翻译 ![](https://img.kancloud.cn/9e/f2/9ef2bf21289e676322efa577a6627839_200x200.png) > 系统支持自动识别源语言也可以指定来源和翻译对象。单次请求不得超过5K字节,约为1600汉字。 ## 接口费用( [点击购买](https://market.topthink.com/product/182)) > 最低 0.006元/次 ## 接口调用([调用须知](https://docs.topthink.com/think-api/1835086)) ### 请求地址 ``` GET https://api.topthink.com/fanyi/index ``` ### 请求参数 | 名称 | 类型 | 必填 | 说明 | | --- | --- | --- | --- | | appCode| string| 是|用户授权码,参考[API调用](https://docs.topthink.com/think-api/1835086) | | text| string | 是 | 需要翻译的内容 | | to| string | 否 | 目标语言,默认自动识别| ### 返回`data`参数 | 名称 | 类型 | 示例值 | 说明 | | --- | --- | --- | --- | | from | string | en | 来源语言 | | to | string | zh | 目标语言 | | src | string | hello | 翻译文本 | | dst | string | 你好 | 翻译结果 | ## SDK调用 ``` $client = new Client("YourAppCode"); $result = $client->fanyiIndex() ->withText('hello') ->request(); ``` 返回示例: ~~~ { "code":0, "message": "成功", "data": [ { "from":"en", "to":"zh", "src":"hello", "dst":"你好" } ] } ~~~