openapi: 3.0.0
info:
  title: Naver Images API
  description: >-
    Search Naver Images, the image tab of South Korea's Naver search, with size, GIF, color, source platform,
    Creative Commons license, time period and custom date range filters, up to 200 results per page. Each image has its
    original link and size, title, Naver image ID, thumbnail, and its source page link, site name, Naver's reported
    source domain, and Naver source platform. When available, an image also has its date, the Naver Shopping product ID of
    store images, and flags for GIFs, Creative Commons licensed images and whether the license allows commercial use or
    modification. Related searches come with a link and a thumbnail.
  version: 1.0.0
servers:
- url: https://www.searchapi.io/api/v1
paths:
  "/search":
    get:
      summary: Naver Images Search
      security:
      - ApiKeyAuth: []
      - ApiKeyQuery: []
      parameters:
      - name: engine
        in: query
        required: true
        description: Set to naver_images.
        schema:
          type: string
          enum: ["naver_images"]
      - name: q
        in: query
        required: true
        description: Search terms used to find images. Korean and English are supported.
        schema:
          type: string
          maxLength: 500
      - name: page
        in: query
        required: false
        description: >-
          Page of results to return, starting at 1. Naver Images lists up to 500 results per search, so the last page is
          5 at the default num of 100 and 3 at a num of 200.
        schema:
          type: integer
          minimum: 1
          maximum: 500
          default: 1
      - name: num
        in: query
        required: false
        description: >-
          Number of results per page. Naver places related search cards among the images and each card takes the place
          of one image, so a page of 100 results usually holds 96 images.
        schema:
          type: integer
          minimum: 1
          maximum: 200
          default: 100
      - name: size
        in: query
        required: false
        description: Filter by image size. large keeps images of at least 786,432 pixels, the area of 1024 x 768.
        schema:
          type: string
          enum: ["large"]
      - name: image_type
        in: query
        required: false
        description: Filter by image type.
        schema:
          type: string
          enum: ["gif"]
      - name: color
        in: query
        required: false
        description: Filter by the main color of the image.
        schema:
          type: string
          enum: ["red","orange","yellow","lime","green","cyan","blue","purple","pink","apricot","ocher","sepia","black","gray","white"]
      - name: source_type
        in: query
        required: false
        description: >-
          Filter by the Naver platform or the web the image comes from: Naver Blog, Naver Cafe, news photos, other
          websites, Naver Plus Store, Naver price comparison, Naver Place, Naver Clip, the Naver encyclopedia, Naver's
          image library, Naver music or Naver real estate.
        schema:
          type: string
          enum: ["blog","cafe","news","web","plus_store","price_comparison","place","clip","encyclopedia","image_library","music","real_estate"]
      - name: usage_rights
        in: query
        required: false
        description: Filter by Creative Commons license. The commercial and modification options each keep only the licenses that allow it.
        schema:
          type: string
          enum: ["creative_commons_licenses","free_to_share_and_use_commercial","free_to_modify_share_and_use"]
      - name: time_period
        in: query
        required: false
        description: Filter by how recently the image was posted.
        schema:
          type: string
          enum: ["last_day","last_week","last_month","last_3_months","last_6_months","last_year"]
      - name: time_period_min
        in: query
        required: false
        description: Start date of a custom date range in MM/DD/YYYY format, between 01/01/1990 and today in Korea. It takes precedence over time_period.
        schema:
          type: string
          pattern: '^(0?[1-9]|1[0-2])/(0?[1-9]|[12][0-9]|3[01])/(19|20)\d\d$'
      - name: time_period_max
        in: query
        required: false
        description: End date of a custom date range in MM/DD/YYYY format, between 01/01/1990 and today in Korea. It takes precedence over time_period.
        schema:
          type: string
          pattern: '^(0?[1-9]|1[0-2])/(0?[1-9]|[12][0-9]|3[01])/(19|20)\d\d$'
      - name: zero_retention
        in: query
        required: false
        description: Set to true to keep request parameters, HTML, and JSON responses out of storage and logs. Enterprise plans only.
        schema:
          type: boolean
          default: false
      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"
        '403':
          description: Forbidden. Zero data retention is not available to the account, or the account requires `zero_retention=true`.
          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"
        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:
      - 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: Naver 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: ["naver_images"]
          description: Set to naver_images.
        q:
          type: string
          description: Search terms used to find images.
        page:
          type: integer
          minimum: 1
          maximum: 500
          description: Page of results returned, starting at 1.
        num:
          type: integer
          minimum: 1
          maximum: 200
          description: Number of results per page.
        size:
          type: string
          enum: ["large"]
          description: Image size filter.
        image_type:
          type: string
          enum: ["gif"]
          description: Image type filter.
        color:
          type: string
          enum: ["red","orange","yellow","lime","green","cyan","blue","purple","pink","apricot","ocher","sepia","black","gray","white"]
          description: Image color filter.
        source_type:
          type: string
          enum: ["blog","cafe","news","web","plus_store","price_comparison","place","clip","encyclopedia","image_library","music","real_estate"]
          description: Source platform filter.
        usage_rights:
          type: string
          enum: ["creative_commons_licenses","free_to_share_and_use_commercial","free_to_modify_share_and_use"]
          description: Creative Commons license filter.
        time_period:
          type: string
          enum: ["last_day","last_week","last_month","last_3_months","last_6_months","last_year"]
          description: Time period filter.
        time_period_min:
          type: string
          description: Start date of the custom date range, in MM/DD/YYYY format.
        time_period_max:
          type: string
          description: End date of the custom date range, in MM/DD/YYYY format.
        zero_retention:
          type: boolean
          description: Whether zero data retention was requested
    Image:
      type: object
      required:
      - position
      - original
      properties:
        position:
          type: integer
          description: Position of the image in the results, counting from the first result of the page.
        title:
          type: string
          description: Title of the page the image appears on.
        image_id:
          type: string
          description: Naver ID of the image.
        original:
          "$ref": "#/components/schemas/Original"
        thumbnail:
          type: string
          description: URL of the thumbnail Naver shows.
        source:
          "$ref": "#/components/schemas/Source"
        source_type:
          type: string
          enum: ["blog","cafe","news","web","plus_store","price_comparison","place","clip","encyclopedia","image_library","music","real_estate"]
          description: Naver platform or the web, as in the source_type parameter.
        product_id:
          type: string
          description: Naver Shopping product ID of a Plus Store or price comparison image, when Naver supplies it.
        date:
          type: string
          description: Date the image was posted, as Naver shows it in Korean, either a date or a relative time.
        is_gif:
          type: boolean
          description: Whether the image is an animated GIF.
        has_creative_commons_license:
          type: boolean
          description: Whether the image is shared under a Creative Commons license.
        is_commercial_use_allowed:
          type: boolean
          description: Whether the image's Creative Commons license allows commercial use.
        is_modification_allowed:
          type: boolean
          description: Whether the image's Creative Commons license allows modification.
    Original:
      type: object
      required:
      - link
      properties:
        link:
          type: string
          description: URL of the full-size image.
        width:
          type: integer
          description: Width of the full-size image in pixels.
        height:
          type: integer
          description: Height of the full-size image in pixels.
    Source:
      type: object
      properties:
        name:
          type: string
          description: Name of the blog, site or store the image comes from.
        link:
          type: string
          description: URL of the page the image appears on.
        domain:
          type: string
          description: Naver's reported source domain, which can differ from the hostname in `source.link`.
    RelatedSearch:
      type: object
      required:
      - query
      properties:
        query:
          type: string
          description: Related search query.
        link:
          type: string
          description: URL of the Naver image search for the query.
        thumbnail:
          type: string
          description: URL of an image Naver shows for the query.
    Pagination:
      type: object
      required:
      - current_page
      properties:
        current_page:
          type: integer
          description: Current page number, starting at 1.
        next_page:
          type: integer
          description: Number of the next page, to pass as the page parameter.
    ErrorResponse:
      type: object
      required:
      - error
      properties:
        error:
          type: string
          description: Error message describing what went wrong
