openapi: 3.0.0
info:
  title: Yandex Images API
  description: >-
    Search Yandex Images with size, wallpaper, aspect ratio, image type, color, format, website, and SafeSearch filters.
    Results include original image URLs, source pages, dimensions, thumbnails, and suggested queries. Use an original image
    URL with the Yandex Reverse Image API to find visual matches.
  version: 1.0.0
servers:
- url: https://www.searchapi.io/api/v1
paths:
  "/search":
    get:
      summary: Yandex Images Search
      security:
      - ApiKeyAuth: []
      - ApiKeyQuery: []
      parameters:
      - name: engine
        in: query
        required: true
        description: Set to yandex_images.
        schema:
          type: string
          enum: ["yandex_images"]
      - name: q
        in: query
        required: true
        description: Search terms used to find images.
        schema:
          type: string
      - name: yandex_domain
        in: query
        required: false
        description: Yandex domain to search.
        schema:
          type: string
          enum: ["yandex.com","yandex.ru","ya.ru","yandex.by","yandex.kz","yandex.uz","yandex.com.tr","yandex.fr","yandex.az","yandex.com.ge","yandex.com.am","yandex.co.il","yandex.lv","yandex.lt","yandex.ee","yandex.md","yandex.tm","yandex.tj","yandex.eu"]
          default: "yandex.com"
      - name: location
        in: query
        required: false
        description: Location ID used to localize results.
        schema:
          "$ref": "#/components/schemas/YandexLocation"
      - name: size
        in: query
        required: false
        description: Filter by image size category. Combine wallpaper with aspect_ratio to choose desktop (wide) or phone (tall) wallpapers.
        schema:
          type: string
          enum: ["large","medium","small","wallpaper"]
      - name: exact_size
        in: query
        required: false
        description: Exact image dimensions in WIDTHxHEIGHT format. Overrides size.
        schema:
          type: string
          pattern: "^(?:[1-9]\\d{0,4}|100000)x(?:[1-9]\\d{0,4}|100000)$"
      - name: safe_search
        in: query
        required: false
        description: Adult content filtering mode.
        schema:
          type: string
          enum: ["off","moderate","strict"]
          default: "moderate"
      - name: aspect_ratio
        in: query
        required: false
        description: Filter by aspect ratio.
        schema:
          type: string
          enum: ["wide","tall","square"]
      - name: image_type
        in: query
        required: false
        description: Filter by Yandex image classifications. The clipart value selects white backgrounds, and line_drawing selects drawings and illustrations.
        schema:
          type: string
          enum: ["photo","clipart","line_drawing","face","demotivator"]
      - name: color
        in: query
        required: false
        description: Filter by image color.
        schema:
          type: string
          enum: ["color","black_and_white","red","orange","yellow","cyan","green","blue","violet","white","black"]
      - name: file_type
        in: query
        required: false
        description: Filter by file format. The gif value selects animated images.
        schema:
          type: string
          enum: ["jpg","png","gif"]
      - name: site
        in: query
        required: false
        description: Restrict results to a domain and its subdomains. URLs are reduced to their hostname.
        schema:
          type: string
      - name: page
        in: query
        required: false
        description: Page number from 1 to 41 for yandex.ru, ya.ru, and yandex.fr, or 1 to 2 for other domains and locations in Belarus or Kazakhstan.
        schema:
          type: integer
          minimum: 1
          default: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/SearchResponse"
        '400':
          description: Validation Error. There is an issue with query parameters, such as missing required parameters or invalid
            values.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
        '401':
          description: Authentication Error. The API key is missing or invalid.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
        '429':
          description: >-
            Rate Limit Exceeded. The number of allowed requests has been exceeded. Consider upgrading your plan or waiting
            for the limit to reset.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
        '500':
          description: Server Error. Internal server error.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
        '503':
          description: Timeout. We could not retrieve results in 90 seconds.
          content:
            application/json:
              schema:
                "$ref": "#/components/schemas/ErrorResponse"
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Use Bearer authentication. Format: "Bearer YOUR_API_KEY"'
    ApiKeyQuery:
      type: apiKey
      in: query
      name: api_key
      description: Pass API key as query parameter
  schemas:
    SearchResponse:
      type: object
      properties:
        search_metadata:
          "$ref": "#/components/schemas/SearchMetadata"
        search_parameters:
          "$ref": "#/components/schemas/SearchParameters"
        search_information:
          "$ref": "#/components/schemas/SearchInformation"
        suggestions:
          type: array
          items:
            "$ref": "#/components/schemas/Suggestion"
        images:
          type: array
          items:
            "$ref": "#/components/schemas/Image"
        related_searches:
          type: array
          items:
            "$ref": "#/components/schemas/RelatedSearch"
        pagination:
          "$ref": "#/components/schemas/Pagination"
        error:
          type: string
          description: Message describing an empty result set.
    SearchMetadata:
      type: object
      required:
      - id
      - status
      - created_at
      properties:
        id:
          type: string
          description: Unique identifier for the search request
        status:
          type: string
          description: Status of the search request
        created_at:
          type: string
          format: date-time
          description: Timestamp when the search was created
        request_time_taken:
          type: number
          description: Time taken to make the request in seconds
        parsing_time_taken:
          type: number
          description: Time taken to parse the results in seconds
        total_time_taken:
          type: number
          description: Total time taken for the search in seconds
        request_url:
          type: string
          description: Yandex Images URL for this search
        html_url:
          type: string
          description: URL to view HTML results
        json_url:
          type: string
          description: URL to view JSON results
    SearchParameters:
      type: object
      properties:
        engine:
          type: string
          enum: ["yandex_images"]
          description: Set to yandex_images.
        q:
          type: string
          description: Search terms used to find images.
        yandex_domain:
          type: string
          enum: ["yandex.com","yandex.ru","ya.ru","yandex.by","yandex.kz","yandex.uz","yandex.com.tr","yandex.fr","yandex.az","yandex.com.ge","yandex.com.am","yandex.co.il","yandex.lv","yandex.lt","yandex.ee","yandex.md","yandex.tm","yandex.tj","yandex.eu"]
          default: "yandex.com"
          description: Yandex domain to search.
        location:
          "$ref": "#/components/schemas/YandexLocation"
        size:
          type: string
          enum: ["large","medium","small","wallpaper"]
          description: Filter by image size category. Combine wallpaper with aspect_ratio to choose desktop (wide) or phone (tall) wallpapers.
        exact_size:
          type: string
          pattern: "^(?:[1-9]\\d{0,4}|100000)x(?:[1-9]\\d{0,4}|100000)$"
          description: Exact image dimensions in WIDTHxHEIGHT format. Overrides size.
        safe_search:
          type: string
          enum: ["off","moderate","strict"]
          default: "moderate"
          description: Adult content filtering mode.
        aspect_ratio:
          type: string
          enum: ["wide","tall","square"]
          description: Filter by aspect ratio.
        image_type:
          type: string
          enum: ["photo","clipart","line_drawing","face","demotivator"]
          description: Filter by Yandex image classifications. The clipart value selects white backgrounds, and line_drawing selects drawings and illustrations.
        color:
          type: string
          enum: ["color","black_and_white","red","orange","yellow","cyan","green","blue","violet","white","black"]
          description: Filter by image color.
        file_type:
          type: string
          enum: ["jpg","png","gif"]
          description: Filter by file format. The gif value selects animated images.
        site:
          type: string
          maxLength: 253
          description: Hostname the results are restricted to.
        page:
          type: string
          description: Page of results to return, starting at 1.
    YandexLocation:
      type: string
      enum: ["1095","20734","29386","11498","20742","11302","241","20167","99221","29403","102515","102501","29575","20273","29404","102508","102522","98745","20192","98697","10656","20826","20828","10328","162","102513","29406","102499","11121","21809","21808","11235","21797","21796","11471","11494","10466","21792","21791","11451","11375","100398","11458","1107","10329","105804","11256","101550","11276","10894","10715","105789","105790","245","93","20","10842","21895","21894","10987","105791","168","28892","11405","11406","11080","11160","11196","10324","100005","100944","183","797","798","163","37","10946","21867","21866","10418","86","10291","29407","102509","102523","211","138","829","830","113","122054","167","11030","10532","27217","24696","10253","11143","99817","10716","11144","99818","105950","10314","981","982","980","10620","10091","20098","100183","21015","100244","197","11111","11033","10278","129","10590","101524","149","893","894","11034","20714","99675","114","4","10645","21911","21910","10522","11374","99411","21632","10988","99269","20259","99677","11277","20579","10315","11314","20237","177","10513","11278","29397","10369","11393","10309","975","77","20729","20667","99044","98598","21174","10015","99008","10805","21193","102156","10906","99146","10057","223","10136","10489","976","94","153","29632","101859","101858","10717","10376","191","10650","21913","21912","10487","10398","11055","99456","10133","11122","10330","105805","115","11330","11006","11086","26021","102136","11485","20975","10391","95","1048","1049","10144","3","413","414","20243","110916","11224","45","11024","21891","21890","10761","98614","56","11225","21834","21833","11274","968","10363","20546","102451","102476","1104","20551","102498","966","102473","10365","20533","102468","102493","219","20862","134","114900","10313","68","10251","21785","21786","11156","21865","21864","166","957","958","98","21191","10633","33883","10425","21131","977","978","979","115092","10083","20574","125","11010","11411","105951","21627","196980","196979","203","11007","89","10530","11155","10723","98582","102457","102482","141","20537","21487","214","20917","10725","142","20536","102456","102481","11499","10426","215","10318","972","26018","21735","102159","27555","29408","102502","102516","20785","1056","29590","20523","21642","1094","116782","11147","99850","11057","179","111","733","734","73","605","606","11469","123","124","100","21619","10783","98959","10867","98623","11087","10990","169","11056","96","701","702","11150","26025","102180","21646","155","29631","101855","101854","102138","26774","11319","246","10274","29634","101861","101860","1106","20968","10646","11228","11037","122055","10661","10259","132","103901","178","10552","97","10493","109044","116","116779","994","10095","101738","11012","10941","10063","63","11266","21799","21798","11173","20718","99694","20100","10614","181","765","766","10731","98586","205","102471","102496","10345","5","10687","21919","21918","21623","20733","21521","44","10574","137","114139","130","10243","21784","21783","21606","105806","10535","20234","22","10857","21899","21898","102235","102104","11015","6","10693","21921","21920","21794","11398","21793","11043","11164","10959","10895","101749","11020","21883","21882","164","29411","102500","102514","20101","100189","21675","100278","10331","10732","98587","105807","10773","11008","99275","11306","159","925","926","43","64","21800","11282","21801","11464","76","11457","21790","21789","11340","11193","21832","21831","57","109046","147","20538","102455","102480","11011","962","20542","102462","102487","10758","961","20535","102465","102490","193331","21645","143","20544","101864","101865","10811","10689","10870","98624","10871","98625","46","11070","21838","21837","11071","20548","102453","102478","10872","98626","10663","98750","11283","11062","11009","26006","102141","10733","98588","10653","26010","102089","11180","20809","10734","11349","100280","26081","20293","10939","21909","21908","11453","10812","99019","10934","99193","11207","116960","135","20728","10295","102518","29412","102504","10935","7","10699","21923","21922","105793","10846","10664","20554","100471","35","10995","21871","21870","10735","98590","27693","11165","20691","62","21803","21802","11309","21647","21609","26015","102144","10996","20221","26022","102162","10997","99281","10347","20044","99555","10604","21625","11113","20707","53","11158","21826","21825","8","10705","21925","21924","11166","10537","11101","122062","207","11333","21050","29413","102512","102526","11181","206","105952","11285","24702","98591","11167","21144","102125","21157","9","10712","21927","21926","10478","117","10492","21641","10393","200","21635","10876","222","20540","102458","102483","10737","98593","20222","21203","98629","144","20529","102464","102489","20244","21630","10738","98594","10435","79","11403","21782","21781","20181","235","28","24876","10097","10098","10605","10697","98826","10069","102510","102524","29414","10629","21840","21839","10366","20063","99832","1093","11182","20715","99703","10367","20271","20272","11287","11212","10803","1004","1054","1055","10965","11063","157","29630","101853","101852","11310","102186","21271","158","29629","101863","101862","208","115674","115675","102165","26001","10896","10099","21610","11117","10020","213","1","349","350","102126","26007","10739","98595","21274","102108","122058","99","23","10897","21901","21900","10668","20543","102461","10836","99070","11288","10740","98596","236","11229","100028","21745","974","30","21314","105809","10741","98597","1092","11114","11184","10176","11437","101987","118","20160","11064","20654","202","139","21231","20575","20741","148","102486","11127","11268","100109","1091","11168","47","11079","21842","21841","11169","10742","11311","10002","102444","102445","102446","29416","102506","102520","10068","17","445","446","119","10904","21903","21902","11246","37133","238","20117","26836","102127","11135","237","10830","26030","970","11049","65","11316","21805","21804","11090","20070","11170","11230","11231","10337","11186","967","145","20541","102460","102485","10743","98599","20235","20155","21586","66","11318","21807","21806","10745","48","11084","21844","21843","10276","102187","11091","10","10772","21929","21928","10310","26012","102149","10467","10818","99028","669","21943","102469","10114","11214","10102","21299","20992","10502","21341","190","102517","29415","102503","11082","99560","10746","98602","10942","99210","49","11095","21846","21845","10837","50","11108","21848","21847","21156","11171","10298","78","18","98755","21510","20144","21611","10747","98630","10881","37129","120","21726","10275","102188","964","20549","102450","102475","11292","10074","102189","26026","10511","10140","11409","21780","21779","10883","98631","11291","20576","25","10926","21905","21904","217","10884","10748","98604","20297","11067","11188","21486","10139","11189","10750","98605","26008","102112","11004","21873","21872","10231","21850","21849","21811","21810","21875","21874","21877","21876","11013","21878","21881","21880","10933","21907","21906","21815","21814","11077","21853","21852","11021","21885","21884","11443","10233","21813","21621","20224","20684","116114","10355","20534","102467","102492","11500","26027","102113","10077","10445","10681","98787","10838","11029","21887","21886","39","11251","10300","225","382","381","10285","10751","20010","99737","98606","11","10776","21931","21930","10839","10820","11450","21778","21777","20556","11115","58","51","11131","21857","21856","122061","90","105219","20963","42","11152","194","21858","11146","21859","11083","116944","20258","11217","100020","10540","11341","91","10936","99203","165","10635","180","10752","98608","11172","10754","959","11327","10849","20672","11351","11159","101761","11053","10762","98615","28786","10765","98617","21624","20196","98716","122063","221","105795","26016","102154","20078","10691","20716","573","574","146","10105","98632","10888","20704","99293","26005","102131","121","122","26951","102169","12","10795","21933","21932","26017","102132","11218","239","10379","26003","102170","11110","10755","98611","10937","110934","10891","26","477","478","10021","10003","29387","103904","10860","204","11425","10109","2","21893","10174","21892","21656","10923","99161","10649","36","11069","21889","21888","11116","10519","11352","20587","10756","98607","101","11472","965","20552","102472","102497","973","105811","10671","11162","21828","21827","26004","102114","11387","127","126","19","105796","11139","971","10592","29385","209","10303","116781","13","10802","21935","21934","21094","10335","105813","11119","21855","21854","11270","100112","10277","11129","131","103905","35393","10338","10357","20531","102466","102491","995","11002","99298","10892","98633","21141","99297","10317","11175","240","10636","67","11353","21817","21816","98634","10893","21949","21819","21818","102470","102495","11220","20674","1058","99299","15","10832","21939","21938","11271","21106","29417","102507","102521","983","170","21154","99078","99712","20717","14","10819","21937","21936","11391","55","11176","21830","21829","21812","210","99714","20680","11148","21861","21860","99039","10824","172","10840","99079","10945","187","20532","861","862","10606","198","195","11153","21863","21862","102","318","670","21942","52","541","542","11192","21289","10981","84","637","638","10944","11272","11426","21161","11273","10306","11223","20097","100116","171","10358","10907","99147","105798","10928","99105","24","10854","21184","26554","102178","11200","20720","11161","10719","10371","10093","26745","11475","104260","963","20545","102452","102477","154","29633","101857","101856","33","192","10658","21915","21914","75","509","510","11036","38","10950","21869","21868","10864","98620","26923","102118","21","10853","21897","21896","10721","98580","20550","102494","20721","10951","10940","193","10672","21917","21916","10722","98581","11149","22829","10865","98621","20020","98958","10782","969","98622","20040","10807","10472","87","10147","102519","29410","102505","98717","74","11470","11178","21835","11232","21836","16","10841","21940","21941","10801","98981","10828","10727","98584","10993","54","11123","10713","21551","11304","10262","11463","99274","41","11177","11299","80","11227","10507","20530","20539","960","102459","102484","10728","98585","11240","11125","20088","216","20139","116778","102511","29409","102525","29577","21622","20086","10710","10308","11132","26966","102103","26034","20571","10343","20547","102454","102479","11202","10729"]
    SearchInformation:
      type: object
      required:
      - query_displayed
      properties:
        query_displayed:
          type: string
          description: Query displayed in the search box.
        showing_results_for:
          type: string
          description: Corrected query used for the search.
        did_you_mean:
          type: string
          description: Suggested alternative query.
    Suggestion:
      type: object
      required:
      - title
      - query
      - link
      - thumbnail
      properties:
        title:
          type: string
          description: Title of the suggested search.
        query:
          type: string
          description: Search terms for the suggestion.
        link:
          type: string
          description: Yandex Images link for the suggested search.
        thumbnail:
          type: string
          description: Thumbnail URL for the suggestion.
    Image:
      type: object
      required:
      - position
      - title
      - source
      - original
      - thumbnail
      - yandex_link
      properties:
        position:
          type: integer
          description: Position of the image on the results page.
        title:
          type: string
          description: Title of the image.
        snippet:
          type: string
          description: Description of the source page.
        source:
          "$ref": "#/components/schemas/Source"
        original:
          "$ref": "#/components/schemas/ImageSize"
        thumbnail:
          type: string
          description: Thumbnail URL for the image.
        yandex_link:
          type: string
          description: Yandex Images viewer URL for the image.
        is_gif:
          type: boolean
          description: Whether the image is animated.
        other_sizes:
          type: array
          description: Other copies of the same picture, largest first.
          items:
            "$ref": "#/components/schemas/ImageSize"
    Source:
      type: object
      required:
      - name
      - link
      properties:
        name:
          type: string
          description: Name or domain of the source website.
        link:
          type: string
          description: URL of the page containing the image.
    ImageSize:
      type: object
      required:
      - link
      - width
      - height
      properties:
        link:
          type: string
          description: Direct image URL.
        width:
          type: integer
          description: Image width in pixels.
        height:
          type: integer
          description: Image height in pixels.
        size_in_bytes:
          type: integer
          description: File size in bytes.
    RelatedSearch:
      type: object
      required:
      - query
      - link
      properties:
        query:
          type: string
          description: Search terms for the related search.
        link:
          type: string
          description: Yandex Images link for the related search.
        thumbnail:
          type: string
          description: Thumbnail URL for the related search.
    Pagination:
      type: object
      required:
      - current
      properties:
        current:
          type: integer
          description: Current page number, starting at 1.
        previous:
          type: string
          description: Yandex Images URL for the previous results page.
        next:
          type: string
          description: Yandex Images URL for the next results page, which may return an empty result set.
    ErrorResponse:
      type: object
      required:
      - error
      properties:
        error:
          type: string
          description: Error message describing what went wrong
