cURL
curl --request POST \ --url https://api.example.com/v1/tools/commerce/search \ --header 'Content-Type: application/json' \ --data ' { "query": "<string>", "limit": 123 } '
Search for products across supported retailers
{ "request_id": "req_abc123", "status": "processing", "tool": "commerce_search", "message": "Search job queued successfully" }
/v1/requests/{request_id}
{ "status": "completed", "result": { "products": [ { "title": "Sony WH-1000XM5 Wireless Headphones", "url": "https://amazon.com/dp/B09XS7JWHH", "price": "348.00", "currency": "USD", "image_url": "https://...", "rating": 4.7, "reviews_count": 12500, "in_stock": true } ], "total_found": 150, "query": "wireless bluetooth headphones" } }
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.url}`); }
// 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", }, });