Marco Translator API Reference
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 34 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
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.
Parameter Response
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
Error Code
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
Language Name
Language Code
Arabic
ar
Azerbaijani
az
Bengali
bn
Burmese
my
Chinese (Simplified)
zh
Chinese (Traditional)
zh-tw
Czech
cs
Dutch
nl
English
en
Finnish
fi
French
fr
German
de
Greek
el
Hebrew
he
Hindi
hi
Hungarian
hu
Indonesian
id
Italian
it
Japanese
ja
Korean
ko
Malay
ms
Nepali
ne
Polish
pl
Portuguese (Portugal)
pt
Romanian
ro
Russian
ru
Sinhala
si
Spanish
es
Swedish
sv
Thai
th
Turkish
tr
Ukrainian
uk
Urdu
ur
Vietnamese
vi
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 (Portugal)
pt
Russian
ru
Spanish
es
Thai
th
Turkish
tr
Ukrainian
uk
Urdu
ur
Vietnamese
vi
FAQs(Frequently Asked Questions)
Is the Intervention Capability Available in Bulk?
Yes. You only need to associate multiple intervention glossary IDs for it to take effect. However, self-service upload of intervention glossary IDs is not currently supported. If needed, please search for the Aidge Product Consultation & Service Group on DingTalk using the group number: 105455001046 to join and contact us.
What Performance-Related Information Needs Confirmation During Integration?
The current translation API supports a maximum QPS of 10. If your QPS requirements exceed 10, please contact your account manager to confirm the following information and ensure resource allocation in advance:
Confirmation of SLA (Service Level Agreement), such as AVG RT / P99 RT / AVG QPS / peak QPS for different language pairs.
Confirmation of traffic proportions for different translation scenarios. For example, the traffic proportions for scenarios such as Description / Review / Title, etc.
How to Set Certain Content Not to Be Translated?
When setting formatType
to html
, you can use the following html tags:
Last updated
Was this helpful?