PricePilot402 x402 Buyer Example

Use this public example to discover a payment challenge, pay with an x402-compatible client, and retry the same resource with a payment proof.

What You Get After Payment

The paid API returns structured JSON that an agent or script can use directly: comparable endpoint clusters, price dispersion, payer density, visible GMV estimates, opportunity flags, confidence, source trail, and recommended follow-up inputs where the route supports them.

The public pages show crawlable market summaries. The paid routes return decision-grade benchmark fields for pricing, buying, listing, or comparing x402 APIs.

Why Pay For The API

Use this when deciding whether to buy, list, price, or benchmark an x402 endpoint.

The public page shows the market summary; the paid response gives route-specific decision fields that an agent can use directly.

You are paying for normalized comparison, price position, payer/call density, visible GMV estimate, confidence explanation, opportunity flags, source trail, and recommended follow-up inputs.

Open the guided use case for finding underpriced x402 data APIs.

Live Provisional Routes

1. Fetch The Challenge

Call the route without a payment header. A live provisional route returns HTTP 402 plus the authoritative PAYMENT-REQUIRED header.

curl -i "https://pricepilot402.pricepilot402-arya.workers.dev/v1/market/hot-categories?limit=5"

2. Pay And Retry

Your x402 client reads PAYMENT-REQUIRED, creates a Base USDC payment proof, then retries the same route with PAYMENT-SIGNATURE. Keep the proof and private key in your buyer runtime; PricePilot402 does not need private keys.

curl -i "https://pricepilot402.pricepilot402-arya.workers.dev/v1/benchmark/category" \
  -H "content-type: application/json" \
  -H "Idempotency-Key: buyer-demo-001" \
  -H "PAYMENT-SIGNATURE: <x402 payment proof>" \
  --data '{"category":"web-search","network":"eip155:8453"}'

Client Pattern

const resource = "https://pricepilot402.pricepilot402-arya.workers.dev/v1/market/hot-categories?limit=5";
const challenge = await fetch(resource);

if (challenge.status !== 402) {
  throw new Error("Expected x402 payment challenge");
}

const paymentRequired = challenge.headers.get("PAYMENT-REQUIRED");

// Use your x402-compatible wallet/client to satisfy paymentRequired.
// The client should sign/pay on Base USDC and return a PAYMENT-SIGNATURE value.
const paymentSignature = await yourX402Client.createPayment({ paymentRequired });

const paid = await fetch(resource, {
  headers: {
    "Idempotency-Key": crypto.randomUUID(),
    "PAYMENT-SIGNATURE": paymentSignature
  }
});

console.log(await paid.json());

Keep your buyer private key in your own client or wallet runtime. Do not send private keys to PricePilot402.

Do Not Count As M1A Demand

Unpaid 402 probes, docs visits, internal verification, replay checks, and self-funded smoke payments are API intent or operational evidence only. M1A demand requires real external paid benchmark usage.

Discovery