Aidge Resource
Try for freeWorkplace
  • LATEST ADVANCEMENTS
    • Introducing Marco-MT: Bringing Translation to the Next Level with LLM
  • GETTING STARTED
    • Quick Start
    • Account and Authentication
    • Your First API Request
    • Test Your API Requests
    • Service Level Agreement
    • FAQ
  • API REFERENCE
    • E-commerce Information Translation
      • Marco Translator
        • Marco Translator API Reference
      • Image Translation
        • Image Translation Pro Version API Reference
        • Image Translation Pro Version Result API Call Description
        • Image Translation Standard Version API Reference
    • E-commerce Image Editing
      • Image Background Removal
        • Image Background Removal API Reference
      • Image Upscaling
        • Image Upscaling API Reference
      • Image Cropping
        • Image Cropping API Reference
      • Image Elements Removal
        • Image Elements Removal API Reference
      • Image Elements Detection
        • Image Elements Detection Submit API Reference
        • Image Elements Detection Query API Reference
    • E-commerce Virtual Model
      • Virtual Model Alternation
        • Virtual Model Alternation Submit API Reference
        • Virtual Model Alternation Result Query API Reference
      • Virtual TryOn
        • Virtual Try-on Submit API Reference
        • Virtual Try-On Query API Reference
        • General Model Library Reference
      • Hands&Feet Repair
        • Hands&Feet Repair Submit API Reference
        • Hands&Feet Repair Query API Reference
    • Editor Documentation
      • AI Model Editor
      • AI Image Editor
        • Image Workbench
        • Background Removal
        • Elements Removal
        • Image Translation
Powered by GitBook
On this page
  • Request Parameters
  • Sample Request
  • Parameter Response
  • Sample Response
  • Error Code
  • Appendix

Was this helpful?

  1. API REFERENCE
  2. E-commerce Information Translation
  3. Marco Translator

Marco Translator API Reference

PreviousMarco TranslatorNextImage Translation

Last updated 9 hours ago

Was this helpful?

Marco Translator

GET/POST /ai/text/marco/translator

By understanding the context of the content, Marco Translator can deliver high-quality translations of product information, support multilingual communication, and perform document translation tasks. It excels in translating e-commerce terminology and daily conversations.

Marco Translator supports translation between 42 languages, with a special focus on Chinese-English, Chinese to multilingual, and English to multilingual translations. Additionally, it offers language detection for 23 languages.

Request Parameters

Parameter
Type
Required
Description

text

String[]

Yes

Translation Text;

The total character length should not exceed 50,000, and the list length should not exceed 50. We also provide a Bulk API for offline translation of high volumes of product text. Please contact us for further assistance if needed.

Sample value:"[\"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

No

Source language code, which can be viewed in the following translation supported language list.

If this parameter is not provided, the language will be automatically detected.

Sample value:"en"

targetLanguage

String

Yes

Target language code, which can be viewed in the following language detection supported language list.

Sample value:"ko"

formatType

String

No

The format type of source text;

Currently text/html are avaliable, default: text.

Sample value:"text"

glossary

String

No

Intervention glossary ID.

Intervention glossary IDs need to be created separately and provided in the input parameters. Multiple intervention glossaries can be passed. If the provided intervention glossary IDs are empty, the translation results will not be modified.

Self-service upload of intervention glossary IDs is not currently supported. Please contact us if needed.

Sample value:"translation_glossary"

Sample Request

The maximum response time for the interface is 30 seconds. It is recommended to set the request timeout to not exceed 30 seconds when making a call.

IopClient client = new IopClient(url, appkey, appSecret);
IopRequest request = new IopRequest();
// Adding this trial tag in header means using the trial resource to test, 
// request.addHeaderParameter("x-iop-trial","true")
request.setApiName("/ai/text/marco/translator");
request.addApiParameter("text", "[\"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");
IopResponse response = client.execute(request, Protocol.TOP);
System.out.println(response.getBody());
Thread.sleep(10);I

We provide http based sample codes in the git code repository.

Parameter Response

Parameter
Type
Description

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.characters

Number

The number of characters translated.

data.translatedText

String

Result data that translated.

data.detectedLanguage

String

Language Detection Results.

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": {
    "translations": [
      {
        "translatedText": "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와 호환 가능(검은색)",
        "characters": 142
      }
      "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

code
Error code
Description

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 correct 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

Language Name

Language Code

Arabic

ar

Azerbaijani

az

Bulgarian

bg

Bengali

bn

Czech

cs

Danish

da

German

de

Greek

el

English

en

Spanish

es

Estonian

et

Finnish

fi

French

fr

Hebrew

he

Hindi

hi

Croatian

hr

Hungarian

hu

Indonesian

id

Italian

it

Japanese

ja

Korean

ko

Lithuanian

lt

Latvian

lv

Malay

ms

Burmese

my

Nepali

ne

Dutch

nl

Norwegian

no

Polish

pl

Portuguese

pt

Romanian

ro

Russian

ru

Sinhala

si

Slovak

sk

Swedish

sv

Thai

th

Turkish

tr

Ukrainian

uk

Urdu

ur

Vietnamese

vi

Chinese (Simplified)

zh

Chinese (Traditional)

zh-TW

Language Detection Supported Languages

Language Name

Language Code

Arabic

ar

Bengali

bn

Chinese (Simplified)

zh

Chinese (Traditional)

zh-TW

Dutch

nl

English

en

French

fr

German

de

Hebrew

he

Indonesian

id

Italian

it

Japanese

ja

Korean

ko

Malay

ms

Polish

pl

Portuguese

pt

Russian

ru

Spanish

es

Thai

th

Turkish

tr

Ukrainian

uk

Urdu

ur

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.

https://github.com/Aidge-AI