Translate given text into another language.
CURL
curl -H 'content-type: application/json'
-H 'Accept: application/json'
-H 'api-key: your-key'
-X POST https://www.learnitive.com/api/v1/translations
--data '{"input": "BMW is a German multinational manufacturer of luxury vehicles ... was founded in 1916...",
"model":"balanced",
"source_lang":"en",
"target_lang":"es"
}'
Example output.
{
"success": true,
"status": "success",
"message": [{
"index": 0,
"text": ""BMW es una multinacional alemana fabricante de veh\u00edculos de lujo y motocicletas con sede, ...",
"id":"b2f5ff95-46b2-4c92-8674-74aaa0c73839"
}]
}
Parameter
- input: string. The topic of the blog post.
- source_lang: string. The language of the text to translate.
- target_lang: string. The language to translate to. Available options are:
- “en”: English (Default)
“auto”: The API will attempt to detect the language of the text and translate it.
“bg”: Bulgarian
“cs”: Czech
“da”: Danish
“de”: German
“el”: Greek
“es”: Spanish
“et”: Estonian
“fi”: Finnish
“fr”: French
“hu”: Hungarian
“id”: Indonesian
“it”: Italian
“ja”: Japanese
“ko”: Korean
“lt”: Lithuanian
“lv”: Latvian
“nb”: Norwegian
“nl”: Dutch
“pl”: Polish
“pt”: Portuguese (all Portuguese varieties mixed)
“ro”: Romanian
“ru”: Russian
“sk”: Slovak
“sl”: Slovenian
“sv”: Swedish
“tr”: Turkish
“uk”: Ukrainian
“zh”: Chinese - model: The language model to use, “fast”, “balanced”, “strong” and “expart”. Defaul: “fast”.
- temperature: number. The sampling temperature to be used in text generation. The higher the temperature, the higher the risk of the output to sound “made up”. Default: 0.65