POST
/
search
Search Items
curl --request POST \
  --url https://api.buybase.ai/search \
  --header 'Content-Type: application/json' \
  --header 'authorization: <authorization>' \
  --data '{
  "q": "<string>",
  "store_id": "<string>",
  "user_id": "<string>",
  "price_min": 123,
  "price_max": 123
}'
{
  "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"
}

Headers

authorization
string
required

Your API key for authorization.

Body Parameters

q
string
required

The search query provided by your LLM tool call.

store_id
string
required

The ID of the store to search in.

user_id
string
required

The ID of the user performing the search.

price_min
integer

Minimum price filter for the search results. Must be at least 1.

price_max
integer

Maximum price filter for the search results. Must be at least 1.

Response

results
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.
code
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
error
string

Error message if the request fails.

message
string

Additional details about the error if the request fails.

{
  "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"
}