Search
Search for products with structured filters. Returns results from Amazon and Shopify.
Cost: $0.01 USDC per request
Endpoint
GET /x402/search
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
q | string | Yes | Search query |
priceMin | number | No | Minimum price filter |
priceMax | number | No | Maximum price filter |
brand | string | No | Filter by brand |
page | integer | No | Page number (default: 1) |
Example
All requests require x402 payment. Use fetchWithPay from the Quick Start:
const res = await fetchWithPay(
"https://api.purch.xyz/x402/search?q=wireless+headphones&priceMax=100"
);
const data = await res.json();
Response
{
"products": [
{
"asin": "B0CXYZ1234",
"title": "Sony WH-1000XM4 Wireless Headphones",
"price": 79.99,
"currency": "USD",
"rating": 4.7,
"reviewCount": 42531,
"imageUrl": "https://...",
"isPrime": true,
"productUrl": "https://...",
"source": "amazon"
}
],
"totalResults": 150,
"page": 1,
"hasMore": true
}