Shop
AI-powered natural language product search. Describe what you need, get curated results. One-shot — always returns products.
Cost: $0.10 USDC per request
Endpoint
POST /x402/shop
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | Natural language product search query |
context | object | No | Optional context with price range and preferences |
context.priceRange | object | No | { min?: number, max?: number } |
context.preferences | string[] | No | List of preferences |
Example
All requests require x402 payment. Use fetchWithPay from the Quick Start:
const res = await fetchWithPay("https://api.purch.xyz/x402/shop", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
message: "comfortable running shoes for marathon training under $150",
}),
});
const data = await res.json();
Response
{
"reply": "Here are some great marathon training shoes...",
"products": [
{
"asin": "B0CXYZ1234",
"title": "Nike Pegasus 41",
"price": 129.99,
"currency": "USD",
"rating": 4.7,
"reviewCount": 12453,
"imageUrl": "https://...",
"source": "amazon"
}
]
}