Search Items
Search for items in a store.
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
}
'import requests
url = "https://api.buybase.ai/search"
payload = {
"q": "<string>",
"store_id": "<string>",
"user_id": "<string>",
"price_min": 123,
"price_max": 123
}
headers = {
"authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
q: '<string>',
store_id: '<string>',
user_id: '<string>',
price_min: 123,
price_max: 123
})
};
fetch('https://api.buybase.ai/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.buybase.ai/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'q' => '<string>',
'store_id' => '<string>',
'user_id' => '<string>',
'price_min' => 123,
'price_max' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.buybase.ai/search"
payload := strings.NewReader("{\n \"q\": \"<string>\",\n \"store_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"price_min\": 123,\n \"price_max\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.buybase.ai/search")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"q\": \"<string>\",\n \"store_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"price_min\": 123,\n \"price_max\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buybase.ai/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"q\": \"<string>\",\n \"store_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"price_min\": 123,\n \"price_max\": 123\n}"
response = http.request(request)
puts response.read_body{
"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
string
required
Your API key for authorization.
Body Parameters
string
required
The search query provided by your LLM tool call.
string
required
The ID of the store to search in.
string
required
The ID of the user performing the search.
integer
Minimum price filter for the search results. Must be at least 1.
integer
Maximum price filter for the search results. Must be at least 1.
Response
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.
string
A code indicating the result of the search operation. Possible values:
SEARCH_SUCCESS: Search completed successfully with resultsNO_RESULTS_FOUND: Search completed but no results foundAUTH_MISSING: No API key providedINVALID_KEY: Invalid API keyBAD_REQUEST_ERROR: Invalid request parametersSTORE_NOT_FOUND: Store ID not foundFORBIDDEN: Not authorized to access storeINTERNAL_ERROR: Server error occurred
string
Error message if the request fails.
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"
}
⌘I
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
}
'import requests
url = "https://api.buybase.ai/search"
payload = {
"q": "<string>",
"store_id": "<string>",
"user_id": "<string>",
"price_min": 123,
"price_max": 123
}
headers = {
"authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
q: '<string>',
store_id: '<string>',
user_id: '<string>',
price_min: 123,
price_max: 123
})
};
fetch('https://api.buybase.ai/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.buybase.ai/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'q' => '<string>',
'store_id' => '<string>',
'user_id' => '<string>',
'price_min' => 123,
'price_max' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.buybase.ai/search"
payload := strings.NewReader("{\n \"q\": \"<string>\",\n \"store_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"price_min\": 123,\n \"price_max\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.buybase.ai/search")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"q\": \"<string>\",\n \"store_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"price_min\": 123,\n \"price_max\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buybase.ai/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"q\": \"<string>\",\n \"store_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"price_min\": 123,\n \"price_max\": 123\n}"
response = http.request(request)
puts response.read_body{
"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"
}