Yandex Cloud
Поиск
Связаться с намиПодключиться
  • Документация
  • Блог
  • Все сервисы
  • Статус работы сервисов
    • Популярные
    • Инфраструктура и сеть
    • Платформа данных
    • Контейнеры
    • Инструменты разработчика
    • Бессерверные вычисления
    • Безопасность
    • Мониторинг и управление ресурсами
    • Машинное обучение
    • Бизнес-инструменты
  • Все решения
    • По отраслям
    • По типу задач
    • Экономика платформы
    • Безопасность
    • Техническая поддержка
    • Каталог партнёров
    • Обучение и сертификация
    • Облако для стартапов
    • Облако для крупного бизнеса
    • Центр технологий для общества
    • Облако для интеграторов
    • Поддержка IT-бизнеса
    • Облако для фрилансеров
    • Обучение и сертификация
    • Блог
    • Документация
    • Контент-программа
    • Мероприятия и вебинары
    • Контакты, чаты и сообщества
    • Идеи
    • Истории успеха
    • Тарифы Yandex Cloud
    • Промоакции и free tier
    • Правила тарификации
  • Документация
  • Блог
Проект Яндекса
© 2025 ООО «Яндекс.Облако»
Yandex Translate
  • Начало работы
    • Обзор
    • Аутентификация в API
      • Overview
        • Overview
        • Translate
        • DetectLanguage
        • ListLanguages
  • Управление доступом
  • Правила тарификации

В этой статье:

  • HTTP request
  • Body parameters
  • TranslateGlossaryConfig
  • GlossaryData
  • GlossaryPair
  • Response
  • TranslatedText
  1. Справочник API
  2. REST v2 (англ.)
  3. Translation
  4. Translate

Translate API v2, REST: Translation.Translate

Статья создана
Yandex Cloud
Обновлена 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.

Была ли статья полезна?

Предыдущая
Overview
Следующая
DetectLanguage
Проект Яндекса
© 2025 ООО «Яндекс.Облако»