Search
Search
Discover tailored product recommendations from our extensive database of millions of online products from thousands of Shopify stores.
POST
/
search
/
products
Search
curl --request POST \
--url https://api.buybase.ai/search/products \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"query": {
"text": "<string>",
"image_url": "<string>"
},
"profile_id": "<string>",
"store_id": "<string>",
"store_domain": "<string>",
"query_weight": 123,
"style_weight": 123,
"similarity_threshold": 123,
"max_result_count": 123,
"exclude_variant_ids": [
{}
],
"price_min": 123,
"price_max": 123
}
'import requests
url = "https://api.buybase.ai/search/products"
payload = {
"query": {
"text": "<string>",
"image_url": "<string>"
},
"profile_id": "<string>",
"store_id": "<string>",
"store_domain": "<string>",
"query_weight": 123,
"style_weight": 123,
"similarity_threshold": 123,
"max_result_count": 123,
"exclude_variant_ids": [{}],
"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({
query: {text: '<string>', image_url: '<string>'},
profile_id: '<string>',
store_id: '<string>',
store_domain: '<string>',
query_weight: 123,
style_weight: 123,
similarity_threshold: 123,
max_result_count: 123,
exclude_variant_ids: [{}],
price_min: 123,
price_max: 123
})
};
fetch('https://api.buybase.ai/search/products', 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/products",
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([
'query' => [
'text' => '<string>',
'image_url' => '<string>'
],
'profile_id' => '<string>',
'store_id' => '<string>',
'store_domain' => '<string>',
'query_weight' => 123,
'style_weight' => 123,
'similarity_threshold' => 123,
'max_result_count' => 123,
'exclude_variant_ids' => [
[
]
],
'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/products"
payload := strings.NewReader("{\n \"query\": {\n \"text\": \"<string>\",\n \"image_url\": \"<string>\"\n },\n \"profile_id\": \"<string>\",\n \"store_id\": \"<string>\",\n \"store_domain\": \"<string>\",\n \"query_weight\": 123,\n \"style_weight\": 123,\n \"similarity_threshold\": 123,\n \"max_result_count\": 123,\n \"exclude_variant_ids\": [\n {}\n ],\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/products")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"query\": {\n \"text\": \"<string>\",\n \"image_url\": \"<string>\"\n },\n \"profile_id\": \"<string>\",\n \"store_id\": \"<string>\",\n \"store_domain\": \"<string>\",\n \"query_weight\": 123,\n \"style_weight\": 123,\n \"similarity_threshold\": 123,\n \"max_result_count\": 123,\n \"exclude_variant_ids\": [\n {}\n ],\n \"price_min\": 123,\n \"price_max\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buybase.ai/search/products")
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 \"query\": {\n \"text\": \"<string>\",\n \"image_url\": \"<string>\"\n },\n \"profile_id\": \"<string>\",\n \"store_id\": \"<string>\",\n \"store_domain\": \"<string>\",\n \"query_weight\": 123,\n \"style_weight\": 123,\n \"similarity_threshold\": 123,\n \"max_result_count\": 123,\n \"exclude_variant_ids\": [\n {}\n ],\n \"price_min\": 123,\n \"price_max\": 123\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "7924157309120",
"title": "Classic Cotton T-Shirt",
"handle": "classic-cotton-t-shirt",
"description": "A comfortable everyday essential made from 100% organic cotton",
"product_type": "t-shirt",
"images": [
"https://cdn.shopify.com/s/files/1/0680/5936/5568/files/tshirt_black_front.jpg",
"https://cdn.shopify.com/s/files/1/0680/5936/5568/files/tshirt_black_back.jpg"
],
"options": [
{
"name": "Size",
"values": [
"S", "M", "L", "XL"
]
},
{
"name": "Color",
"values": [
"Black", "White", "Navy"
]
}
],
"variants": [
{
"id": 46002863112384,
"title": "S / Black",
"option1": "S",
"option2": "Black",
"option3": null,
"price": "29.95",
"available": true,
"checkout_url": "https://fashion-store.com/cart/46002863112384:1",
"checkout_url_with_shipping": "https://fashion-store.com/cart/46002863112384:1?checkout[email]=user@example.com&checkout[shipping_address][first_name]=John&checkout[shipping_address][last_name]=Doe&checkout[shipping_address][address1]=123 Main St&checkout[shipping_address][city]=New York&checkout[shipping_address][province]=NY&checkout[shipping_address][country]=US&checkout[shipping_address][zip]=10001"
}
],
"store_id": "store456",
"store_name": "Fashion Store",
"store_domain": "fashion-store.com"
}
],
"product_ids": ["7924157309120"],
"code": "SEARCH_SUCCESS"
}
Headers
string
required
Your API key for authorization.
Body Parameters
object
required
string
Optional ID of a profile to influence search results in a personalized way and provide checkout URLs with shipping forms pre-filled with the profile’s attached shipping address.
string
The ID of the store to search in.
string
The domain of the store to search in.
number
default:"1"
Weight to apply to the query which represents the text, image, or both (0-1).
When using a style profile, defaults to 0.7.
number
default:"0.3"
Weight to apply to the style profile (0-1).
Only applies if profile_id is provided and the profile has a style attached.
number
default:"0.25"
Minimum similarity threshold for matching products (0-1).
integer
default:"2"
Maximum number of results to return.
array
Array of variant IDs to exclude from results.
number
Minimum price filter for the search results.
number
Maximum price filter for the search results.
Response
array
An array of product details, each containing:
Show Product details
Show Product details
string
The unique identifier of the product.
string
The product title.
string
The product description.
string
The type/category of the product.
array
array
Array of product images.
array
Array of product variants, each containing:
Show Variant details
Show Variant details
string
The variant ID.
string
The variant title.
number
The variant price.
boolean
Whether the variant is available.
string
Direct URL to go to the variant’s checkout form with quantity 1.
string
Direct URL to go to the variant’s checkout form with quantity 1 and shipping address pre-filled.
Only applies if profile_id is provided and the profile has a shipping address attached.
string
ID of the store.
string
Name of the store.
string
Domain of the store.
array
Array of product IDs returned in the results.
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 foundINVALID_REQUEST: Invalid request parametersSTORE_NOT_FOUND: Store ID or brand not foundPROFILE_NOT_FOUND: Profile ID not foundINTERNAL_ERROR: Server error occurred
string
Error message if the request fails.
string
Additional details about the error if the request fails.
{
"results": [
{
"id": "7924157309120",
"title": "Classic Cotton T-Shirt",
"handle": "classic-cotton-t-shirt",
"description": "A comfortable everyday essential made from 100% organic cotton",
"product_type": "t-shirt",
"images": [
"https://cdn.shopify.com/s/files/1/0680/5936/5568/files/tshirt_black_front.jpg",
"https://cdn.shopify.com/s/files/1/0680/5936/5568/files/tshirt_black_back.jpg"
],
"options": [
{
"name": "Size",
"values": [
"S", "M", "L", "XL"
]
},
{
"name": "Color",
"values": [
"Black", "White", "Navy"
]
}
],
"variants": [
{
"id": 46002863112384,
"title": "S / Black",
"option1": "S",
"option2": "Black",
"option3": null,
"price": "29.95",
"available": true,
"checkout_url": "https://fashion-store.com/cart/46002863112384:1",
"checkout_url_with_shipping": "https://fashion-store.com/cart/46002863112384:1?checkout[email]=user@example.com&checkout[shipping_address][first_name]=John&checkout[shipping_address][last_name]=Doe&checkout[shipping_address][address1]=123 Main St&checkout[shipping_address][city]=New York&checkout[shipping_address][province]=NY&checkout[shipping_address][country]=US&checkout[shipping_address][zip]=10001"
}
],
"store_id": "store456",
"store_name": "Fashion Store",
"store_domain": "fashion-store.com"
}
],
"product_ids": ["7924157309120"],
"code": "SEARCH_SUCCESS"
}
⌘I
Search
curl --request POST \
--url https://api.buybase.ai/search/products \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--data '
{
"query": {
"text": "<string>",
"image_url": "<string>"
},
"profile_id": "<string>",
"store_id": "<string>",
"store_domain": "<string>",
"query_weight": 123,
"style_weight": 123,
"similarity_threshold": 123,
"max_result_count": 123,
"exclude_variant_ids": [
{}
],
"price_min": 123,
"price_max": 123
}
'import requests
url = "https://api.buybase.ai/search/products"
payload = {
"query": {
"text": "<string>",
"image_url": "<string>"
},
"profile_id": "<string>",
"store_id": "<string>",
"store_domain": "<string>",
"query_weight": 123,
"style_weight": 123,
"similarity_threshold": 123,
"max_result_count": 123,
"exclude_variant_ids": [{}],
"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({
query: {text: '<string>', image_url: '<string>'},
profile_id: '<string>',
store_id: '<string>',
store_domain: '<string>',
query_weight: 123,
style_weight: 123,
similarity_threshold: 123,
max_result_count: 123,
exclude_variant_ids: [{}],
price_min: 123,
price_max: 123
})
};
fetch('https://api.buybase.ai/search/products', 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/products",
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([
'query' => [
'text' => '<string>',
'image_url' => '<string>'
],
'profile_id' => '<string>',
'store_id' => '<string>',
'store_domain' => '<string>',
'query_weight' => 123,
'style_weight' => 123,
'similarity_threshold' => 123,
'max_result_count' => 123,
'exclude_variant_ids' => [
[
]
],
'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/products"
payload := strings.NewReader("{\n \"query\": {\n \"text\": \"<string>\",\n \"image_url\": \"<string>\"\n },\n \"profile_id\": \"<string>\",\n \"store_id\": \"<string>\",\n \"store_domain\": \"<string>\",\n \"query_weight\": 123,\n \"style_weight\": 123,\n \"similarity_threshold\": 123,\n \"max_result_count\": 123,\n \"exclude_variant_ids\": [\n {}\n ],\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/products")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"query\": {\n \"text\": \"<string>\",\n \"image_url\": \"<string>\"\n },\n \"profile_id\": \"<string>\",\n \"store_id\": \"<string>\",\n \"store_domain\": \"<string>\",\n \"query_weight\": 123,\n \"style_weight\": 123,\n \"similarity_threshold\": 123,\n \"max_result_count\": 123,\n \"exclude_variant_ids\": [\n {}\n ],\n \"price_min\": 123,\n \"price_max\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buybase.ai/search/products")
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 \"query\": {\n \"text\": \"<string>\",\n \"image_url\": \"<string>\"\n },\n \"profile_id\": \"<string>\",\n \"store_id\": \"<string>\",\n \"store_domain\": \"<string>\",\n \"query_weight\": 123,\n \"style_weight\": 123,\n \"similarity_threshold\": 123,\n \"max_result_count\": 123,\n \"exclude_variant_ids\": [\n {}\n ],\n \"price_min\": 123,\n \"price_max\": 123\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "7924157309120",
"title": "Classic Cotton T-Shirt",
"handle": "classic-cotton-t-shirt",
"description": "A comfortable everyday essential made from 100% organic cotton",
"product_type": "t-shirt",
"images": [
"https://cdn.shopify.com/s/files/1/0680/5936/5568/files/tshirt_black_front.jpg",
"https://cdn.shopify.com/s/files/1/0680/5936/5568/files/tshirt_black_back.jpg"
],
"options": [
{
"name": "Size",
"values": [
"S", "M", "L", "XL"
]
},
{
"name": "Color",
"values": [
"Black", "White", "Navy"
]
}
],
"variants": [
{
"id": 46002863112384,
"title": "S / Black",
"option1": "S",
"option2": "Black",
"option3": null,
"price": "29.95",
"available": true,
"checkout_url": "https://fashion-store.com/cart/46002863112384:1",
"checkout_url_with_shipping": "https://fashion-store.com/cart/46002863112384:1?checkout[email]=user@example.com&checkout[shipping_address][first_name]=John&checkout[shipping_address][last_name]=Doe&checkout[shipping_address][address1]=123 Main St&checkout[shipping_address][city]=New York&checkout[shipping_address][province]=NY&checkout[shipping_address][country]=US&checkout[shipping_address][zip]=10001"
}
],
"store_id": "store456",
"store_name": "Fashion Store",
"store_domain": "fashion-store.com"
}
],
"product_ids": ["7924157309120"],
"code": "SEARCH_SUCCESS"
}