> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wesog.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search N images

> Do simple image listing or do advanced image search with filters, sorting, pagination, facets and counting



## OpenAPI

````yaml https://api.wesog.com/openapi.json get /imgs
openapi: 3.1.0
info:
  title: Wesog API
  description: Wesog AI services for media providers
  version: 1.0.0
servers:
  - url: https://api.wesog.com
    description: Production server
  - url: https://v2.api.wesog.com
    description: Production server (v2)
security: []
paths:
  /imgs:
    get:
      tags:
        - Images
      summary: Search N images
      description: >-
        Do simple image listing or do advanced image search with filters,
        sorting, pagination, facets and counting
      operationId: get_n_imgs_get
      parameters:
        - name: q
          in: query
          required: false
          schema:
            type: string
            description: >-
              Query filtering formula, must be url-encoded. Similarity uses i~,
              i~~, i~~~ for semantic similarity search and i=, i==, i=== for
              visual duplicate-detection search. i==== requests an additional,
              more precise duplicate-verification pass on the top candidate,
              slightly slower than the other comparisons; this mode is currently
              restricted to selected tenants.
            default: ''
            title: Q
          description: >-
            Query filtering formula, must be url-encoded. Similarity uses i~,
            i~~, i~~~ for semantic similarity search and i=, i==, i=== for
            visual duplicate-detection search. i==== requests an additional,
            more precise duplicate-verification pass on the top candidate,
            slightly slower than the other comparisons; this mode is currently
            restricted to selected tenants.
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: Page number. 1 is the first page.
            default: 1
            title: Page
          description: Page number. 1 is the first page.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 10000
            minimum: 1
            description: Maximum number of images to return per page
            default: 50
            title: Limit
          description: Maximum number of images to return per page
        - name: sort_by
          in: query
          required: false
          schema:
            enum:
              - ''
              - image_id
              - src
              - url_img_watermark
              - url_img_thumbnail
              - height
              - width
              - aspect_ratio
              - n_faces
              - date
              - title
              - headline
              - caption
              - location
              - city
              - country
              - event
              - author
              - provider
              - shot
              - scene
              - medium
              - technique
              - similarity
              - sim
            type: string
            description: >-
              Sorting criterion. Note that sort_by=similarity only works if
              there are present "similary filters" on the Query Filtering
              Formula.
            default: ''
            title: Sort By
          description: >-
            Sorting criterion. Note that sort_by=similarity only works if there
            are present "similary filters" on the Query Filtering Formula.
        - name: sort_order
          in: query
          required: false
          schema:
            enum:
              - asc
              - desc
            type: string
            description: Ascending or descending sorting.
            default: desc
            title: Sort Order
          description: Ascending or descending sorting.
        - name: fields
          in: query
          required: false
          schema:
            type: array
            items:
              enum:
                - image_id
                - src
                - src_path
                - url_img_watermark
                - url_img_thumbnail
                - title
                - headline
                - caption
                - alt_text
                - ai_generated
                - model_release
                - property_release
                - nsfw
                - status
                - date
                - location
                - city
                - country
                - event
                - author
                - provider
                - shot
                - scene
                - technique
                - medium
                - keywords
                - categories
                - collections
                - height
                - width
                - n_faces
              type: string
            description: 'Array of fields to retrieve. Example: fields=image_id&fields=src'
            default:
              - height
              - width
              - src
              - url_img_watermark
              - url_img_thumbnail
              - n_faces
              - title
              - headline
              - caption
            title: Fields
          description: 'Array of fields to retrieve. Example: fields=image_id&fields=src'
        - name: facets
          in: query
          required: false
          schema:
            type: array
            items:
              enum:
                - ai_generated
                - model_release
                - property_release
                - nsfw
                - orientation
                - status
                - location
                - city
                - country
                - event
                - author
                - provider
                - shot
                - scene
                - medium
                - technique
                - keywords
                - categories
                - collections
              type: string
            description: >-
              Array of facets to retrieve. Example:
              facets=author&facets=keywords
            default: []
            title: Facets
          description: 'Array of facets to retrieve. Example: facets=author&facets=keywords'
        - name: count
          in: query
          required: false
          schema:
            type: boolean
            description: Include total hit count?
            default: false
            title: Count
          description: Include total hit count?
        - name: lang
          in: query
          required: false
          schema:
            enum:
              - ml
              - en
              - es
            type: string
            description: Language code.
            default: ml
            title: Lang
          description: Language code.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/image_search_response'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    image_search_response:
      properties:
        results:
          items:
            $ref: '#/components/schemas/image'
          type: array
          title: Results
        count:
          type: integer
          title: Count
        facets:
          additionalProperties:
            items:
              additionalProperties:
                type: integer
              type: object
            type: array
          type: object
          title: Facets
      type: object
      required:
        - results
        - count
        - facets
      title: image_search_response
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    image:
      properties:
        image_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Id
        src:
          anyOf:
            - type: string
            - type: 'null'
          title: Src
          description: >-
            Url of the image in high or medium resolution (used as source for
            the AI). Alternative to `src_path`; provide exactly one of the two.
          example: https://cdn.example.com/image/source.jpg
        src_path:
          anyOf:
            - type: string
            - type: 'null'
          title: Src Path
          description: >-
            Local filesystem path of the image (used as source for the AI).
            Alternative to `src`; provide exactly one of the two.
          example: /data/images/source.jpg
        url_img_watermark:
          anyOf:
            - type: string
            - type: 'null'
          title: Url Img Watermark
          description: URL of the watermarked image.
          example: https://cdn.example.com/image/wm.jpg
        url_img_thumbnail:
          anyOf:
            - type: string
            - type: 'null'
          title: Url Img Thumbnail
          description: URL of the thumbnail image.
          example: https://cdn.example.com/image/thumb.jpg
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
          description: A shorthand reference for the image.
          example: image123
        headline:
          anyOf:
            - type: string
            - type: 'null'
          title: Headline
          description: Short text describing the image.
          example: Sunset over the Hudson River
        caption:
          anyOf:
            - type: string
            - type: 'null'
          title: Caption
          description: Long text describing the image.
          example: >-
            A vibrant orange sunset reflecting on the river with the city
            skyline in silhouette.
        alt_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Alt Text
          description: Text describing the visual appearance of an image (Accessibility).
        ai_generated:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Ai Generated
          description: Image generated by Artificial Intelligence.
        model_release:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Model Release
          description: image with model release.
        property_release:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Property Release
          description: image with property release.
        nsfw:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Nsfw
          description: Image Not Safe For Work.
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: Current status of the image.
          example: Active
        date:
          anyOf:
            - type: string
            - type: 'null'
          title: Date
          description: >-
            Date of the image creation in year-month-day format. Capture date
            for photographies.
          example: '2024-10-19'
        location:
          anyOf:
            - type: string
            - type: 'null'
          title: Location
          description: >-
            A detailed description of the location, complementing the specified
            country and city with additional details such as street address or
            notable landmarks.
          example: 123 Main St, near Central Park
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
          description: Name of the country.
          example: New York
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: Name of the country.
          example: United States
        event:
          anyOf:
            - type: string
            - type: 'null'
          title: Event
          description: Related event
          example: Oscar awards 2024
        author:
          anyOf:
            - type: string
            - type: 'null'
          title: Author
          description: >-
            The name of the individual or entity responsible for creating the
            image, such as a photographer or painter.
          example: Jane Doe
        provider:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider
          description: >-
            The identifier of the provider, which can be either a unique numeric
            ID or a descriptive name.
          example: Acme Inc.
        shot:
          anyOf:
            - type: string
            - type: 'null'
          title: Shot
          description: Type of photography shot.
          example: Portrait
        scene:
          anyOf:
            - type: string
            - type: 'null'
          title: Scene
          description: Spot, place, visual location
          example: Town square
        technique:
          anyOf:
            - type: string
            - type: 'null'
          title: Technique
          description: >-
            The specific method or process used in creating the artwork,
            reflecting the artist's unique approach or the traditional methods
            tied to certain mediums.
          example: Drawing
        medium:
          anyOf:
            - type: string
            - type: 'null'
          title: Medium
          description: >-
            The material or substance used in the creation of the artwork or
            object. This field corresponds to various artistic mediums like
            oils, acrylics, or digital formats.
          example: Oil on canvas
        keywords:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Keywords
          description: Specific tags describing the image
          example:
            - Tree
            - Dog
            - Ball
            - Water
        categories:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Categories
          description: General categories of the image
          example:
            - Sport
            - Fashion
            - Politics
        collections:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Collections
          description: Collections that the image belongs to
          example:
            - Steet pics
            - Exclusive
        height:
          anyOf:
            - type: integer
            - type: 'null'
          title: Height
          description: Height of the image.
        width:
          anyOf:
            - type: integer
            - type: 'null'
          title: Width
          description: Width of the image.
        n_faces:
          anyOf:
            - type: integer
            - type: 'null'
          title: N Faces
          description: Num of people faces that appears on the image.
      type: object
      title: image
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: API-Key

````