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

# Search Products

> Search for products using text queries with visual similarity



## OpenAPI

````yaml POST /search
openapi: 3.1.0
info:
  title: Refine API
  description: >-
    API for managing product catalogs and delivering AI-powered product
    recommendations and search
  version: 1.0.0
  contact:
    name: Refine Support
    email: support@refine.ai
servers:
  - url: https://api.joinrefine.io
    description: Production server
security:
  - apiKey: []
paths:
  /search:
    post:
      tags:
        - Search
      summary: Search Products
      description: Search for products using text queries with visual similarity
      operationId: searchProducts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchRequest'
      responses:
        '200':
          description: Search results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
        '400':
          description: Bad Request - Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    SearchRequest:
      type: object
      required:
        - organizationId
        - catalogId
        - query
        - topK
        - visual_weight
        - similarity_threshold
      properties:
        organizationId:
          type: string
          format: uuid
          description: Organization ID
          example: f2c320fc-1234-4567-8901-84c87f6b4c52
        catalogId:
          type: string
          format: uuid
          description: Catalog ID
          example: 1e2f3d4c-5678-9012-3456-9baaf2a08e3f
        query:
          type: string
          description: Search query (automatically converted to lowercase)
          example: blue denim jacket
        topK:
          type: integer
          description: Number of results to return
          example: 24
        visual_weight:
          type: number
          format: float
          minimum: 0
          maximum: 1
          exclusiveMinimum: true
          description: Weight for visual similarity (0,1]
          example: 0.8
        similarity_threshold:
          type: number
          format: float
          minimum: 0
          maximum: 1
          description: Minimum similarity score for results [0,1]
          example: 0.25
        filters:
          type: array
          description: Optional filters to apply
          items:
            $ref: '#/components/schemas/Filter'
        user_analytics:
          type: object
          description: Optional analytics data
          properties:
            session_id:
              type: string
              description: User session ID
              example: 01HWEXYZ123456789
            ip_address:
              type: string
              description: User IP address
              example: 24.161.52.129
            user_agent:
              type: string
              description: User agent string
              example: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
    SearchResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
          example: success
        results:
          type: array
          items:
            $ref: '#/components/schemas/SearchResult'
    Error:
      type: object
      required:
        - status
        - message
        - time
        - method
        - url
      properties:
        status:
          type: integer
          description: HTTP status code
        message:
          type: string
          description: Error message
        time:
          type: string
          format: date-time
          description: Timestamp in RFC3339 format
        method:
          type: string
          description: HTTP method
        url:
          type: string
          description: Request URL
    Filter:
      type: object
      required:
        - field
        - operator
        - value
      properties:
        field:
          type: string
          description: Field name to filter on
          example: price
        operator:
          type: string
          enum:
            - eq
            - ne
            - gt
            - gte
            - lt
            - lte
            - in
            - nin
            - exists
          description: Comparison operator
        value:
          description: Value to compare against
          oneOf:
            - type: string
            - type: number
            - type: boolean
            - type: array
              items:
                oneOf:
                  - type: string
                  - type: number
    SearchResult:
      type: object
      properties:
        productId:
          type: string
          description: Product ID
          example: GUCCI12345
        score:
          type: number
          format: float
          description: Similarity score
          example: 0.8834
        metadata:
          type: object
          description: Product metadata
          example:
            name: GG Denim Jacket
            brand: Gucci
            price: 198
            color: blue
            rank: BOOST
  responses:
    Unauthorized:
      description: Unauthorized - Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: 401
            message: Unauthorized
            time: '2024-06-14T19:21:00Z'
            method: GET
            url: /organizations/a8cd2722-1234-4567-9abc-def123456789/catalogs
    Forbidden:
      description: Forbidden - Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: 403
            message: Forbidden
            time: '2024-06-14T19:21:00Z'
            method: POST
            url: /search
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: 500
            message: Internal Server Error
            time: '2024-06-14T19:21:00Z'
            method: POST
            url: /recs
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: REFINE_API_KEY
      description: API key for authentication

````