Product Search
curl --request POST \
--url https://api.example.com/v1/tools/find/product \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"limit": 123
}
'import requests
url = "https://api.example.com/v1/tools/find/product"
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/find/product', 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/find/product",
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/find/product"
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/find/product")
.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/find/product")
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
Product Search
Search for products across supported retailers
POST
/
v1
/
tools
/
find
/
product
Product Search
curl --request POST \
--url https://api.example.com/v1/tools/find/product \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"limit": 123
}
'import requests
url = "https://api.example.com/v1/tools/find/product"
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/find/product', 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/find/product",
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/find/product"
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/find/product")
.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/find/product")
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_body
Overview
Searches Amazon, Shopify, and other supported retailers and returns products with price, availability, and purchase URL. The search runs as a job: you get arequest_id, then poll /v1/requests/{request_id} for the result (the search runs in the API, so it is usually there on the first poll). Pass a result’s product_url to Purchase.
Request Body
string
required
Search query (e.g., “wireless bluetooth headphones”)
number
default:10
Maximum results (up to 50)
Response (202 - Processing)
{
"request_id": "req_abc123",
"receipt_id": "rcpt_abc123",
"status": "processing",
"tool": "commerce",
"message": "Product search in progress. Check status with /v1/requests/{id}."
}
Job Result
Poll/v1/requests/{request_id} for results:
{
"request_id": "req_abc123",
"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": null,
"vendor": "Amazon",
"rating": null,
"review_count": null,
"in_stock": null,
"description": "Industry-leading noise canceling..."
}
],
"count": 1
}
}
price, image_url, vendor, rating, review_count, in_stock and description are null when the search did not find them. A search that finds nothing completes with products: [] and count: 0. A search that could not run ends the job failed with an error_code.
SDK Usage
const results = await agent.productFind({
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.productFind({
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.product_url,
shipping_address: {
first_name: "John",
last_name: "Doe",
street: "123 Main St",
city: "San Francisco",
state: "CA",
zip_code: "94102",
phone: "4155550100",
},
});