Text translation
    • PDF

    Text translation

    • PDF

    Article summary

    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

    This section describes the request format. The method and URI are as follows:

    MethodURI
    POST/translation

    Request headers

    For information about the headers common to all Papago Translation APIs, see Common Papago Translation headers.

    Request body

    You can include the following data in the body of your request:

    FieldTypeRequiredDescription
    sourceStringRequiredLanguage code of the source text (source)
    • auto (automatic language detection) | 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)
    targetStringRequiredLanguage code of the target text
    • 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)
    • For information about language pairs for which translation is supported, see Languages supported for translation.
    textStringRequiredText to translate
    • Up to 5000 characters translatable per call
    glossaryKeyStringOptionalGlossary ID
    • Customized translation is applied based on the glossary data.
    • Korean ⇔ English, Japanese, Chinese (Simplified/Traditional), | English ⇔ Japanese, Chinese (Simplified/Traditional), Vietnamese, Thai, Indonesian, French | Japanese ⇔ Chinese (Simplified/Traditional)
    • When used concurrently with replaceInfo, replaceInfo has higher priority.
    • honorific is not applied to terms in glossaries
    replaceInfoStringOptionalSubstitution translation index
    • Bulk translate specific index (str) to desired text.
      • Return original text if str is not set
    • Korean ⇔ English, Japanese, Chinese (Simplified/Traditional), French | English ⇔ Japanese, Chinese (Simplified/Traditional), Vietnamese, Thai, Indonesian, French | Japanese ⇔ Chinese (Simplified/Traditional)
    honorificBooleanOptionalWhether to apply honorifics
    • true | false (default)
      • true: Apply honorifics
      • false: No honorifics
    • English ⇒ Korean, Japanese ⇒ Korean, Chinese (Simplified/Traditional) ⇒ Korean, Korean ⇒ Japanese, English ⇒ Japanese, Chinese (Simplified/Traditional) ⇒ Japanese
    Note

    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 languageTranslation directionLanguages 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 request example is as follows:

    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://papago.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 request example if the request header's Content-Type is application/json is as follows:

    curl --location --request POST
    'https://papago.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

    This section describes the response format.

    Response body

    The response body includes the following data:

    FieldTypeRequiredDescription
    messageObject-Response result
    message.resultObject-Translation result details
    message.result.srcLangTypeString-Source text language code
    message.result.tarLangTypeString-Translated text language code
    message.result.translatedTextString-Translated text

    Response status codes

    For information about the HTTP status codes common to all Papago Translation APIs, see Common Papago Translation response status codes.

    Response example

    The response example is as follows:

    {
        "message": {
            "result": {
                "srcLangType": "ko",
                "tarLangType": "en",
                "translatedText": "Hello, I like to eat apple while riding a bicycle."
            }
        }
    }
    

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.