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

# Search Items

> Search for items in a store.

### Headers

<ParamField header="authorization" type="string" required>
  Your API key for authorization.
</ParamField>

### Body Parameters

<ParamField body="q" type="string" required>
  The search query provided by your LLM tool call.
</ParamField>

<ParamField body="store_id" type="string" required>
  The ID of the store to search in.
</ParamField>

<ParamField body="user_id" type="string" required>
  The ID of the user performing the search.
</ParamField>

<ParamField body="price_min" type="integer">
  Minimum price filter for the search results. Must be at least 1.
</ParamField>

<ParamField body="price_max" type="integer">
  Maximum price filter for the search results. Must be at least 1.
</ParamField>

### Response

<ResponseField name="results" type="array">
  An array of product details, each containing:

  * `id`: The unique identifier of the product.
  * `title`: The product title.
  * `description`: The product description.
  * `product_type`: The type/category of the product.
  * `tags`: Array of tags associated with the product.
  * `options`: Available product options.
  * `images`: Array of product images.
  * `variants`: Array of product variants, each containing:
    * `id`: The variant ID.
    * `title`: The variant title.
    * `price`: The variant price.
</ResponseField>

<ResponseField name="code" type="string">
  A code indicating the result of the search operation. Possible values:

  * `SEARCH_SUCCESS`: Search completed successfully with results
  * `NO_RESULTS_FOUND`: Search completed but no results found
  * `AUTH_MISSING`: No API key provided
  * `INVALID_KEY`: Invalid API key
  * `BAD_REQUEST_ERROR`: Invalid request parameters
  * `STORE_NOT_FOUND`: Store ID not found
  * `FORBIDDEN`: Not authorized to access store
  * `INTERNAL_ERROR`: Server error occurred
</ResponseField>

<ResponseField name="error" type="string">
  Error message if the request fails.
</ResponseField>

<ResponseField name="message" type="string">
  Additional details about the error if the request fails.
</ResponseField>

<ResponseExample>
  ```json Response
  {
    "results": [
      {
        "id": "8154074775744",
        "title": "The Collection Snowboard: Liquid",
        "description": null,
        "product_type": "snowboard",
        "tags": "Accessory, Sport, Winter",
        "options": [
          {
            "id": 10458693861568,
            "product_id": 8154074775744,
            "name": "Title", 
            "position": 1,
            "values": [
              "Default Title"
            ]
          }
        ],
        "images": [
          {
            "id": 41770216652992,
            "alt": "Top and bottom view of a snowboard. The top view shows a stylized scene of water, trees, mountains,\n        sky and a moon in blue colours. The bottom view has a blue liquid, drippy background with the text "liquid" in\n        a stylized script typeface.",
            "position": 1,
            "product_id": 8154074775744,
            "created_at": "2025-01-09T13:16:46-05:00",
            "updated_at": "2025-01-09T13:16:48-05:00",
            "admin_graphql_api_id": "gid://shopify/ProductImage/41770216652992",
            "width": 1600,
            "height": 1600,
            "src": "https://cdn.shopify.com/s/files/1/0680/5936/5568/files/Main_b13ad453-477c-4ed1-9b43-81f3345adfd6.jpg?v=1736446608",
            "variant_ids": []
          }
        ],
        "variants": [
          {
            "id": 46002863112384,
            "title": "Default Title",
            "price": "749.95"
          }
        ]
      }
    ],
    "code": "SEARCH_SUCCESS"
  }
  ```
</ResponseExample>
