Image Translation API Reference
Image Translation
GET/POST
/ai/image/translation
Image Translation is specially designed for e-commerce images, supporting at least 18 languages. It accurately handles complex text layouts within images and ensures that the translated content matches the image content. This helps e-commerce platforms and developers easily achieve multilingual conversion and presentation of image content.
Request Parameter
Parameter | Type | Required | Description |
---|---|---|---|
| String | Yes | Source image URL Image requirements:No more than 4000x4000 pixel. Size up to 10MB. Supporting png, jpeg, jpgm, bmp, webp. |
| String | Yes | Source language code. Supporting languages as the appendix shows.
|
| String | Yes | Target language code. Supporting languages as the appendix shows.
|
| Boolean | No | Choose whether to translate the text within the main subject of images; this allows you to protect and avoid translating embedded information such as product names. As shown in the example image, the text in the red box represents the text on the main subject, while the text in the blue box represents text not on the main subject.
|
| Boolean | No |
|
Sample Request
Response Parameters
Parameter | Type | Description |
---|---|---|
| Number | Response code;200 indicates a successful call. For other response codes,please refer to the error code information. |
| Object | Result data that generated. |
| String | The image URL of the translation result. |
| String | The parameter protocol query ID required by the image editor (exposed when the request parameter useImageEditor is set to true). |
| String | Request ID;Used to identify a unique request call. |
| Boolean | Whether successful;true is successful,false is unsuccessful. |
| String | Error message,e.g. "content has sensitive data, please try other input". |
Sample Response
Errors
Error Code | Error Message | Description |
---|---|---|
501 | rate limit exceed | The current interface has reached the current limit. Please contact us via navigation bar or email us (aidge_support@service.alibaba.com) to increase the current limit value. |
700 | invalid input | The format of the input parameters does not meet the requirements, and resMessage will return detailed fields that do not meet the requirements. |
703 | image size exceeds the limit | The image size in the request parameters exceeds the limit; the dimensions of the image must not exceed 4000x4000 pixels. |
704 | invalid image form | The image format in the request parameters is invalid. |
705 | image file size exceeds the limit | The image size in the request parameters exceeds the limit; the image size must not exceed 10MB. |
801 | model failed | Internal call exception, please contact us via navigation bar or email us (aidge_support@service.alibaba.com) for troubleshooting. |
900 | tpp url error | Internal call exception, please contact us via navigation bar or email us (aidge_support@service.alibaba.com) for troubleshooting. |
1000 | content has sensitive data, please try other input | Content has sensitive data, please try other input. |
1001 | content control failed, please retry | Content control failed, please retry. If the error persists, please contact us via navigation bar or email us (aidge_support@service.alibaba.com). |
1002 | content risk filter failed, please contact us | Content risk filter failed, please contact us via navigation bar or email us (aidge_support@service.alibaba.com). |
Appendix
Supported Language Pairs
The image translation API supports translation between the language pairs listed in the following table. More language pairs are continuously being added. Please contact us via navigation bar or email us (aidge_support@service.alibaba.com).
Source Language | Target Language |
---|---|
Chinese (Simplified) | Arabic |
Chinese (Simplified) | Chinese (Traditional) |
Chinese (Simplified) | English |
Chinese (Simplified) | French |
Chinese (Simplified) | Japanese |
Chinese (Simplified) | Korean |
Chinese (Simplified) | Portuguese (Portugal) |
Chinese (Simplified) | Russian |
Chinese (Simplified) | Spanish |
Chinese (Simplified) | Vietnamese |
Chinese (Simplified) | Thai |
Chinese (Simplified) | Indonesia |
Chinese (Simplified) | German |
Chinese (Simplified) | Polish |
Chinese (Simplified) | Dutch |
Chinese (Simplified) | Italian |
Chinese (Simplified) | Turkish |
Chinese (Simplified) | Hebrew |
English | Arabic |
English | Chinese (Traditional) |
English | Chinese (Simplified) |
English | Vietnamese |
English | French |
English | Japanese |
English | Korean |
English | Portuguese (Portugal) |
English | Russian |
English | Spanish |
English | Thai |
English | Indonesia |
English | German |
English | Polish |
English | Dutch |
English | Italian |
English | Turkish |
English | Hebrew |
Turkish | Arabic |
Turkish | English |
Language Code
The language code uses ISO 639-1 two-digit language codes. For a country/region variant of a language, the table follows the RFC 5646 format of appending a dash followed by an ISO 3166 2-digit country code. For example, the language code for Traditional Chinese is zh-tw
.
Language | Language Code |
---|---|
Arabic | ar |
Chinese (Simplified) | zh |
Chinese (Traditional) | zh-tw |
English | en |
French | fr |
Japanese | ja |
Korean | ko |
Portuguese (Portugal) | pt |
Russian | ru |
Spanish | es |
Turkish | tr |
Hebrew | he |
Vietnamese | vi |
Thai | th |
Indonesia | id |
German | de |
Polish | pl |
Dutch | nl |
Italian | it |
Last updated