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

# Get Automatic Recommendations

> Get automatic recommendations powered using LLMs

<ResponseExample>
  ```json 200 theme={null}
  {
    "status": "ok",
    "serve_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "pagination": {
      "cursor": null
    },
    "products": [
      {
        "product_id": 9311227838783,
        "title": "Classic Cotton T-Shirt",
        "handle": "classic-cotton-t-shirt",
        "price": 1025,
        "compare_at_price": null,
        "tags": "cotton,casual,bestseller",
        "product_type": "T-Shirts",
        "vendor": "BrandName",
        "image": {
          "id": "gid://shopify/ProductImage/123456",
          "url": "https://cdn.shopify.com/s/files/1/example/products/t-shirt.jpg",
          "altText": "Classic Cotton T-Shirt",
          "width": 1600,
          "height": 1600
        },
        "options": [
          {
            "id": 123,
            "name": "Title",
            "position": 1,
            "values": ["Default Title"]
          }
        ],
        "variants": [
          {
            "variant_id": 48328566276415,
            "title": "Default Title",
            "display_name": "Classic Cotton T-Shirt - Default Title",
            "price": "1025.00",
            "compare_at_price": null,
            "sku": "",
            "position": 1,
            "is_in_stock": true,
            "available_for_sale": true,
            "sellable_online_quantity": 50,
            "selected_options": [
              {
                "name": "Title",
                "value": "Default Title"
              }
            ]
          }
        ],
        "metafields": []
      }
    ]
  }
  ```

  ```json 400 theme={null}
  {
    "errors": [
      {
        "message": "\"product_ids\" is required",
        "path": ["product_ids"],
        "type": "any.required",
        "context": {
          "label": "product_ids",
          "key": "product_ids"
        }
      }
    ]
  }
  ```
</ResponseExample>


## OpenAPI

````yaml POST /api/storefront/v3/headless/recommendations/automatic
openapi: 3.0.1
info:
  title: Glood.AI API Reference
  description: Glood.AI API Reference
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://storefront.glood.ai
security:
  - bearerAuth: []
paths:
  /api/storefront/v3/headless/recommendations/automatic:
    post:
      description: Get automatic recommendations powered using LLMs
      parameters:
        - name: x-shop
          in: header
          description: Shopify store URL
          required: true
          schema:
            type: string
            example: shop.myshopify.com
      requestBody:
        description: Request body
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AutomaticRecommendationsRequest'
      responses:
        '200':
          description: Recommendations
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomaticRecommendationsResponse'
              example:
                status: ok
                serve_id: 3c90c3cc-0d44-4b50-8888-8dd25736052a
                pagination:
                  cursor: null
                products:
                  - product_id: 9311227838783
                    title: Classic Cotton T-Shirt
                    handle: classic-cotton-t-shirt
                    price: 1025
                    compare_at_price: null
                    tags: cotton,casual,bestseller
                    product_type: T-Shirts
                    vendor: BrandName
                    image:
                      id: gid://shopify/ProductImage/123456
                      url: >-
                        https://cdn.shopify.com/s/files/1/example/products/t-shirt.jpg
                      altText: Classic Cotton T-Shirt
                      width: 1600
                      height: 1600
                    options:
                      - id: 123
                        name: Title
                        position: 1
                        values:
                          - Default Title
                    variants:
                      - variant_id: 48328566276415
                        title: Default Title
                        display_name: Classic Cotton T-Shirt - Default Title
                        price: '1025.00'
                        compare_at_price: null
                        sku: ''
                        position: 1
                        is_in_stock: true
                        available_for_sale: true
                        sellable_online_quantity: 50
                        selected_options:
                          - name: Title
                            value: Default Title
                    metafields: []
        '400':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutomaticRecommendationsError'
components:
  schemas:
    AutomaticRecommendationsRequest:
      type: object
      required:
        - product_ids
        - recommendation_type
        - view
      properties:
        product_ids:
          type: array
          items:
            type: integer
          description: List of product IDs to get recommendations for
        recommendation_type:
          type: string
          description: Type of recommendations to retrieve
          enum:
            - similar_products
        view:
          type: string
          description: Context where recommendations will be displayed
          enum:
            - product_details
            - product_ids
        filter:
          type: object
          properties:
            variants:
              type: object
              properties:
                options:
                  type: array
                  items:
                    type: object
                    required:
                      - name
                      - value
                    properties:
                      name:
                        type: string
                        description: Option name
                      value:
                        type: string
                        description: Option value
                is_in_stock:
                  type: boolean
                  description: Filter by in-stock status
                sku:
                  type: array
                  items:
                    type: string
                  description: Filter by SKU
                available_for_sale:
                  type: boolean
                  description: Filter by availability for sale
            tags:
              type: array
              items:
                type: string
              description: Filter by product tags
            vendors:
              type: array
              items:
                type: string
              description: Filter by product vendors
            metafields:
              type: array
              items:
                type: object
                required:
                  - namespace
                  - key
                  - value
                properties:
                  namespace:
                    type: string
                    description: Metafield namespace
                  key:
                    type: string
                    description: Metafield key
                  value:
                    type: string
                    description: Metafield value
              description: Filter by product metafields
        pagination:
          type: object
          properties:
            cursor:
              type: string
              description: Cursor for pagination
            limit:
              type: integer
              description: >-
                Number of results to return per page. Minimum is 1 and maximum
                is 50
              minimum: 1
              maximum: 50
    AutomaticRecommendationsResponse:
      type: object
      properties:
        status:
          type: string
          description: Status of the response
          enum:
            - ok
        serve_id:
          type: string
          description: Unique identifier for this recommendation serve
        pagination:
          type: object
          properties:
            cursor:
              type: string
              description: Cursor for pagination
        products:
          type: array
          items:
            type: object
            properties:
              product_id:
                type: integer
                description: Unique identifier of the product
              title:
                type: string
                description: Title of the product
              price:
                type: number
                description: Price of the product
              tags:
                type: string
                description: Comma-separated list of product tags
              product_type:
                type: string
                description: Type/category of the product
              vendor:
                type: string
                description: Vendor/brand of the product
              image:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier of the image
                  url:
                    type: string
                    description: URL of the product image
                  height:
                    type: integer
                    description: Height of the image in pixels
                  width:
                    type: integer
                    description: Width of the image in pixels
                  altText:
                    type: string
                    description: Alternative text for the image
              handle:
                type: string
                description: URL handle/slug for the product
              compare_at_price:
                type: number
                description: Original/compare at price of the product
              options:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      description: Unique identifier of the option
                    name:
                      type: string
                      description: Name of the option (e.g. Size, Color)
                    values:
                      type: array
                      items:
                        type: string
                      description: Available values for this option
                    position:
                      type: integer
                      description: Display position of this option
              variants:
                type: array
                items:
                  type: object
                  properties:
                    variant_id:
                      type: integer
                      description: Unique identifier of the variant
                    title:
                      type: string
                      description: Title of the variant
                    display_name:
                      type: string
                      description: Display name of the variant
                    position:
                      type: integer
                      description: Display position of the variant
                    sku:
                      type: string
                      description: SKU of the variant
                    selected_options:
                      type: array
                      items:
                        type: object
                        properties:
                          name:
                            type: string
                            description: Name of the option
                          value:
                            type: string
                            description: Selected value for this option
                    price:
                      type: string
                      description: Price of the variant
                    compare_at_price:
                      type: string
                      nullable: true
                      description: Original/compare at price of the variant
                    is_in_stock:
                      type: boolean
                      description: Whether the variant is in stock
                    available_for_sale:
                      type: boolean
                      description: Whether the variant is available for sale
                    sellable_online_quantity:
                      type: integer
                      description: Quantity available for online sale
              metafields:
                type: array
                description: Product metafields
                items:
                  type: object
      example:
        status: ok
        serve_id: 3c90c3cc-0d44-4b50-8888-8dd25736052a
        pagination:
          cursor: null
        products:
          - product_id: 9311227838783
            title: Classic Cotton T-Shirt
            handle: classic-cotton-t-shirt
            price: 1025
            compare_at_price: null
            tags: cotton,casual,bestseller
            product_type: T-Shirts
            vendor: BrandName
            image:
              id: gid://shopify/ProductImage/123456
              url: https://cdn.shopify.com/s/files/1/example/products/t-shirt.jpg
              altText: Classic Cotton T-Shirt
              width: 1600
              height: 1600
            options:
              - id: 123
                name: Title
                position: 1
                values:
                  - Default Title
            variants:
              - variant_id: 48328566276415
                title: Default Title
                display_name: Classic Cotton T-Shirt - Default Title
                price: '1025.00'
                compare_at_price: null
                sku: ''
                position: 1
                is_in_stock: true
                available_for_sale: true
                sellable_online_quantity: 50
                selected_options:
                  - name: Title
                    value: Default Title
            metafields: []
    AutomaticRecommendationsError:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
                description: Human readable error message
              path:
                type: array
                items:
                  type: string
                description: Path to the field that caused the error
              type:
                type: string
                description: Type of validation error
              context:
                type: object
                properties:
                  limit:
                    type: number
                    description: Maximum allowed value
                  value:
                    type: number
                    description: Actual value provided
                  label:
                    type: string
                    description: Field label
                  key:
                    type: string
                    description: Field key
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````