文档

GetImageTranslate - 商品图片智能翻译

包含文字识别、文本翻译、文字回填等能力。

接口说明

注意 该接口已计划下线,不建议继续调用。 替代接口为图片翻译

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

当前API暂无授权信息透出。

请求参数

名称类型必填描述示例值
Urlstring

需要翻译的图片链接

http://xxxxxxx.oss-cn-shenzhen.aliyuncs.com/xxxxxx.jpg
SourceLanguagestring

图片中的文字语种, 语向支持以及语言代码

zh
TargetLanguagestring

图片中文字翻译后的语种, 语向支持以及语言代码

en
Extrastring
  • 以下 JSON 内容格式,不关注的都可以不用传递,都是可选参数

  • JSON 格式内容:

{
  "have_ocr": "false",
  "without_text":"true",
  "have_psd": "false",
  "ignore_entity": "false"
}
  • have_ocr 通过 true/false 控制是否返回 ocr 结果,true:需要,false:不需要
  • without_text 控制是否需要擦除图片中的文字,true:需要,false:不需要
  • have_psd 用于图片编辑器,psd 数据渲染编辑器
  • ignore_entity 是否忽略实体识别,true:忽略实体识别,false:不忽略
{"have_ocr": "false", "without_text":"true", "have_psd": "false", "ignore_entity": "false"}

返回参数

名称类型描述示例值
object
Codeinteger

状态码,200 表示正常

200
Messagestring

错误的时候,返回的错误信息

ok
RequestIdstring

请求的唯一串

A41F6E25-8520-4AF0-90EF-AF7E32840108
Dataobject

返回的数据内容

Urlstring

翻译后的图片链接

https://ae01.alicdn.com/kf/xxxxx.jpeg
Orcstring

orc 识别后的内容

{"text":"P翼-至草款","width":750,"wordNum":10}
PictureEditorstring

用于图片编辑器渲染的 psd 数据

{"text":"P翼-至草款","width":750,"wordNum":10}

示例

正常返回示例

JSON格式

{
  "Code": 200,
  "Message": "ok",
  "RequestId": "A41F6E25-8520-4AF0-90EF-AF7E32840108",
  "Data": {
    "Url": "https://ae01.alicdn.com/kf/xxxxx.jpeg",
    "Orc": "{\"text\":\"P翼-至草款\",\"width\":750,\"wordNum\":10}",
    "PictureEditor": "{\"text\":\"P翼-至草款\",\"width\":750,\"wordNum\":10}"
  }
}

错误码

HTTP status code错误码错误信息描述
101System.RequestTimeOutThe request has timed out.请求超时
102System.ErrorA system error occurred.系统错误
103System.UrlDecodingErrorAn error occurred while decoding the URL. Verify that the specified URL is encoded.URL编码错误
104System.ParameterErrorSome required parameters are missing.参数错误
105System.LanguageNotSupportedThe specified language pair is not supported.该语向不支持
106System.LanguageDetectErrorAn error occurred while detecting the language.语种识别错误
107System.TranslateErrorAn error occurred while translating.翻译错误
108System.StringTooLongThe maximum length of the specified string is exceeded.字符过长
109System.subNotPermissionThe sub-account is not authorized to perform the operation.子账号没有权限
110System.AccountNotActivatedThe account has not activated the service.账号没有开通服务
111System.SubServiceFailedSub-account service failed.子账号服务失败
112System.TranslateServiceCallFailedFailed to call the translation service.翻译服务调用失败
113System.AccountNotActivatedOrInArrearsThe service is not activated or the account has an outstanding balance.账号服务没有开通或者欠费
199System.unknownErrorAn unknown error occurred.未知错误

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
暂无变更历史
  • 本页导读 (0)
文档反馈