Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Translate
  • Getting started
    • Overview
    • API authentication
      • Overview
        • Overview
        • Translate
        • DetectLanguage
        • ListLanguages
  • Access management
  • Pricing policy

In this article:

  • HTTP request
  • Body parameters
  • TranslateGlossaryConfig
  • GlossaryData
  • GlossaryPair
  • Response
  • TranslatedText
  1. API reference
  2. REST v2
  3. Translation
  4. Translate

Translate API v2, REST: Translation.Translate

Written by
Yandex Cloud
Updated at January 13, 2025
  • HTTP request
  • Body parameters
  • TranslateGlossaryConfig
  • GlossaryData
  • GlossaryPair
  • Response
  • TranslatedText

Translates the text to the specified language.

HTTP requestHTTP request

POST https://translate.api.cloud.yandex.net/translate/v2/translate

Body parametersBody parameters

{
  "sourceLanguageCode": "string",
  "targetLanguageCode": "string",
  "format": "string",
  "texts": [
    "string"
  ],
  "folderId": "string",
  "model": "string",
  "glossaryConfig": {
    // Includes only one of the fields `glossaryData`
    "glossaryData": {
      "glossaryPairs": [
        {
          "sourceText": "string",
          "translatedText": "string",
          "exact": "boolean"
        }
      ]
    }
    // end of the list of possible fields
  },
  "speller": "boolean"
}

Field

Description

sourceLanguageCode

string

The text language to translate from.
Most languages are specified in ISO 639-1 format (for example, ru), but the field are not limited to it.

Required for translating with glossary.

targetLanguageCode

string

Required field. The target language to translate the text.
Most languages are specified in ISO 639-1 format (for example, ru), but the field are not limited to it.

format

enum (Format)

Format of the text to be translated.

  • FORMAT_UNSPECIFIED
  • PLAIN_TEXT: Text without markup. Default value.
  • HTML: Text in the HTML format.

texts[]

string

Array of the strings to translate.
The maximum total length of all strings is 10000 characters.

folderId

string

ID of the folder to which you have access.
Required for authorization with a user account.
Do not specify this field if you make the request on behalf of a service account.

model

string

Model ID if you use custom model.

glossaryConfig

TranslateGlossaryConfig

Glossary to be applied for the translation. For more information, see Glossaries.

speller

boolean

Enable spell checking.

TranslateGlossaryConfigTranslateGlossaryConfig

Field

Description

glossaryData

GlossaryData

Pass glossary data in the request. Currently, the only way to pass glossary.

Includes only one of the fields glossaryData.

GlossaryDataGlossaryData

Field

Description

glossaryPairs[]

GlossaryPair

Array of text pairs.

The maximum total length of all source texts is 10000 characters.
The maximum total length of all translated texts is 10000 characters.

GlossaryPairGlossaryPair

Field

Description

sourceText

string

Required field. Text in the source language.

translatedText

string

Required field. Text in the target language.

exact

boolean

Allows to add translations for specific terms to neuroglossaries.

ResponseResponse

HTTP Code: 200 - OK

{
  "translations": [
    {
      "text": "string",
      "detectedLanguageCode": "string"
    }
  ]
}

Field

Description

translations[]

TranslatedText

Array of the translations.

TranslatedTextTranslatedText

Field

Description

text

string

Translated text.

detectedLanguageCode

string

The language code of the source text.
Most languages are specified in ISO 639-1 format (for example, ru), but the field are not limited to it.

Was the article helpful?

Previous
Overview
Next
DetectLanguage
Yandex project
© 2025 Yandex.Cloud LLC