Skip to main content

Documentation Index

Fetch the complete documentation index at: https://crushrewards.dev/docs/llms.txt

Use this file to discover all available pages before exploring further.

Building with Claude or Cursor? The MCP server is the easier path — it handles wallet, payment routing, and tool registration for you. This page is for non-MCP integrations (backend services, custom agents, raw HTTP clients).
This page covers the direct HTTP integration via the x402 protocol.

1. Pick a payment protocol

Crush Rewards accepts two payment protocols on every endpoint:
  • x402 — USDC on Solana or Base. Best if your agent already holds a wallet.
  • MPP/Tempo — Hosted micropayments via Tempo. Best if you don’t want to manage wallets.
The server auto-detects which protocol you’re using from request headers.

2. Discover endpoint metadata

Every endpoint advertises pricing and accepted payment methods via a 402 Payment Required response. Hit any URL with no payment to see them:
curl -i https://api.crushrewards.dev/v1/shopper/best-price?q=airpods+pro&country=US
The response body contains an x-payment-info block listing the price (e.g. $0.01) and the recipient address per protocol. You can also browse the live endpoint catalog on x402scan, which mirrors the same discovery metadata.

3. Integrate in code

Use the official @x402/fetch wrapper to make paid requests from any Node.js or edge runtime:
npm install @x402/fetch @x402/svm
import { wrapFetchWithPayment } from "@x402/fetch";
import { createSolanaSigner } from "@x402/svm";

const signer = createSolanaSigner(process.env.SOLANA_PRIVATE_KEY!);
const paidFetch = wrapFetchWithPayment(fetch, signer);

const res = await paidFetch(
  "https://api.crushrewards.dev/v1/shopper/best-price?q=airpods+pro&country=US"
);
const data = await res.json();
paidFetch handles the full handshake: discovery → sign authorization → resend with X-Payment header → return the 200 response. See x402 details for the manual flow and Base/EVM equivalent.

4. Inspect the response

{
  "query": "airpods pro",
  "country": "US",
  "best": {
    "retailer": "amazon",
    "price": 189.00,
    "currency": "USD",
    "url": "https://amazon.com/...",
    "in_stock": true,
    "scraped_at": "2026-04-28T11:14:22Z"
  },
  "alternatives": [
    { "retailer": "walmart", "price": 199.00, "..." },
    { "retailer": "target", "price": 199.99, "..." }
  ]
}

Next steps

Browse endpoints

All 13 endpoints with live request/response examples.

Coverage

Which retailers, which countries, and how fresh the data is.