Contextual Product Translation API Reference

Contextual Product Translation

GET/POST /ai/text/translation/and/polishment

Contextual product translation is specifically developed for e-commerce scenarios, enabling precise translation across more than 60 languages. It leverages e-commerce-specific data for training to enhance translation quality and is equipped with intelligent brand recognition and customizable intervention features, providing an efficient multi-language market expansion solution for e-commerce platforms and developers.

Request Parameters

ParameterTypeRequiredDescription

sourceTextList

String[]

Ture

Translation text;The total character length should not more than 1000, and the list is recommended to have no more than 50 items.

We also provide bulk APIs that support the offline translation of large quantities of product text. Please contact us if needed.

Sample:Pen for iPad, 13 mins Fast Charging Stylus with Palm Rejection, Tilt Sensitivity, Compatible with 2018-2022 iPad Air 3/4/5, iPad Mini 5/6, iPad 6/7/8/9/10, iPad Pro 11", iPad Pro 12.9" (Black)

sourceLanguage

String

True

Source language code;Use ISO 693-1 Language Code Specification,such as the code of“英文” is “en”,Chinese is “zh”。Supporting languages are as follows.

Currently automatic language detection ability is not available.

Sample: en

targetLanguage

String

True

Target language code;Use ISO 693-1 Language Code Specification; Please select from the supporting source languages listed below. The available target languages can be found in the following supporting languages list.

Sample:ko

formatType

String

true

The format type of source text;Currently text/html are avaliable.

Sample:text

glossary

String

False

Intervention glossary ID. The intervention glossary needs to be created separately, and its ID should be provided in the input parameters. Multiple intervention glossaries can be passed. If the provided intervention glossary ID is empty, the translation results will not be modified.

Currently, self-service uploading of intervention glossaries is not supported. Please contact us if needed.

Sample:translation_glossary

extension

Object

False

Translate_scene(String) ,Currently, translate_scene(String) supports translation scenarios for product descriptions and CPV attributes (description)/product titles (title)/product Q&A and replies (qa)/product reviews (review).

Sample:title

Sample Request

IopClient client = new IopClient(url, appkey, appSecret);
IopRequest request = new IopRequest();
request.setApiName("/ai/text/translation/and/polishment");
request.addApiParameter("sourceTextList", "[\"Pen for iPad, 13 mins Fast Charging Stylus with Palm Rejection, Tilt Sensitivity, Compatible with 2018-2022 iPad Air 3/4/5, iPad Mini 5/6, iPad 6/7/8/9/10, iPad Pro 11, iPad Pro 12.9 (Black)\"]");
request.addApiParameter("sourceLanguage", "en");
request.addApiParameter("targetLanguage", "ko");
request.addApiParameter("formatType", "text");
request.addApiParameter("glossary", "test_glossory");
request.addApiParameter("extension", "{}");
IopResponse response = client.execute(request, Protocol.TOP);
System.out.println(response.getBody());
Thread.sleep(10);

Parameter Response

ParameterTypeDescription

resCode

Number

Response code; 200 indicates a successful call, other response codes can be referred to in the error code information.

data

Object

Result data that generated.

data.usage

Number

The number of the strings.

data.translated

String[]

Result data that translated.

requestId

String

Request ID: Used to uniquely identify a single request call.

success

Boolean

Whether successful;true is successful,false is unsuccessful.

resMessage

String

Error message,like "content has sensitive data, please try other input".

Sample Response

{
  "data": {
    "usage": 143,
    "translated": [
      "iPad용 펜, 손바닥 거부 기능이 있는 13분 고속 충전 스타일러스, 기울기 감도, 2018-2022 iPad Air 3/4/, iPad Mini 5/6, iPad 6/7/8/9/10, iPad Pro 11, iPad Pro 12.9와 호환 가능(검은색)"
    ],
    "class": "com.aidc.service.api.client.translate.dto.CommonTranslationResponse"
  },
  "requestId": "2101364017192321239846748e03d8",
  "success": true,
  "resCode": 200,
  "resMessage": "success",
  "code": "0",
  "request_id": "2101236717192321239867892",
  "_trace_id_": "2101364017192321239846748e03d8"
}

Error Code

codeError codeDescription

500

system error

System error

501

rate limit exceed

The current interface has reached the current limit. Please contact us 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.

801

model failed

Internal call exception, please contact us for troubleshooting.

1000

content has sensitive data, please try other input

The request parameters contain sensitive information and cannot be processed at this time. Please try a different input.

1001

content control failed, please retry

The risk control service failed. Please try again. If the error persists, please contact us.

1002

content risk filter failed, please contact us

Content risk filter failed, please contact us

1007

text language is not supported

Text language is not supported,please input correst language.

1100

The input text length is too long

The input text length is too long(MAX is 4096 Token),please input again with correct length.

Appendix

Supporting Languages and Scenarios

You can choose the supported language based on different types of product text content. More language are continuously being added. Please contact us if you have any specific requirements.

Source LanguageTarget LanguageDescriptionTitleQAReview

Chinese

English

Supported

Arabic

English

Supported

Japanese

English

Supported

Korean

English

Supported

German

English

Supported

Dutch

English

Supported

English

Chinese

Supported

English

Arabic

Supported

Supported

English

Urdu

Supported

Supported

English

Bengali

Supported

Supported

English

Polish

Supported

Supported

English

Ukrainian

Supported

Supported

English

Russian

Supported

Supported

English

German

Supported

Supported

English

Dutch

Supported

Supported

English

Turkish

Supported

Supported

English

Korean

Supported

English

Japanese

Supported

English

Thai

Supported

English

Indonesian

Supported

English

Malay

Supported

English

Vietnamese

Supported

Supported

English

Hebrew

Supported

Supported

Chinese

Vietnamese

Supported

English

Spanish

Supported

English

French

Supported

English

Portuguese

Supported

English

Italian

Supported

Turkish

Arabic

Supported

Supported

Turkish

English

Supported

Supported

Turkish

German

Supported

Supported

Turkish

Czech

Supported

Turkish

Romanian

Supported

Turkish

Hungarian

Supported

Turkish

Greek

Supported

Chinese

Arabic

Supported

Supported

Chinese

Urdu

Supported

Supported

Chinese

Bengali

Supported

Supported

Chinese

Polish

Supported

Supported

Chinese

Ukrainian

Supported

Supported

Chinese

Russian

Supported

Supported

Chinese

German

Supported

Supported

Chinese

Dutch

Supported

Supported

Chinese

Turkish

Supported

Supported

Chinese

Korean

Supported

Chinese

Japanese

Supported

Chinese

Thai

Supported

Chinese

Indonesian

Supported

Chinese

Malay

Supported

Chinese

Vietnamese

Supported

Chinese

Spanish

Supported

Chinese

French

Supported

Chinese

Portuguese

Supported

Chinese

Italian

Supported

Language Code

Contextual product translation supports translation between the languages listed in the table below. The language codes use ISO 639-1 two-letter codes. For country/region variants of languages, the table follows the RFC 5646 format, which adds an underline and then the ISO 3166 two-letter country/region code. For example, the language code for Traditional Chinese is zh-tw.

Language English NameLanguage Code

Arabic

ar

Chinese (Simplified)

zh

Chinese (Traditional)

zh-tw

Danish

da

Dutch

nl

English

en

Persian

fa

Filipino/Tagalog

tl

Finnish

fi

French

fr

German

de

Hungarian

hu

Icelandic

is

Indonesian

id

Italian

it

Japanese

ja

Korean

ko

Lithuanian

lt

Malay

ms

Polish

pl

Portuguese (Portugal)

pt

Romanian

ro

Russian

ru

Sinhala

si

Spanish

es

Thai

th

Turkish

tr

Ukrainian

uk

Urdu

ur

Uzbek

uz

Vietnamese

vi

Notice

By using this API, you confirm that you are a legal owner of all intellectual property rights pertaining to the data and content that you provide to us via the API, or have obtained the necessary authorizations for us to receive and use the same from you. You further agree that you will not use this product or any output thereof for any unlawful, unethical, unauthorized or harmful activities.

Last updated