DEVELOPER REFERENCE / V1
Crumb402 API docs.
One public URL in, one JSON object out. Start with the sample to wire up your parser without a wallet or an upstream request.
Payment status: check for a live quote with an unsigned inspection request. A 402 quote is not proof of settlement. If configuration or facilitator initialization is unavailable, the endpoint returns 503.
Quickstart
curl -sS https://crumb402.com/health
curl -sS https://crumb402.com/v1/sample
/health reports the active network and currency and whether payment settings pass basic validation. It does not test the facilitator or prove settlement. The fixed /v1/sample response has demo: true; do not use its fingerprint as a live baseline.
Read the sample in Node.js
const response = await fetch('https://crumb402.com/v1/sample');
if (!response.ok) throw new Error(`Crumb402 returned ${response.status}`);
const sample = await response.json();
if (sample.demo !== true) throw new Error('Expected a fixed demo');
console.log(sample.title, sample.facts);
Inspect a page
curl -iG https://crumb402.com/v1/inspect \
--data-urlencode 'url=https://example.com/'
Supply exactly one url. An optional since is a 64-character hexadecimal SHA-256 fingerprint from your previous inspection. Omit it (or leave it empty) for changed: null. Otherwise, changed is false for a match and true for a difference. A successful unchanged result is still a new inspection.
The response includes url, finalUrl, title, description, canonical, openGraph (arrays of values), jsonLd, and facts grouped under product, event, and job. The excerpt contains up to 600 Unicode code points. The fingerprint covers full normalized body text and extracted metadata and JSON-LD, not raw HTML. Use the same endpoint and target for comparisons. A fingerprint does not attest to the source’s accuracy.
Pay with x402 v2
- Send the GET request without a signature. Read x402 requirements from the
PAYMENT-REQUIREDheader on the402response. - Check the recipient against your own trusted configuration and verify the exact scheme, BNB Smart Chain (
eip155:56), and 5,000,000,000,000,000 atomic units (0.005 USD1). See the payment guide for the asset contract. Set a spending cap before authorizing. - Use an x402 v2 EVM client that supports Permit2 exact payments to sign the authorization and retry the same request with
PAYMENT-SIGNATURE. Keep signing keys in your client, never in the URL or on the Crumb402 site. - On success, inspect the
PAYMENT-RESPONSEreceipt. Verify settlement on BNB Chain before relying on it. If settlement is uncertain, check the original authorization before signing another.
There are no accounts, subscriptions, or API keys. The sample does not exercise the payment flow.
Browser clients can call the JSON endpoints from any origin without credentials and read PAYMENT-REQUIRED and PAYMENT-RESPONSE. An OPTIONS preflight returns 204 without payment or inspection; HEAD on the inspection endpoint is quote-only. An unsigned quote includes optional Bazaar discovery metadata, not proof of indexing or settlement.
Eligibility and errors
Targets must use a public HTTP(S) hostname on the default port. Inspection reads at most 196,608 bytes of HTML, follows up to five page redirects, and shares a 6.5-second network budget across DNS, robots.txt, and page fetches. Every outbound inspection request pins a public DNS address. Crumb402Bot obeys robots.txt; only 404 and 410 count as a missing policy. No resources, scripts, or redirects implied by page content are loaded.
| HTTP | Meaning |
|---|---|
| 400 / 431 | Invalid URL, malformed fingerprint, or oversized payment header. |
| 401 | Invalid, expired, or mismatched payment authorization. No inspection result is returned. |
| 402 | Payment quote or settlement rejection. Inspect the x402 response headers. |
| 403 | Robots exclusion, private or reserved target, or blocked redirect. |
| 405 | Unsupported method. The API accepts GET, HEAD, and OPTIONS. |
| 422 | Unsupported encoding or document type, response too large, or redirect limit exceeded. |
| 502 / 504 | DNS, robots policy, upstream, or facilitator failure; or inspection timeout. |
| 503 | Payment settings are absent or the facilitator could not initialize for BNB Chain x402 v2. |