Product Detail by SKU API — Developer Documentation
BUY-3254 |
GET /v1/products/{sku}— product detail endpoint with price variants and merchant links
Overview
GET /v1/products/{sku} retrieves a single product by its SKU, returning full product details including price variants (color, size, storage options) and merchant links (affiliate URLs across all platforms selling the same product).
Key characteristics:
- SKU lookup — exact match on product SKU from source platform
- Price variants — all available options (color, size, storage) with their respective prices
- Merchant links — tracked affiliate URLs for every platform offering this product
- Cross-platform aggregation — same SKU across Shopee, Lazada, Amazon, and more in one response
- p99 < 50ms — optimized for real-time agentic shopping flows
Endpoint
GET /v1/products/{sku}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
sku | string | Yes | The product SKU (e.g., IPHONE15PRO256BLK) |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
currency | string | No | Target currency for price conversion (SGD, MYR, THB, etc.) |
include_variants | boolean | No | Include price variants (default: true) |
include_merchant_links | boolean | No | Include merchant/affiliate links (default: true) |
Authentication
All requests require a Bearer token:
curl "https://api.buywhere.ai/v1/products/IPHONE15PRO256BLK" \
-H "Authorization: Bearer bw_live_xxxxx"
See Authentication Guide for API key generation.
Response Envelope
{
"product": {
"id": 18472931,
"sku": "IPHONE15PRO256BLK",
"source": "shopee_sg",
"merchant_id": "SHOPEE_SG_001",
"name": "iPhone 15 Pro 256GB Black Titanium",
"description": "Titanium design. A17 Pro chip. Customizable Action button.",
"price": "1349.00",
"currency": "SGD",
"price_sgd": "1349.00",
"buy_url": "https://shopee.sg/product/iphone-15-pro-256gb",
"image_url": "https://cf.shopee.sg/file/...",
"brand": "Apple",
"category": "Mobile Phones",
"category_path": ["Electronics", "Phones", "Mobile Phones"],
"rating": "4.8",
"review_count": 2341,
"is_available": true,
"in_stock": true,
"stock_level": "high",
"last_checked": "2026-04-18T10:00:00Z",
"data_updated_at": "2026-04-18T08:30:00Z",
"updated_at": "2026-04-18T14:30:00Z",
"has_variants": true,
"specs": {
"color": "Black Titanium",
"storage": "256GB",
"display": "6.1-inch Super Retina XDR"
}
},
"price_variants": [
{
"variant_id": "IPHONE15PRO256BLK",
"variant_name": "256GB Black Titanium",
"price": "1349.00",
"currency": "SGD",
"stock_status": "in_stock",
"specs": {
"color": "Black Titanium",
"storage": "256GB"
}
},
{
"variant_id": "IPHONE15PRO256WHT",
"variant_name": "256GB White Titanium",
"price": "1349.00",
"currency": "SGD",
"stock_status": "in_stock",
"specs": {
"color": "White Titanium",
"storage": "256GB"
}
},
{
"variant_id": "IPHONE15PRO512BLK",
"variant_name": "512GB Black Titanium",
"price": "1549.00",
"currency": "SGD",
"stock_status": "low_stock",
"specs": {
"color": "Black Titanium",
"storage": "512GB"
}
}
],
"merchant_links": [
{
"source": "shopee_sg",
"merchant_id": "SHOPEE_SG_001",
"merchant_name": "Shopee Singapore",
"price": "1349.00",
"currency": "SGD",
"buy_url": "https://shopee.sg/product/iphone-15-pro-256gb",
"affiliate_url": "https://buywhere.ai/track/shopee_sg/18472931",
"is_available": true,
"rating": "4.8",
"review_count": 2341,
"last_checked": "2026-04-18T10:00:00Z"
},
{
"source": "lazada_sg",
"merchant_id": "LAZADA_SG_001",
"merchant_name": "Lazada Singapore",
"price": "1369.00",
"currency": "SGD",
"buy_url": "https://www.lazada.sg/products/iphone-15-pro",
"affiliate_url": "https://buywhere.ai/track/lazada_sg/18472932",
"is_available": true,
"rating": "4.7",
"review_count": 891,
"last_checked": "2026-04-18T09:45:00Z"
},
{
"source": "amazon_sg",
"merchant_id": "AMAZON_SG_001",
"merchant_name": "Amazon Singapore",
"price": "1399.00",
"currency": "SGD",
"buy_url": "https://www.amazon.sg/dp/B0CIDRXQ5G",
"affiliate_url": "https://buywhere.ai/track/amazon_sg/18472933",
"is_available": true,
"rating": "4.6",
"review_count": 203,
"last_checked": "2026-04-18T10:15:00Z"
}
],
"meta": {
"total_merchants": 3,
"total_variants": 6,
"cheapest_price": "1349.00",
"cheapest_source": "shopee_sg",
"lowest_rating": "4.6",
"data_freshness": "recent"
}
}
Field Definitions
Product Object
| Field | Type | Description |
|---|---|---|
id | integer | Unique BuyWhere product ID |
sku | string | Product SKU from source platform |
source | string | Primary source platform (e.g., shopee_sg) |
merchant_id | string | Merchant/store identifier |
name | string | Product title |
description | string | Full product description |
price | string | Current price as decimal string |
currency | string | ISO currency code |
buy_url | string | Direct purchase URL on source platform |
affiliate_url | string | BuyWhere tracked affiliate link |
image_url | string | Product image URL |
brand | string | Brand name |
category | string | Product category |
category_path | array | Hierarchical category path |
rating | string | Average rating (0-5) |
review_count | integer | Number of reviews |
is_available | boolean | Currently in stock |
has_variants | boolean | Whether product has price variants |
specs | object | Key-value product specifications |
Price Variant Object
| Field | Type | Description |
|---|---|---|
variant_id | string | Unique variant identifier |
variant_name | string | Human-readable variant name |
price | string | Variant price |
currency | string | Currency code |
stock_status | string | Stock level: in_stock, low_stock, out_of_stock, pre_order |
specs | object | Variant-specific specs (color, storage, size, etc.) |
Merchant Link Object
| Field | Type | Description |
|---|---|---|
source | string | Platform source (e.g., lazada_sg, shopee_sg) |
merchant_id | string | Merchant identifier |
merchant_name | string | Display name of merchant/store |
price | string | Price on this platform |
currency | string | Currency code |
buy_url | string | Direct purchase URL |
affiliate_url | string | BuyWhere tracked affiliate link for commissions |
is_available | boolean | Available on this platform now |
rating | string | Platform rating for this product |
review_count | integer | Reviews on this platform |
last_checked | string | ISO timestamp of last availability check |
Meta Object
| Field | Type | Description |
|---|---|---|
total_merchants | integer | Number of platforms selling this SKU |
total_variants | integer | Number of price variants |
cheapest_price | string | Lowest price across all merchants |
cheapest_source | string | Platform with lowest price |
lowest_rating | string | Lowest rating across merchants |
data_freshness | string | fresh, recent, stale, very_stale |
Examples
Basic SKU Lookup
curl "https://api.buywhere.ai/v1/products/IPHONE15PRO256BLK" \
-H "Authorization: Bearer bw_live_xxxxx"
With Currency Conversion (to MYR)
curl "https://api.buywhere.ai/v1/products/IPHONE15PRO256BLK?currency=MYR" \
-H "Authorization: Bearer bw_live_xxxxx"
Variants Only (no merchant links)
curl "https://api.buywhere.ai/v1/products/IPHONE15PRO256BLK?include_merchant_links=false" \
-H "Authorization: Bearer bw_live_xxxxx"
Merchant Links Only (no variants)
curl "https://api.buywhere.ai/v1/products/IPHONE15PRO256BLK?include_variants=false" \
-H "Authorization: Bearer bw_live_xxxxx"
SDK Usage
Python SDK
from buywhere import BuyWhere
client = BuyWhere(api_key="bw_live_xxxxx")
# Basic lookup
response = client.products.get_by_sku("IPHONE15PRO256BLK")
# Access product details
print(response.product.name)
print(response.product.price)
# Iterate over price variants
for variant in response.price_variants:
print(f"{variant.variant_name}: {variant.price}")
# Iterate over merchant links
for merchant in response.merchant_links:
print(f"{merchant.source}: {merchant.price} -> {merchant.affiliate_url}")
# Find cheapest option
cheapest = min(response.merchant_links, key=lambda m: float(m.price))
print(f"Cheapest: {cheapest.source} at {cheapest.price}")
JavaScript/TypeScript SDK
import { BuyWhere } from "@buywhere/sdk";
const client = new BuyWhere({ apiKey: "bw_live_xxxxx" });
// Basic lookup
const response = await client.products.getBySku("IPHONE15PRO256BLK");
// Access product details
console.log(response.product.name);
console.log(response.product.price);
// Iterate over price variants
for (const variant of response.priceVariants) {
console.log(`${variant.variantName}: ${variant.price}`);
}
// Iterate over merchant links
for (const merchant of response.merchantLinks) {
console.log(`${merchant.source}: ${merchant.price} -> ${merchant.affiliateUrl}`);
}
// Find cheapest option
const cheapest = response.merchantLinks.reduce((min, m) =>
parseFloat(m.price) < parseFloat(min.price) ? m : min
);
console.log(`Cheapest: ${cheapest.source} at ${cheapest.price}`);
Agentic Commerce Use Cases
Shopping Agent: "Find me the cheapest iPhone 15 Pro"
# Agent workflow for product comparison
async def find_cheapest_product(sku: str):
response = client.products.get_by_sku(sku)
# Sort by price
by_price = sorted(response.merchant_links, key=lambda m: float(m.price))
# Present to user
return {
"product_name": response.product.name,
"options": [
{
"merchant": m.merchant_name,
"price": m.price,
"affiliate_url": m.affiliate_url,
"rating": m.rating,
"in_stock": m.is_available
}
for m in by_price[:5]
]
}
Shopping Agent: "Check if my size is in stock"
# Agent workflow for variant checking
async def check_variant_availability(sku: str, target_specs: dict):
response = client.products.get_by_sku(sku)
for variant in response.price_variants:
if all(variant.specs.get(k) == v for k, v in target_specs.items()):
return {
"variant_name": variant.variant_name,
"price": variant.price,
"stock_status": variant.stock_status,
"merchants": [
m for m in response.merchant_links
if m.is_available
]
}
return {"error": "Variant not found"}
Error Responses
| Status | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 404 | PRODUCT_NOT_FOUND | No product with this SKU exists |
| 422 | VALIDATION_ERROR | Invalid parameter value |
| 429 | RATE_LIMIT_EXCEEDED | Slow down requests |
| 500 | INTERNAL_ERROR | Server-side failure |
404 Not Found Response
{
"error": {
"code": "PRODUCT_NOT_FOUND",
"message": "No product found with SKU: NONEXISTENT_SKU",
"details": {
"sku": "NONEXISTENT_SKU",
"suggestion": "Verify the SKU or search for the product first"
}
}
}
Performance Characteristics
Performance varies based on load conditions. Targets below represent single-request baseline latency:
| Condition | Expected Latency | Notes |
|---|---|---|
| Baseline (single request) | p50 < 15ms, p99 < 50ms | Low traffic, warm cache |
| Moderate load (100 concurrent) | p50 < 50ms, p99 < 150ms | Typical API usage |
| Heavy load (1000+ concurrent) | p50 < 200ms, p99 < 600ms | Peak traffic scenarios |
Cache TTL: 5 minutes (300 seconds)
Note: Actual latency depends on query complexity, network conditions, and server load. Complex SKU lookups with multiple merchant links may see higher latency.
Caching
Responses are cached server-side for 5 minutes to improve performance for repeated queries.
Client-side caching: Use Cache-Control headers to cache responses locally:
Cache-Control: private, max-age=300
Cache invalidation: Send unique query parameters (e.g., &t=timestamp) to bypass cache when fresh data is required.
Rate Limits
Applies per API key. See Rate Limits for details.
| Tier | Limit | Window |
|---|---|---|
| Free | 60 requests | 1 minute |
| Live | 600 requests | 1 minute |
| Partner | Unlimited | — |
Implementation Notes
- SKU vs ID — Use
GET /v1/products/{sku}for human-readable lookups (agent workflows). UseGET /v1/products/{id}for internal/database IDs. - Same SKU, multiple merchants — The
merchant_linksarray shows every platform offering this exact SKU, enabling cross-platform price comparison. - Variant structure — Price variants reflect option-level pricing (color, storage, size). For full cross-platform comparison, see
merchant_links. - Affiliate links — Always use
affiliate_urlfor BuyWhere tracked links that support our commerce infrastructure.
Related Endpoints
GET /v1/products— Paginated product listingGET /v1/products/{id}— Product by internal IDGET /v1/products/bulk-lookup— Batch SKU lookupGET /v1/search— Full-text product searchGET /v1/products/{id}/similar— Similar products