Search Products
curl --request POST \
--url https://api.example.com/v1/tools/commerce/search \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"limit": 123
}
'import requests
url = "https://api.example.com/v1/tools/commerce/search"
payload = {
"query": "<string>",
"limit": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({query: '<string>', limit: 123})
};
fetch('https://api.example.com/v1/tools/commerce/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.example.com/v1/tools/commerce/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([
'query' => '<string>',
'limit' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.example.com/v1/tools/commerce/search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"limit\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/v1/tools/commerce/search")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"limit\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/tools/commerce/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"limit\": 123\n}"
response = http.request(request)
puts response.read_bodyCommerce
Search Products
Search for products across supported retailers
POST
/
v1
/
tools
/
commerce
/
search
Search Products
curl --request POST \
--url https://api.example.com/v1/tools/commerce/search \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"limit": 123
}
'import requests
url = "https://api.example.com/v1/tools/commerce/search"
payload = {
"query": "<string>",
"limit": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({query: '<string>', limit: 123})
};
fetch('https://api.example.com/v1/tools/commerce/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.example.com/v1/tools/commerce/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([
'query' => '<string>',
'limit' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.example.com/v1/tools/commerce/search"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"limit\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/v1/tools/commerce/search")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"limit\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/tools/commerce/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"<string>\",\n \"limit\": 123\n}"
response = http.request(request)
puts response.read_bodyOverview
Search for products across Amazon, Shopify, and other supported retailers. Returns product information including prices, availability, and purchase URLs.Request Body
string
required
Search query (e.g., “wireless bluetooth headphones”)
number
default:10
Maximum number of results to return (max: 50)
Response (202 - Processing)
{
"request_id": "req_abc123",
"status": "processing",
"tool": "commerce_search",
"message": "Search job queued successfully"
}
Job Result
Poll/v1/requests/{request_id} for results:
{
"status": "completed",
"result": {
"status": "success",
"query": "wireless bluetooth headphones",
"products": [
{
"product_url": "https://amazon.com/dp/B09XS7JWHH",
"title": "Sony WH-1000XM5 Wireless Headphones",
"price": 348.00,
"currency": "USD",
"image_url": "https://...",
"vendor": "Sony",
"rating": 4.7,
"review_count": 12500,
"in_stock": true,
"description": "Industry-leading noise canceling..."
}
],
"count": 10
}
}
SDK Usage
const results = await agent.commerceSearch({
query: "wireless bluetooth headphones",
limit: 10,
});
for (const product of results.products) {
console.log(`${product.title}: $${product.price}`);
console.log(` URL: ${product.product_url}`);
}
Example: Search and Buy Flow
// 1. Search for products
const search = await agent.commerceSearch({
query: "USB-C hub",
limit: 5,
});
// 2. Pick the best result
const bestProduct = search.products[0];
// 3. Purchase it
const order = await agent.commerceBuy({
product_url: bestProduct.url,
shipping_address: {
first_name: "John",
last_name: "Doe",
street: "123 Main St",
city: "San Francisco",
state: "CA",
zip_code: "94102",
phone: "4155550100",
},
});
⌘I