注意:以下文档只适用于TOP接口,请谨慎使用!

文档中心 > API类目 > 阿里翻译API

alibaba.intl.translationplatform.detect (语种识别接口)

语种识别服务

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
source_text String 必须 very nice 待识别的文本

响应参数

名称 类型 示例值 描述
detected_language String en 识别出来的语种

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaIntlTranslationplatformDetectRequest req = new AlibabaIntlTranslationplatformDetectRequest();
req.setSourceText("very nice");
AlibabaIntlTranslationplatformDetectResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_intl_translationplatform_detect_response>
    <detected_language>en</detected_language>
</alibaba_intl_translationplatform_detect_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案
isv.param_error 参数值错误 根据接口文档确认参数值是否设置正确
isp.language_detect_fail 语种识别出错 可重试,如果重试多次还是失败需要联系服务提供方反馈
isp.系统错误 系统错误 可重试,如果重试多次还是失败需要联系服务提供方反馈

API工具

如何获得此API

FAQ

返回
顶部