Naver Cloud Platform Papago Translation API
Papago API is a translation service using Natural Machine Translation (NMT), an artificial neural network-based machine translation technology developed by Naver. The Papago API automatically translates the entered text into various languages through an artificial neural network-based translation algorithm.
Papago Translation is based on NMT technology. NMT is an acronym for Neural Machine Translation, which understands and translates sentences through a large virtual space called an artificial neural network. Sentences entered for translation are stored by replacing them with vectors (coordinate values) that represent specific points in the artificial neural network virtual space. Sentences with similar meanings are gathered close to each other, and NMT translates by referring to the information around the entered sentence, creating a natural translation result that takes into account the context of the sentence. Papago NMT automatically learns large amounts of data accumulated through Naver services every day. This generated translation model provides more accurate results than traditional SMT translation.
Request
The NCP Translata(Papago) API consists of a single HTTP POST endpoint. The body must be a application/json data with following fields.
-
source is the original language code to be translated.
-
target is the language code to be translated
-
text Text to translate (up to 5,000 characters per call)
-
example
{
"source": "ko",
"target": "en",
"text": "안녕하세요. 반나서 반갑습니다."
}
Response
- In case of success (example):
{
"message": {
"@type": "response",
"@service": "naverservice.labs.api",
"@version": "1.0.0",
"result": {
"translatedText": "Hello, Nice to meet you."
}
}
}
-
In case of failure:
- the response mime-type is application/json, error type is indicated by the response status code and details are in the json body
Snippets
curl --location \
--request POST 'https://manta-api.coxwave.app/api/ncp/translate' \
--header 'X-MANTA-HUB-API-KEY: <your-api-key-here>' \
--header 'Content-Type: application/json' \
--data-raw '{"source": "ko", "target": "en", "text": "안녕하세요. 반나서 반갑습니다."}'
const axios = require('axios');
const data = JSON.stringify({
"source": "ko",
"target": "en",
"text": "안녕하세요. 반나서 반갑습니다."
});
const config = {
method: 'post',
url: 'https://manta-api.coxwave.app/api/ncp/translate',
headers: {
'X-MANTA-HUB-API-KEY': '<your-api-key-here>',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
import requests
import json
url = "https://manta-api.coxwave.app/api/ncp/translate"
payload = json.dumps({
"source": "ko",
"target": "en",
"text": "안녕하세요. 반나서 반갑습니다."
})
headers = {
'X-MANTA-HUB-API-KEY': '<your-api-key-here>',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Suppored source and target languages code pair
Source | Target | Source | Target | |||
---|---|---|---|---|---|---|
Korean(ko) | → | English(en) | English(en) | → | Korean(ko) | |
Korean(ko) | → | Japenese(ja) | Japenese(ja) | → | Korean(ko) | |
Korean(ko) | → | Simplified Chinese(zh-CN) | Simplified Chinese(zh-CN) | → | Korean(ko) | |
Korean(ko) | → | Traditional Chinese(zh-TW) | Traditional Chinese(zh-TW) | → | Korean(ko) | |
Korean(ko) | → | Vietnamese(vi) | Vietnamese(vi) | → | Korean(ko) | |
Korean(ko) | → | Indonesian(id) | Indonesian(id) | → | Korean(ko) | |
Korean(ko) | → | Thai(th) | Thai(th) | → | Korean(ko) | |
Korean(ko) | → | Deutsch(de) | Deutsch(de) | → | Korean(ko) | |
Korean(ko) | → | Russian(ru) | Russian(ru) | → | Korean(ko) | |
Korean(ko) | → | Spanish(es) | Spanish(es) | → | Korean(ko) | |
Korean(ko) | → | Italian (it) | Italian(it) | → | Korean(ko) | |
Korean(ko) | → | French(fr) | French(fr) | → | Korean(ko) | |
English(en) | → | Japenese(ja) | Japenese(ja) | → | English(en) | |
English(en) | → | French(fr) | French(fr) | → | English(en) | |
English(en) | → | Simplified Chinese(zh-CN) | Simplified Chinese(zh-CN) | → | English(en) | |
English(en) | → | Traditional Chinese(zh-TW) | Traditional Chinese(zh-TW) | → | English(en) | |
Japenese(ja) | → | Simplified Chinese(zh-CN) | Simplified Chinese(zh-CN) | → | Japenese(ja) | |
Japenese(ja) | → | Traditional Chinese(zh-TW) | Traditional Chinese(zh-TW) | → | Japenese(ja) | |
Simplified Chinese(zh-CN) | → | Traditional Chinese(zh-TW) | Traditional Chinese(zh-TW) | → | Simplified Chinese(zh-CN) |