Overview
Menu

TextTranslation

Last updated: 2026-05-11 20:07:42Download PDF

1. API Description

Domain name for API request: mps.intl.tencentcloudapi.com.

A maximum of 5 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter NameRequiredTypeDescription
ActionYesStringCommon Params. The value used for this API: TextTranslation.
VersionYesStringCommon Params. The value used for this API: 2019-06-12.
RegionNoStringCommon Params. This parameter is not required for this API.
SourceTextYesString

Text to be translated. The text must be encoded in UTF-8 format. Non-UTF-8 encoded characters may cause translation failures. Provide valid text. Unconventional text such as HTML tags may fail to translate. The text length per request cannot exceed 2,000 characters.

SourceYesString

Source language. Valid values:
"auto": " Auto-detection (detects as one language)",
"ab": "Abkhaz",
"ace": "Acehnese",
"ach": "Acholi",
"af": "Afrikaans",
"ak": "Akan",
"am": "Amharic",
"ar": "Arabic",
"as": "Assamese",
"ay": "Aymara",
"az": "Azerbaijani",
"ba": "Bashkir",
"ban": "Balinese",
"bbc": "Batak Toba",
"bem": "Bemba",
"bew": "Betawi",
"bg": "Bulgarian",
"bho": "Bhojpuri",
"bik": "Bikol",
"bm": "Bambara",
"bn": "Bengali",
"br": "Breton",
"bs": "Bosnian",
"btx": "Batak Karo",
"bts": "Batak Simalungun",
"bua": "Buryat",
"ca": "Catalan",
"ceb": "Cebuano",
"cgg": "Kiga",
"chm": "Meadow Mari",
"ckb": "Kurdish (Sorani)",
"cnh": "Hakha Chin",
"co": "Corsican",
"crh": "Crimean Tatar",
"crs": "Seychellois Creole",
"cs": "Czech",
"cv": "Chuvash",
"cy": "Welsh",
"da": "Danish",
"de": "German",
"din": "Dinka",
"doi": "Dogri",
"dov": "Dombe",
"dv": "Dhivehi",
"dz": "Dzongkha",
"ee": "Ewe",
"el": "Greek",
"en": "English",
"eo": "Esperanto",
"es": "Spanish",
"et": "Estonian",
"eu": "Basque",
"fa": "Persian",
"ff": "Fula",
"fi": "Finnish",
"fil": "Filipino (Tagalog)",
"fj": "Fijian",
"fr": "French",
"fr-CA": "French (Canada)",
"fr-FR": "French (France)",
"fy": "Frisian",
"ga": "Irish",
"gaa": "Ga",
"gd": "Scottish Gaelic",
"gl": "Galician",
"gn": "Guarani",
"gom": "Konkani",
"gu": "Gujarati",
"gv": "Manx",
"ha": "Hausa",
"haw": "Hawaiian",
"he": "Hebrew",
"hi": "Hindi",
"hil": "Hiligaynon",
"hmn": "Hmong",
"hr": "Croatian",
"hrx": "Hunsrik",
"ht": "Haitian Creole",
"hu": "Hungarian",
"hy": "Armenian",
"id": "Indonesian",
"ig": "Igbo",
"ilo": "Ilocano",
"is": "Icelandic",
"it": "Italian",
"iw": "Hebrew",
"ja": "Japanese",
"jv": "Javanese",
"jw": "Javanese",
"ka": "Georgian",
"kk": "Kazakh",
"km": "Khmer",
"kn": "Kannada",
"ko": "Korean",
"kri": "Krio",
"ku": "Kurdish (Kurmanji)",
"ktu": "Kituba",
"ky": "Kyrgyz",
"la": "Latin",
"lb": "Luxembourgish",
"lg": "Ganda (Luganda)",
"li": "Limburgish",
"lij": "Ligurian",
"lmo": "Lombard",
"ln": "Lingala",
"lo": "Lao",
"lt": "Lithuanian",
"ltg": "Latgalian",
"luo": "Luo",
"lus": "Mizo",
"lv": "Latvian",
"mai": "Maithili",
"mak": "Makassar",
"mg": "Malagasy",
"mi": "Maori",
"min": "Minangkabau",
"mk": "Macedonian",
"ml": "Malayalam",
"mn": "Mongolian",
"mr": "Marathi",
"ms": "Malay",
"mt": "Maltese",
"my": "Burmese",
"ne": "Nepali",
"new": "Newari",
"nl": "Dutch",
"no": "Norwegian",
"nr": "Southern Ndebele",
"nso": "Northern Sotho (Sepedi)",
"nus": "Nuer",
"ny": "Chichewa (Nyanja)",
"oc": "Occitan",
"om": "Oromo",
"or": "Odia (Oriya)",
"pa": "Punjabi",
"pag": "Pangasinan",
"pam": "Kapampangan",
"pap": "Papiamento",
"pl": "Polish",
"ps": "Pashto",
"pt": "Portuguese",
"pt-BR": "Portuguese (Brazil)",
"pt-PT": "Portuguese (Portugal)",
"qu": "Quechua",
"ro": "Romanian",
"rom": "Romani",
"rn": "Rundi",
"ru": "Russian",
"rw": "Kinyarwanda",
"sa": "Sanskrit",
"scn": "Sicilian",
"sd": "Sindhi",
"sg": "Sango",
"shn": "Shan",
"si": "Sinhala",
"sk": "Slovak",
"sl": "Slovenian",
"sm": "Samoan",
"sn": "Shona",
"so": "Somali",
"sq": "Albanian",
"sr": "Serbian",
"ss": "Swati",
"st": "Sotho",
"su": "Sundanese",
"sv": "Swedish",
"sw": "Swahili",
"szl": "Silesian",
"ta": "Tamil",
"te": "Telugu",
"tet": "Tetum",
"tg": "Tajik",
"th": "Thai",
"ti": "Tigrinya",
"tk": "Turkmen",
"tl": "Filipino (Tagalog)",
"tn": "Tswana",
"tr": "Turkish",
"ts": "Tsonga",
"tt": "Tatar",
"ug": "Uyghur",
"uk": "Ukrainian",
"ur": "Urdu",
"uz": "Uzbek",
"vi": "Vietnamese",
"xh": "Xhosa",
"yi": "Yiddish",
"yo": "Yoruba",
"yua": "Yucatec Maya",
"yue": "Cantonese",
"zh": "Simplified Chinese",
"zh-TW": "Traditional Chinese",
"zu": "Zulu"

TargetYesString

Target language. Valid values:
"ab": "Abkhaz",
"ace": "Acehnese",
"ach": "Acholi",
"af": "Afrikaans",
"ak": "Akan",
"am": "Amharic",
"ar": "Arabic",
"as": "Assamese",
"ay": "Aymara",
"az": "Azerbaijani",
"ba": "Bashkir",
"ban": "Balinese",
"bbc": "Batak Toba",
"bem": "Bemba",
"bew": "Betawi",
"bg": "Bulgarian",
"bho": "Bhojpuri",
"bik": "Bikol",
"bm": "Bambara",
"bn": "Bengali",
"br": "Breton",
"bs": "Bosnian",
"btx": "Batak Karo",
"bts": "Batak Simalungun",
"bua": "Buryat",
"ca": "Catalan",
"ceb": "Cebuano",
"cgg": "Kiga",
"chm": "Meadow Mari",
"ckb": "Kurdish (Sorani)",
"cnh": "Hakha Chin",
"co": "Corsican",
"crh": "Crimean Tatar",
"crs": "Seychellois Creole",
"cs": "Czech",
"cv": "Chuvash",
"cy": "Welsh",
"da": "Danish",
"de": "German",
"din": "Dinka",
"doi": "Dogri",
"dov": "Dombe",
"dv": "Dhivehi",
"dz": "Dzongkha",
"ee": "Ewe",
"el": "Greek",
"en": "English",
"eo": "Esperanto",
"es": "Spanish",
"et": "Estonian",
"eu": "Basque",
"fa": "Persian",
"ff": "Fula",
"fi": "Finnish",
"fil": "Filipino (Tagalog)",
"fj": "Fijian",
"fr": "French",
"fr-CA": "French (Canada)",
"fr-FR": "French (France)",
"fy": "Frisian",
"ga": "Irish",
"gaa": "Ga",
"gd": "Scottish Gaelic",
"gl": "Galician",
"gn": "Guarani",
"gom": "Konkani",
"gu": "Gujarati",
"gv": "Manx",
"ha": "Hausa",
"haw": "Hawaiian",
"he": "Hebrew",
"hi": "Hindi",
"hil": "Hiligaynon",
"hmn": "Hmong",
"hr": "Croatian",
"hrx": "Hunsrik",
"ht": "Haitian Creole",
"hu": "Hungarian",
"hy": "Armenian",
"id": "Indonesian",
"ig": "Igbo",
"ilo": "Ilocano",
"is": "Icelandic",
"it": "Italian",
"iw": "Hebrew",
"ja": "Japanese",
"jv": "Javanese",
"jw": "Javanese",
"ka": "Georgian",
"kk": "Kazakh",
"km": "Khmer",
"kn": "Kannada",
"ko": "Korean",
"kri": "Krio",
"ku": "Kurdish (Kurmanji)",
"ktu": "Kituba",
"ky": "Kyrgyz",
"la": "Latin",
"lb": "Luxembourgish",
"lg": "Ganda (Luganda)",
"li": "Limburgish",
"lij": "Ligurian",
"lmo": "Lombard",
"ln": "Lingala",
"lo": "Lao",
"lt": "Lithuanian",
"ltg": "Latgalian",
"luo": "Luo",
"lus": "Mizo",
"lv": "Latvian",
"mai": "Maithili",
"mak": "Makassar",
"mg": "Malagasy",
"mi": "Maori",
"min": "Minangkabau",
"mk": "Macedonian",
"ml": "Malayalam",
"mn": "Mongolian",
"mr": "Marathi",
"ms": "Malay",
"mt": "Maltese",
"my": "Burmese",
"ne": "Nepali",
"new": "Newari",
"nl": "Dutch",
"no": "Norwegian",
"nr": "Southern Ndebele",
"nso": "Northern Sotho (Sepedi)",
"nus": "Nuer",
"ny": "Chichewa (Nyanja)",
"oc": "Occitan",
"om": "Oromo",
"or": "Odia (Oriya)",
"pa": "Punjabi",
"pag": "Pangasinan",
"pam": "Kapampangan",
"pap": "Papiamento",
"pl": "Polish",
"ps": "Pashto",
"pt": "Portuguese",
"pt-BR": "Portuguese (Brazil)",
"pt-PT": "Portuguese (Portugal)",
"qu": "Quechua",
"ro": "Romanian",
"rom": "Romani",
"rn": "Rundi",
"ru": "Russian",
"rw": "Kinyarwanda",
"sa": "Sanskrit",
"scn": "Sicilian",
"sd": "Sindhi",
"sg": "Sango",
"shn": "Shan",
"si": "Sinhala",
"sk": "Slovak",
"sl": "Slovenian",
"sm": "Samoan",
"sn": "Shona",
"so": "Somali",
"sq": "Albanian",
"sr": "Serbian",
"ss": "Swati",
"st": "Sotho",
"su": "Sundanese",
"sv": "Swedish",
"sw": "Swahili",
"szl": "Silesian",
"ta": "Tamil",
"te": "Telugu",
"tet": "Tetum",
"tg": "Tajik",
"th": "Thai",
"ti": "Tigrinya",
"tk": "Turkmen",
"tl": "Filipino (Tagalog)",
"tn": "Tswana",
"tr": "Turkish",
"ts": "Tsonga",
"tt": "Tatar",
"ug": "Uyghur",
"uk": "Ukrainian",
"ur": "Urdu",
"uz": "Uzbek",
"vi": "Vietnamese",
"xh": "Xhosa",
"yi": "Yiddish",
"yo": "Yoruba",
"yua": "Yucatec Maya",
"yue": "Cantonese",
"zh": "Simplified Chinese",
"zh-TW": "Traditional Chinese",
"zu": "Zulu"

UserExtParaNoString

User extension parameter.

3. Output Parameters

Parameter NameTypeDescription
TargetTextString

Translated text.

SourceString

Source language. See the input parameter Source.

TargetString

Target language. See the input parameter Target.

RequestIdStringThe unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Text Translation Request Example

Input Example

POST / HTTP/1.1
Host: mps.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: TextTranslation
<Common request parameters>

{
    "SourceText": "hello",
    "Source": "en",
    "Target": "zh"
}

Output Example

{
    "Response": {
        "RequestId": "6411c585-ee14-4a53-8642-dea0f16e161d",
        "Source": "en",
        "Target": "zh",
        "TargetText": "Hello"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error CodeDescription
InvalidParameterValue.SourceLanguageSourceLanguage parameter error.
InvalidParameterValue.SourceTextA SourceText parameter error occurs.
InvalidParameterValue.TextContentA TextContent parameter value error occurs.
InvalidParameterValue.TranslateDstLanguageThe value of the target language parameter is incorrect.
ResourceNotFound.UserUnregisterThe user is not registered.
UnsupportedOperation.TextTooLongThe text for a single request exceeds the length limit.