Agent Native Best Price
Find the lowest price for a product across all platforms.
Base URL: https://api.buywhere.ai/v2/agents/best-price
Overview
The Agent Native Best Price endpoint searches for products matching a query and returns the lowest priced options across all platforms, with full agent-native metadata.
HTTP Method
GET /v2/agents/best-price
Authentication
Requires API key in the Authorization header:
Authorization: Bearer bw_live_xxxxxxxxxxxxxxxx
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
product_name | string | Yes | - | Product name to search for |
category | string | No | - | Optional category filter |
limit | integer | No | 5 | Number of results (1-50) |
currency | string | No | SGD | Response currency |
Request Example
cURL
curl -X GET "https://api.buywhere.ai/v2/agents/best-price?product_name=nike+air+max&limit=5" \
-H "Authorization: Bearer bw_live_xxxxxxxxxxxxxxxx"
Python
import httpx
API_KEY = "bw_live_xxxxxxxxxxxxxxxx"
BASE_URL = "https://api.buywhere.ai"
headers = {"Authorization": f"Bearer {API_KEY}"}
response = httpx.get(
f"{BASE_URL}/v2/agents/best-price",
params={
"product_name": "nike air max",
"limit": 5
},
headers=headers
)
data = response.json()
print(f"Found {data['total']} products")
for item in data['results']:
print(f"\n{item['title']}")
print(f" Source: {item['source']}")
print(f" Price: {item['currency']} {item['price']}")
print(f" Confidence: {item['confidence_score']}")
JavaScript (Node.js)
const API_KEY = "bw_live_xxxxxxxxxxxxxxxx";
const BASE_URL = "https://api.buywhere.ai";
const response = await fetch(
`${BASE_URL}/v2/agents/best-price?product_name=${encodeURIComponent("nike air max")}&limit=5`,
{
headers: { "Authorization": `Bearer ${API_KEY}` }
}
);
const data = await response.json();
console.log(`Found ${data.total} products`);
data.results.forEach(item => {
console.log(`\n${item.title}`);
console.log(` Source: ${item.source}`);
console.log(` Price: ${item.currency} ${item.price}`);
console.log(` Confidence: ${item.confidence_score}`);
});
Go
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
)
func bestPrice(apiKey, productName string) error {
baseURL, _ := url.Parse("https://api.buywhere.ai/v2/agents/best-price")
params := url.Values{}
params.Set("product_name", productName)
params.Set("limit", "5")
baseURL.RawQuery = params.Encode()
req, _ := http.NewRequest("GET", baseURL.String(), nil)
req.Header.Set("Authorization", "Bearer "+apiKey)
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
total := int(result["total"].(float64))
fmt.Printf("Found %d products\n", total)
results := result["results"].([]interface{})
for _, r := range results {
m := r.(map[string]interface{})
fmt.Printf("\n%s\n", m["title"])
fmt.Printf(" Source: %s\n", m["source"])
fmt.Printf(" Price: %s %s\n", m["currency"], m["price"])
}
return nil
}
Response
Success Response (200 OK)
{
"query": "nike air max",
"total": 45,
"limit": 5,
"results": [
{
"id": 18472931,
"sku": "NIKE-AIR-MAX-90",
"source": "shopee_sg",
"title": "Nike Air Max 90 Sneakers",
"price": "129.00",
"currency": "SGD",
"url": "https://shopee.sg/product/18472931",
"brand": "Nike",
"category": "Footwear",
"image_url": "https://cf.shopee.sg/file/xxxxx.jpg",
"rating": 4.8,
"review_count": 2341,
"is_available": true,
"confidence_score": 0.95,
"availability_prediction": "in_stock",
"competitor_count": 15,
"buybox_price": "129.00",
"affiliate_url": "https://buywhere.ai/track/abc123"
},
{
"id": 18472932,
"sku": "NIKE-AIR-MAX-95",
"source": "lazada_sg",
"title": "Nike Air Max 95 Running Shoes",
"price": "149.00",
"currency": "SGD",
"url": "https://www.lazada.sg/product/18472932",
"brand": "Nike",
"category": "Footwear",
"image_url": "https://static-sg.lazada.com/xxxxx.jpg",
"rating": 4.7,
"review_count": 1245,
"is_available": true,
"confidence_score": 0.93,
"availability_prediction": "in_stock",
"competitor_count": 12,
"buybox_price": "129.00",
"affiliate_url": "https://buywhere.ai/track/def456"
}
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
query | string | The product search query |
total | integer | Total matching products |
limit | integer | Results limit used |
results | array | Array of products sorted by price |
Related Endpoints
- Agent Native Search - Search for products
- Agent Native Price Comparison - Cross-platform comparison
- V2 Search - Standard V2 search