- Print
- PDF
Text translation
- Print
- PDF
The latest service changes have not yet been reflected in this content. We will update the content as soon as possible. Please refer to the Korean version for information on the latest updates.
Available in Classic and VPC
Translate and output entered text. The output results can be supplemented with glossary, honorific translation, and term replacement options.
Request
The following describes the request format for the endpoint. The request format is as follows:
Method | URI |
---|---|
POST | /translation |
Request headers
For headers common to all Papago Translation APIs, see Common Papago Translation headers.
Request body
The following describes the request body.
Field | Type | Required | Description |
---|---|---|---|
source | String | Required | Language code of the source text (source)
|
target | String | Required | Language code of the target text
|
text | String | Required | Text to translate
|
glossaryKey | String | Optional | Glossary ID
|
replaceInfo | String | Optional | Substitution translation index
|
honorific | Boolean | Optional | Whether to apply honorifics
|
You can also specify text that should not be translated with HTML <span> tags as follows.
<span translate="no"> </span> or <span class="notranslate"> </span>
When using tags, they do not count towards the character count and have the same supported languages as glossaryKey
and replaceInfo
. See [Text Translation examples for examples of using the <span> tag.
Languages supported for translation
The following describes the supported languages for translation.
Original language | Translation direction | Languages supported (compatible) for translation |
---|---|---|
ko (Korean) | ⇔ | en (English), ja (Japanese), zh-CN (Chinese (Simplified)), zh-TW (Chinese (Traditional)), vi (Vietnamese), th (Thai), id (Indonesian), fr (French), es (Spanish), ru (Russian), de (German), it (Italian) |
en (English) | ⇔ | ko (Korean), ja (Japanese), zh-CN (Chinese (Simplified)), zh-TW (Chinese (Traditional)), vi (Vietnamese), th (Thai), id (Indonesian), fr (French), es (Spanish), ru (Russian), de (German) |
ja (Japanese) | ⇔ | zh-CN (Chinese (Simplified)), zh-TW (Chinese (Traditional)), vi (Vietnamese), th (Thai), id (Indonesian), fr (French) |
zh-CN (Chinese (Simplified)) | ⇔ | zh-TW (Chinese (Simplified)) |
Request example
The following is a sample request.
If Content-Type: application/x-www-form-urlencoded
The following is a sample request when the request header Content-Type
is application/x-www-form-urlencoded
.
curl --location --request POST 'https://naveropenapi.apigw.ntruss.com/nmt/v1/translation' \
--header 'X-NCP-APIGW-API-KEY-ID: {Client ID issued when registering the app}' \
--header 'X-NCP-APIGW-API-KEY: {Client secret issued when registering the app}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'source=auto' \
--data-urlencode 'target=en' \
--data-urlencode 'text=Hello, I like to eat apples while riding my bike.'
For Content-Type: application/json
The following is a sample request when the request header Content-Type
is application/json
.
curl --location --request POST 'https://naveropenapi.apigw.ntruss.com/nmt/v1/translation' \
--header 'X-NCP-APIGW-API-KEY-ID: {Client ID issued when registering the app}' \
--header 'X-NCP-APIGW-API-KEY: {Client secret issued when registering the app}' \
--header 'Content-Type: application/json' \
--data '{
"source": "auto",
"target": "ko",
"text": "Advanced technology requires numerous beta tests and feedbacks. This process takes up a lot of time, but it must be done for development.",
"glossaryKey": "{glossaryKey}",
"replaceInfo": " ",
"honorific": "true"
}'
Response
The following describes the response format.
Response body
The following describes the response body.
Field | Type | Required | Description |
---|---|---|---|
message | Object | - | Response result |
message.result | Object | - | Translation result details |
message.result.srcLangType | String | - | Source text language code |
message.result.tarLangType | String | - | Translated text language code |
message.result.translatedText | String | - | Translated text |
Response status codes
For response status codes common to all Papago Translation APIs, see Common Papago Translation response status codes.
Response example
The following is a sample example.
{
"message": {
"result": {
"srcLangType": "ko",
"tarLangType": "en",
"translatedText": "Hello, I like to eat apple while riding a bicycle."
}
}
}