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

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

  • HTTP request
  • Body parameters
  • GenSearchMessage
  • SiteOption
  • HostOption
  • UrlOption
  • SearchFilter
  • SearchMetadata
  • Response
  • GenSearchMessage
  • Source
  • SearchQuery
  1. Справочник API
  2. API
  3. REST (англ.)
  4. GenSearch
  5. Search

Web Search API, REST: GenSearch.Search

Статья создана
Yandex Cloud
Обновлена 15 декабря 2025 г.
  • HTTP request
  • Body parameters
  • GenSearchMessage
  • SiteOption
  • HostOption
  • UrlOption
  • SearchFilter
  • SearchMetadata
  • Response
  • GenSearchMessage
  • Source
  • SearchQuery

HTTP requestHTTP request

POST https://searchapi.api.cloud.yandex.net/v2/gen/search

Body parametersBody parameters

{
  "messages": [
    {
      "content": "string",
      "role": "string"
    }
  ],
  "folderId": "string",
  // Includes only one of the fields `site`, `host`, `url`
  "site": {
    "site": [
      "string"
    ]
  },
  "host": {
    "host": [
      "string"
    ]
  },
  "url": {
    "url": [
      "string"
    ]
  },
  // end of the list of possible fields
  "fixMisspell": "boolean",
  "enableNrfmDocs": "boolean",
  "searchFilters": [
    {
      // Includes only one of the fields `date`, `lang`, `format`
      "date": "string",
      "lang": "string",
      "format": "string"
      // end of the list of possible fields
    }
  ],
  "searchType": "string",
  "getPartialResults": "boolean",
  "metadata": {
    "fields": "object"
  }
}

Field

Description

messages[]

GenSearchMessage

Single search query or a search query with context in the form of chat with the model.

The number of elements must be in the range 1-100.

folderId

string

Required field. ID of the folder.

The maximum string length in characters is 50.

site

SiteOption

Includes only one of the fields site, host, url.

Restricts the search to the specific websites, hosts or pages.

host

HostOption

Includes only one of the fields site, host, url.

Restricts the search to the specific websites, hosts or pages.

url

UrlOption

Includes only one of the fields site, host, url.

Restricts the search to the specific websites, hosts or pages.

fixMisspell

boolean

Fix query misspells.

enableNrfmDocs

boolean

Use the documents inaccessible from the site's front page.

searchFilters[]

SearchFilter

Restricts the search by date, document formats or language.

The maximum number of elements is 10.

searchType

enum (SearchType)

Search type that determines the domain name that will be used for the search queries.

  • SEARCH_TYPE_RU: Russian search type (default), yandex.ru search domain name will be used.
  • SEARCH_TYPE_TR: Turkish search type, yandex.tr search domain name will be used.
  • SEARCH_TYPE_COM: International search type, yandex.com search domain name will be used.
  • SEARCH_TYPE_KK: Kazakh search type, yandex.kz search domain name will be used.
  • SEARCH_TYPE_BE: Belarusian search type, yandex.by search domain name will be used.
  • SEARCH_TYPE_UZ: Uzbek search type, yandex.uz search domain name will be used.

getPartialResults

boolean

Get partial results

metadata

SearchMetadata

Search flags

GenSearchMessageGenSearchMessage

Field

Description

content

string

Required field. Text of user query or the model's response (depending on the role value).

The maximum string length in characters is 16384.

role

enum (Role)

Required field. Message sender's role

  • ROLE_USER: The message is sent by the user.
  • ROLE_ASSISTANT: The message is sent by the model.

SiteOptionSiteOption

Field

Description

site[]

string

Restricts the search to the specific websites.

The maximum string length in characters for each value is 1024. The maximum number of elements is 100.

HostOptionHostOption

Field

Description

host[]

string

Restricts the search to the specific hosts.

The maximum string length in characters for each value is 1024. The maximum number of elements is 100.

UrlOptionUrlOption

Field

Description

url[]

string

Restricts the search to the specific pages.

The maximum string length in characters for each value is 1024. The maximum number of elements is 100.

SearchFilterSearchFilter

Field

Description

date

string

Restrict by document date. See https://yandex.ru/support/search/ru/query-language/search-operators details.

The maximum string length in characters is 25.

Includes only one of the fields date, lang, format.

lang

string

Restrict by document language. Use ISO 639-1 language codes.

Includes only one of the fields date, lang, format.

format

enum (DocFormat)

Restrict by document format.

Includes only one of the fields date, lang, format.

  • DOC_FORMAT_PDF
  • DOC_FORMAT_XLS
  • DOC_FORMAT_ODS
  • DOC_FORMAT_RTF
  • DOC_FORMAT_PPT
  • DOC_FORMAT_ODP
  • DOC_FORMAT_SWF
  • DOC_FORMAT_ODT
  • DOC_FORMAT_ODG
  • DOC_FORMAT_DOC

SearchMetadataSearchMetadata

Field

Description

fields

object (map<string, string>)

Search flags, key:value pairs.
No more than 64.
The maximum string length in characters for each value is 63.
Each value must match the regular expression [-_0-9a-z]*.
The string length in characters for each key must be 1-63.
Each key must match the regular expression [a-z][-_0-9a-z]*.

No more than 64 per resource. The maximum string length in characters for each value is 63. Each value must match the regular expression [-_0-9a-z]*. The string length in characters for each key must be 1-63. Each key must match the regular expression [a-z][-_0-9a-z]*.

ResponseResponse

HTTP Code: 200 - OK

{
  "message": {
    "content": "string",
    "role": "string"
  },
  "sources": [
    {
      "url": "string",
      "title": "string",
      "used": "boolean"
    }
  ],
  "searchQueries": [
    {
      "text": "string",
      "reqId": "string"
    }
  ],
  "fixedMisspellQuery": "string",
  "isAnswerRejected": "boolean",
  "isBulletAnswer": "boolean",
  "hints": [
    "string"
  ],
  "problematicAnswer": "boolean"
}

Field

Description

message

GenSearchMessage

The text of the generative response.

sources[]

Source

The documents used to form the generative response.

searchQueries[]

SearchQuery

The search queries, refined by the YandexGPT model and used for the generative response.

fixedMisspellQuery

string

The text of the search query with fixed misspells.

isAnswerRejected

boolean

The model failed to answer due to the ethical concerns.

isBulletAnswer

boolean

A bullet answer in case the model cannot give a proper response and returns a set of bullets with various data.

hints[]

string

Search hints

problematicAnswer

boolean

The answer may contain inappropriate content

GenSearchMessageGenSearchMessage

Field

Description

content

string

Required field. Text of user query or the model's response (depending on the role value).

The maximum string length in characters is 16384.

role

enum (Role)

Required field. Message sender's role

  • ROLE_USER: The message is sent by the user.
  • ROLE_ASSISTANT: The message is sent by the model.

SourceSource

Field

Description

url

string

Document URL.

title

string

Document title.

used

boolean

The document was used in the answer.

SearchQuerySearchQuery

Field

Description

text

string

Query text.

reqId

string

Query ID in Yandex Search.

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

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