Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Search API
  • Getting started
    • Overview
    • Text search
    • XML response
    • HTML response
    • Generative response
    • Image search
    • Quotas and limits
  • Access management
  • Pricing policy
  • Audit Trails events
  • Release notes

In this article:

  • Searching by text description
  • API request body format
  • XML response format
  • Searching by image
  • API request body format
  • JSON response format
  1. Concepts
  2. Image search

Image search

Written by
Yandex Cloud
Improved by
magician-neko
Updated at November 27, 2025
  • Searching by text description
    • API request body format
    • XML response format
  • Searching by image
    • API request body format
    • JSON response format

With Yandex Search API, you can search for images through the Yandex Images index either by text description or image. The search parameters, together with your search query or source image, should be provided in the request body. Depending on search type, Yandex Search API returns its response as an XML or JSON document.

Searching by text descriptionSearching by text description

To search by text description, provide your search parameters in the request body and get your search result in XML format.

Note

For parameters and examples of search queries via the Yandex Cloud ML SDK, see Searching by text description.

API request body formatAPI request body format

The names of the request body fields are different in REST API and gRPC API: the former uses CamelCase, while the latter, snake_case.

REST API
gRPC API
{
  "query": {
    "searchType": "<search_type>",
    "queryText": "<search_query_text>",
    "familyMode": "<result_filter_setting_value>",
    "page": "<page_number>",
    "fixTypoMode": "<typo_correction_mode_setting_value>"
  },
  "imageSpec": {
    "format": "<image_format>",
    "size": "<image_size>",
    "orientation": "<image_orientation>",
    "color": "<image_color>"
  },
  "site": "<website_domain_name>",
  "docsOnPage": "<results_per_page>",
  "folderId": "<folder_ID>",
  "userAgent": "<User-Agent_header>"
}

Description of fields:

  • searchType: Search type. The possible values are:

    • SEARCH_TYPE_RU: For the Russian search type.
    • SEARCH_TYPE_TR: For the Turkish search type.
    • SEARCH_TYPE_COM: For the International search type.
    • SEARCH_TYPE_KK: For the Kazakh search type.
    • SEARCH_TYPE_BE: For the Belarusian search type.
    • SEARCH_TYPE_UZ: For the Uzbek search type.
  • queryText: Search query text. The maximum length is 400 characters.

  • familyMode: Results filtering. This is an optional parameter. The possible values are:

    • FAMILY_MODE_MODERATE: Moderate filter (default). Adult category documents are excluded from search results unless the query explicitly targets resources of this category.
    • FAMILY_MODE_NONE: Filtering is off. Search results include any documents regardless of their contents.
    • FAMILY_MODE_STRICT: Family filter. Regardless of the search query, Adult category documents and documents containing profanity are excluded from search results.
  • page: Requested page number. This is an optional parameter. By default, the first page with search results is returned. Page numbering starts from zero (0 stands for page one).

  • fixTypoMode: Search query typo correction setting. This is an optional parameter. The possible values are:

    • FIX_TYPO_MODE_ON: Typo correction enabled (default). Search query typos are corrected automatically.
    • FIX_TYPO_MODE_OFF: Typo correction disabled. Search query typos are not corrected. The search is performed strictly as per the query.
  • format: Searching for images of specified format. This is an optional parameter. If not set, the search includes images of all formats. The possible values are:

    • IMAGE_FORMAT_JPEG: JPG
    • IMAGE_FORMAT_GIF: GIF
    • IMAGE_FORMAT_PNG: PNG
  • size: Searching for images of specified size. This is an optional parameter. If not set, the search includes images of all sizes. The possible values are:

    • IMAGE_SIZE_ENORMOUS: Very large images (over 1600 × 1200 in pixels).
    • IMAGE_SIZE_LARGE: Large images (from 800 × 600 to 1600 × 1200 in pixels).
    • IMAGE_SIZE_MEDIUM: Medium images (from 150 × 150 to 800 × 600 in pixels).
    • IMAGE_SIZE_SMALL: Small images (from 32 × 32 to 150 × 150 in pixels).
    • IMAGE_SIZE_TINY: Icons (up to 32 × 32 in pixels).
    • IMAGE_SIZE_WALLPAPER: Wallpaper images.
  • orientation: Searching for images of specified orientation. This is an optional parameter. If not set, the search includes images of any orientation. The possible values are:

    • IMAGE_ORIENTATION_VERTICAL: Vertical images.
    • IMAGE_ORIENTATION_HORIZONTAL: Horizontal images.
    • IMAGE_ORIENTATION_SQUARE: Square aspect ratio images.
  • color: Searching for images with specified color parameters. This is an optional parameter. If not set, the search includes images with any color parameters. The possible values are:

    • IMAGE_COLOR_COLOR: Colored images.
    • IMAGE_COLOR_GRAYSCALE: Grayscale images.
    • IMAGE_COLOR_RED: Images with red as the main color.
    • IMAGE_COLOR_ORANGE: Images with orange as the main color.
    • IMAGE_COLOR_YELLOW: Images with yellow as the main color.
    • IMAGE_COLOR_GREEN: Images with green as the main color.
    • IMAGE_COLOR_CYAN: Images with cyan as the main color.
    • IMAGE_COLOR_BLUE: Images with blue as the main color.
    • IMAGE_COLOR_VIOLET: Images with violet as the main color.
    • IMAGE_COLOR_WHITE: Images with white as the main color.
    • IMAGE_COLOR_BLACK: Images with black as the main color.
  • site: Searching for images only on specified website, e.g., yandex.cloud. This is an optional parameter. If not set, the search includes all websites in the search base.

  • docsOnPage: Number of result groups displayed per search result page. You can specify values between 1 and 60. This is an optional parameter. The default value is 20.

  • folderId: Folder ID of the user or service account you will use for queries.

  • userAgent: String containing the User-Agent header. Use this parameter to have your search results optimized for a specific device and browser, including mobile search results. This is an optional parameter. If not specified, you will get the default output.

{
  "query": {
    "search_type": "<search_type>",
    "query_text": "<search_query_text>",
    "family_mode": "<result_filter_setting_value>",
    "page": "<page_number>",
    "fix_typo_mode": "<typo_correction_mode_setting_value>"
  },
  "image_spec": {
    "format": "<image_format>",
    "size": "<image_size>",
    "orientation": "<image_orientation>",
    "color": "<image_color>"
  },
  "site": "<website_domain_name>",
  "docs_on_page": "<results_per_page>",
  "folder_id": "<folder_ID>",
  "user_agent": "<User-Agent_header>"
}

Description of fields:

  • search_type: Search type. The possible values are:

    • SEARCH_TYPE_RU: For the Russian search type.
    • SEARCH_TYPE_TR: For the Turkish search type.
    • SEARCH_TYPE_COM: For the International search type.
    • SEARCH_TYPE_KK: For the Kazakh search type.
    • SEARCH_TYPE_BE: For the Belarusian search type.
    • SEARCH_TYPE_UZ: For the Uzbek search type.
  • query_text: Search query text. The maximum length is 400 characters.

  • family_mode: Results filtering. This is an optional parameter. The possible values are:

    • FAMILY_MODE_MODERATE: Moderate filter (default). Adult category documents are excluded from search results unless the query explicitly targets resources of this category.
    • FAMILY_MODE_NONE: Filtering is off. Search results include any documents regardless of their contents.
    • FAMILY_MODE_STRICT: Family filter. Regardless of the search query, Adult category documents and documents containing profanity are excluded from search results.
  • page: Requested page number. This is an optional parameter. By default, the first page with search results is returned. Page numbering starts from zero (0 stands for page one).

  • fix_typo_mode: Search query typo correction setting. This is an optional parameter. The possible values are:

    • FIX_TYPO_MODE_ON: Typo correction enabled (default). Search query typos are corrected automatically.
    • FIX_TYPO_MODE_OFF: Typo correction disabled. Search query typos are not corrected. The search is performed strictly as per the query.
  • format: Searching for images of specified format. This is an optional parameter. If not set, the search includes images of all formats. The possible values are:

    • IMAGE_FORMAT_JPEG: JPG
    • IMAGE_FORMAT_GIF: GIF
    • IMAGE_FORMAT_PNG: PNG
  • size: Searching for images of specified size. This is an optional parameter. If not set, the search includes images of all sizes. The possible values are:

    • IMAGE_SIZE_ENORMOUS: Very large images (over 1600 × 1200 in pixels).
    • IMAGE_SIZE_LARGE: Large images (from 800 × 600 to 1600 × 1200 in pixels).
    • IMAGE_SIZE_MEDIUM: Medium images (from 150 × 150 to 800 × 600 in pixels).
    • IMAGE_SIZE_SMALL: Small images (from 32 × 32 to 150 × 150 in pixels).
    • IMAGE_SIZE_TINY: Icons (up to 32 × 32 in pixels).
    • IMAGE_SIZE_WALLPAPER: Wallpaper images.
  • orientation: Searching for images of specified orientation. This is an optional parameter. If not set, the search includes images of any orientation. The possible values are:

    • IMAGE_ORIENTATION_VERTICAL: Vertical images.
    • IMAGE_ORIENTATION_HORIZONTAL: Horizontal images.
    • IMAGE_ORIENTATION_SQUARE: Square aspect ratio images.
  • color: Searching for images with specified color parameters. This is an optional parameter. If not set, the search includes images with any color parameters. The possible values are:

    • IMAGE_COLOR_COLOR: Colored images.
    • IMAGE_COLOR_GRAYSCALE: Grayscale images.
    • IMAGE_COLOR_RED: Images with red as the main color.
    • IMAGE_COLOR_ORANGE: Images with orange as the main color.
    • IMAGE_COLOR_YELLOW: Images with yellow as the main color.
    • IMAGE_COLOR_GREEN: Images with green as the main color.
    • IMAGE_COLOR_CYAN: Images with cyan as the main color.
    • IMAGE_COLOR_BLUE: Images with blue as the main color.
    • IMAGE_COLOR_VIOLET: Images with violet as the main color.
    • IMAGE_COLOR_WHITE: Images with white as the main color.
    • IMAGE_COLOR_BLACK: Images with black as the main color.
  • site: Searching for images only on specified website, e.g., yandex.cloud. This is an optional parameter. If not set, the search includes all websites in the search base.

  • docs_on_page: Number of result groups displayed per search result page. You can specify values between 1 and 60. This is an optional parameter. The default value is 20.

  • folder_id: Folder ID of the user or service account you will use for queries.

  • user_agent: String containing the User-Agent header. Use this parameter to have your search results optimized for a specific device and browser, including mobile search results. This is an optional parameter. If not specified, you will get the default output.

XML response formatXML response format

In response to a text search query, Yandex Search API returns a UTF-8 encoded XML file with search results.

The XML file consists of request (with summarized information about the request parameters) and response (with search query processing results) grouping tags.

Note

The response contains no required fields. It may not return a field if there is no relevant data.

Response exampleResponse example

<?xml version="1.0" encoding="utf-8"?>
<yandexsearch version="1.0">
  <request>
    <query>kittens</query>
    <page>0</page>
    <sortby order="descending" priority="no">rlv</sortby>
    <maxpassages>1</maxpassages>
    <groupings>
      <groupby attr="ii" mode="deep" groups-on-page="1" docs-in-group="1" curcateg="-1"/>
    </groupings>
  </request>
  <response date="20250530T143927">
    <reqid>1748615967169172-2797787793510975009-balancer-l7leveler-kubr-yp-vla-257-BAL</reqid>
    <found priority="phrase">6558</found>
    <found priority="strict">6558</found>
    <found priority="all">6558</found>
    <found-human>3 thsd. answers found</found-human>
    <is-local>no</is-local>
    <results>
      <grouping attr="ii" mode="deep" groups-on-page="20" docs-in-group="1" curcateg="-1">
        <page first="1" last="20">0</page>
        <group>
          <categ attr="ii" id="2606553042332394200"/>
          <doccount>1</doccount>
          <relevance priority="all"/>
          <doc id="Z493B41CD68505D32">
            <relevance priority="all"/>
            <url>https://***.*****.**/wp-content/uploads/2015/08/three-kittens.jpg</url>
            <domain>***.*****.**</domain>
            <modtime>20191126T135649</modtime>
            <size>0</size>
            <charset>utf-8</charset>
            <image-properties>
              <id>082c71c2963a0b5859ac6de15743c7d661c76f4b-4665500-images-thumbs</id>
              <shard>0</shard>
              <thumbnail-link>http://avatars.mds.yandex.net/i?id=082c71c2963a0b5859ac6de15743c7d661c76f4b-4665500-images-thumbs</thumbnail-link>
              <thumbnail-width>320</thumbnail-width>
              <thumbnail-height>320</thumbnail-height>
              <original-width>1374</original-width>
              <original-height>1374</original-height>
              <html-link>****************.com/category/enforcement/page/4/</html-link>
              <image-link>****************.com/wp-content/uploads/2015/06/kittens1</image-link>
              <file-size>130963</file-size>
              <mime-type>jpg</mime-type>
            </image-properties>
            <mime-type>text/html</mime-type>
            <properties/>
          </doc>
        </group>
        <found priority="phrase">2348</found>
        <found priority="strict">2348</found>
        <found priority="all">2348</found>
        <found-docs priority="phrase">2348</found-docs>
        <found-docs priority="strict">2348</found-docs>
        <found-docs priority="all">2348</found-docs>
        <found-docs-human>found 1 thsd. answers</found-docs-human>
      </grouping>
    </results>
  </response>
</yandexsearch>

request sectionrequest section

The request group provides aggregate information about request parameters. It may be missing if there are errors in the response.

Request group tags

Description

Attributes

query

Search query text

None

page

Number of returned search results page. Page numbering starts from zero (0 stands for page one).

None

sortby

Result sorting parameters. Service tag, takes the rlv value: sorting by relevance.

  • order: Sorting order. Service attribute, takes the descending value (reverse sorting order).
  • priority: Service attribute. Takes the no value.

maxpassages

Maximum number of text snippets generated for each image. Service tag, takes the 1 value.

None

groupings

Grouping tag.

It contains grouping parameters in the groupby tag.

None

groupby

Parameters for grouping the search results.

  • attr: Service attribute, takes the ii value.
  • mode: Grouping method. Service attribute, takes the deep value.
  • groups-on-page: Maximum number of search result groups per page.
  • docs-in-group: Maximum number of images per group. Service attribute, takes the 1 value.
  • curcateg: Service attribute. Takes the -1 value.

response sectionresponse section

Search query processing results. Contains the date attribute for query date and time (UTC) in <year><month><day>T<hour><minute><second> format.

Consists of the following sections:

  • General search results info.
  • results section.
General search results infoGeneral search results info

General search results info tags

Description

Attributes

error

Error description

Used only if a search query is handled incorrectly (e.g., if the query is empty or parameters are incorrect).

In some cases, it is mutually exclusive with other tags of the response grouping tag.

code: Error code.

reqid

Unique query ID

None

found

Estimated number of images found based on the query.

priority: Service attribute. The possible values are:

  • phrase
  • strict
  • all

found-human

A string in the language matching the selected search type. It shows the number of found images and related information.

None

results sectionresults section

This is an optional section. It is present if results are found for the query.

results section tags

Description

Attributes

results

Grouping tag. Child tags contain information about search parameters and found images.

None

grouping

Grouping tag. Child tags contain information about search parameters and found images.

Attributes reflect the grouping rules for found images.

  • attr: Service attribute, takes the ii value.
  • mode: Grouping method. Service attribute, takes the deep value.
  • groups-on-page: Maximum number of search result groups per page.
  • docs-in-group: Maximum number of images per group. Service attribute, takes the 1 value.
  • curcateg: Service attribute. Takes the -1 value.

page

Number of returned search results page. Page numbering starts from zero (0 stands for page one).

  • first: Sequence number of the first search results group displayed on the page.
  • last: Sequence number of the last search results group displayed on the page.

group

Grouping tag.

Each group tag contains information about one group of images. As each image group contains only one image, the tag provides information about one image.

None

categ

Description of the found image.

  • attr: Grouping name. Same as the attr attribute value under the groupby tag in the request element.
  • id: ID of the image host.

doccount

Service tag.

None

relevance

Service tag.

priority: Service attribute.

doc

Grouping tag.

Each doc tag contains information about one found image.

id: Unique ID of the found image.

relevance

Service tag.

priority: Service attribute.

url

Image address.

None

domain

Domain hosting the document containing the image.

None

modtime

Image modification date and time (UTC) in <year><month><day>T<hour><minute><second> format.

None

size

Image size in bytes.

None

charset

Encoding of the document containing the image.

None

image-properties

Grouping tag.

Contains the image properties information to include in search results.

None

id

Image thumbnail ID.

None

shard

Number of the shard containing the image information.

None

thumbnail-link

Image thumbnail address.

None

thumbnail-width

Image thumbnail width in pixels.

None

thumbnail-height

Image thumbnail height in pixels.

None

original-width

Width of the source (original) image.

None

original-height

Height of the source (original) image.

None

html-link

Image page address.

None

image-link

Image address.

None

file-size

Image size in bytes.

None

mime-type

Image format (JPG, GIF, or PNG).

None

mime-type

Format of the document containing the image.

None

found

Estimated number of generated groups.

priority: Service attribute. The possible values are:

  • phrase
  • strict
  • all

found-docs

Estimated number of images found based on the query.

It is a more accurate estimate compared to the value provided in the found tag of the general search results info section.

priority: Service attribute. The possible values are:

  • phrase
  • strict
  • all

found-docs-human

A string in the language matching the selected search type. It shows the number of found images and related information.

The value being provided must be used when generating search results.

None

Searching by imageSearching by image

To search by image, provide the image and your search parameters in the request body and get your search result in JSON format.

Note

For parameters and examples of search queries via the Yandex Cloud ML SDK, see Searching for images by image.

API request body formatAPI request body format

The names of the request body fields are different in REST API and gRPC API: the former uses CamelCase, while the latter, snake_case.

REST API
gRPC API
{
  "site": "<website_domain_name>",
  "folderId": "<folder_ID>",
  "url": "<source_image_URL>",
  "data": "<image_data>",
  "id": "<CBIR_ID>",
  "page": "<page_number>"
}

Description of fields:

  • site: Searching for images only on specified website, e.g., yandex.cloud. This is an optional setting. If not set, the search includes all websites in the search base.

  • folderId: Folder ID of the user or service account you will use for queries.

  • url: Source image URL.

  • data: Source image data, Base64-encoded.

  • id: Source image CBIR ID. Specify the ID you got in the response to get the next search result page faster.

    Note

    You can provide only one of these parameters in your query: url, id, or data.

  • page: Requested page number. This is an optional setting. By default, the first page with search results is returned. Page numbering starts from zero (0 stands for page one).

{
  "site": "<website_domain_name>",
  "folder_id": "<folder_ID>",
  "url": "<source_image_URL>",
  "data": "<image_data>",
  "id": "<CBIR_ID>",
  "page": "<page_number>"
}

Description of fields:

  • site: Searching for images only on specified website, e.g., yandex.cloud. This is an optional setting. If not set, the search includes all websites in the search base.

  • folder_id: Folder ID of the user or service account you will use for queries.

  • url: Source image URL.

  • data: Source image data, Base64-encoded.

  • id: Source image CBIR ID. Specify the ID you got in the response to get the next search result page faster.

    Note

    You can provide only one of these parameters in your query: url, id, or data.

  • page: Requested page number. This is an optional setting. By default, the first page with search results is returned. Page numbering starts from zero (0 stands for page one).

JSON response formatJSON response format

In response to a query by image, Yandex Search API returns a UTF-8 encoded JSON file with the search results.

Response exampleResponse example

REST API
gRPC API
{
  "images": [
    {
      "url": "https://cs10.pikabu.ru/post_img/2019/10/29/8/og_og_1572352646221687176.jpg",
      "format": "IMAGE_FORMAT_JPEG",
      "width": "570",
      "height": "960",
      "passage": "This Pin was discovered by Some Dude.",
      "host": "www.pinterest.com",
      "pageTitle": "How to enrich your cute cats' life? Cute cats, Indoor cat, Cats",
      "pageUrl": "https://www.pinterest.com/pin/how-to-enrich-your-cute-cats-life--703194929319013467/"
    },
    ...
  ],
  "page": "3",
  "id": "1716254/_KnCt2T9gLh4z8SSv8nVqQ7277"
}

Description of fields:

  • images: Array of objects with information about found images:

    • url: Image URL.

    • format: Image format:

      • IMAGE_FORMAT_JPEG: JPG
      • IMAGE_FORMAT_GIF: GIF
      • IMAGE_FORMAT_PNG: PNG format.
    • width: Image width in pixels.

    • height: Image height in pixels.

    • passage: Text snippet describing the image.

    • host: Domain hosting the document containing the image.

    • pageTitle: Image page title.

    • pageUrl: Image page URL.

  • page: Current search results page number.

  • id: Source image CBIR ID.

{
  "images": [
    {
      "url": "https://cs10.pikabu.ru/post_img/2019/10/29/8/og_og_1572352646221687176.jpg",
      "format": "IMAGE_FORMAT_JPEG",
      "width": "570",
      "height": "960",
      "passage": "This Pin was discovered by Some Dude.",
      "host": "www.pinterest.com",
      "page_title": "How to enrich your cute cats' life? Cute cats, Indoor cat, Cats",
      "page_url": "https://www.pinterest.com/pin/how-to-enrich-your-cute-cats-life--703194929319013467/"
    },
    ...
  ],
  "page": "3",
  "id": "1716254/_KnCt2T9gLh4z8SSv8nVqQ7277"
}

Description of fields:

  • images: Array of objects with information about found images:

    • url: Image URL.

    • format: Image format:

      • IMAGE_FORMAT_JPEG: JPG
      • IMAGE_FORMAT_GIF: GIF
      • IMAGE_FORMAT_PNG: PNG format.
    • width: Image width in pixels.

    • height: Image height in pixels.

    • passage: Text snippet describing the image.

    • host: Domain hosting the document containing the image.

    • page_title: Image page title.

    • page_url: Image page URL.

  • page: Current search results page number.

  • id: Source image CBIR ID.

See alsoSee also

  • Searching by text description
  • Searching for images by image
  • API authentication

Was the article helpful?

Previous
Generative response
Next
Quotas and limits
© 2025 Direct Cursus Technology L.L.C.