Skip to main content

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

ParameterTypeRequiredDescription
qstringYesSearch query
priceMinnumberNoMinimum price filter
priceMaxnumberNoMaximum price filter
brandstringNoFilter by brand
pageintegerNoPage 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
}