> ## 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.

# Get Recommendations

> Get product recommendations based on visual similarity



## OpenAPI

````yaml POST /recs
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:
  /recs:
    post:
      tags:
        - Recommendations
      summary: Get Recommendations
      description: Get product recommendations based on visual similarity
      operationId: getRecommendations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RecommendationsRequest'
      responses:
        '200':
          description: Product recommendations
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RecommendationsResponse'
        '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:
    RecommendationsRequest:
      type: object
      required:
        - organizationId
        - catalogId
        - productId
        - topK
      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
        productId:
          type: string
          description: Product ID to get recommendations for (cannot be empty)
          example: GUCCI12345
        topK:
          type: integer
          description: Number of recommendations to return
          example: 12
        visualWeight:
          type: number
          format: float
          minimum: 0
          maximum: 1
          exclusiveMinimum: true
          description: 'Weight for visual similarity (0,1]. Default: 1.0'
          example: 0.5
        filters:
          type: array
          description: Optional filters to apply
          items:
            $ref: '#/components/schemas/Filter'
        includeMetadata:
          type: boolean
          description: 'Whether to include product metadata. Default: true'
          example: true
    RecommendationsResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
          example: success
        results:
          type: array
          items:
            $ref: '#/components/schemas/RecommendationResult'
    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
    RecommendationResult:
      type: object
      properties:
        productId:
          type: string
          description: Recommended product ID
          example: GUCCI98765
        metadata:
          type: object
          description: Product metadata (only included if includeMetadata is true)
          example:
            name: GG Denim Shirt
            price: 180
            brand: Gucci
            color: blue
  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

````