Pay per request (x402)

No account, no API key: pay for each request in USDC on Base

Every data endpoint also answers at /x402/v1/..., for agents that pay with x402 instead of an API key. Ask for the data, get a 402 Payment Required with the price, pay it and ask again. A paid request reads the full history (from 2019-01-01, daily and weekly), the same data as the Pro plan.

Price

$0.001 per credit, at least $0.01, rounded up to a whole cent. A request costs the credits the same call costs with an API key (see what each call costs), at ten times the plan rate: plans and credit packs are $0.0001 a credit. For steady use a plan is ten times cheaper.

  • Quoted before it runs. The price is worked out from the request as asked: its limit, date range or fields. A response may hold fewer rows; you pay the quote, never more.
  • Only success is charged. The payment is settled only when the endpoint answers 2xx. A 4xx or 5xx answer takes nothing.
  • At most $5.00 a request. A larger request answers 400 price_too_high: split it into shorter date ranges, fewer tickers or fields, or a smaller limit.
  • Pages. Each page is its own paid request, priced from its own limit. History is priced as a whole on its first page (its dry_run price); its later pages cost the minimum and only work for the wallet that paid for the first.

How it works

  1. Ask. Call the endpoint at https://api.tickerdb.com/x402/v1/... with the same parameters as /v1. Without a payment you get 402: the terms are in the PAYMENT-REQUIRED header (base64 JSON, x402 version 2) and in the body, which also shows credits, price_usd and route.
  2. Pay. Sign the payment for exactly amount (USDC base units: 10000 is $0.01) to payTo, scheme exact on Base (eip155:8453), and send the same request again with the payment in the PAYMENT-SIGNATURE header (X-PAYMENT works too).
  3. Get the data. We check the payment, run the request, and settle the payment only if it succeeded. The answer carries the receipt (transaction hash, network) in PAYMENT-RESPONSE and X-PAYMENT-RESPONSE.
Without a payment
curl -i "https://api.tickerdb.com/x402/v1/summary/AAPL" HTTP/2 402 payment-required: eyJ4NDAyVmVyc2lvbiI6Mi...
The 402 body
{ "x402Version": 2, "resource": { "url": "https://api.tickerdb.com/x402/v1/summary/AAPL", "mimeType": "application/json", ... }, "accepts": [{ "scheme": "exact", "network": "eip155:8453", "amount": "10000", "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", "payTo": "0x...", "maxTimeoutSeconds": 120, "extra": { "name": "USD Coin", "version": "2" } }], "route": "/v1/summary/:ticker", "credits": 1, "price_usd": 0.01 }
With an x402 client
# Any x402 client works; Stripe's purl pays from its own wallet purl "https://api.tickerdb.com/x402/v1/summary/AAPL"

Payments go to our Stripe account and show on your wallet's statement as a USDC transfer on Base.

Routes and quotes

Each route takes the same parameters and returns the same JSON as its /v1 twin. The quote is in credits; the price is credits × $0.001, at least $0.01, rounded up to the cent.

RouteSame asQuote (credits)Typical price
/x402/v1/summary/{ticker} /v1/summary/{ticker} 1 credit; 2 for band events with cross-asset context (context_ticker) $0.01, also with context
/x402/v1/ohlcv/{ticker} /v1/ohlcv/{ticker} 1 per 100 bars of limit (default 100), or of the start-end span when shorter $0.01 up to 1,000 bars
/x402/v1/search /v1/search 1 per 100 rows of limit (default 20, at most 250) $0.01
/x402/v1/universe /v1/universe 25 per 10 fields $0.03 per 10 fields, $0.08 for 30
/x402/v1/history (GET or POST) /v1/history the dry_run price of the request (later pages: the minimum) $0.025 per date per 10 fields, rounded up to the cent
/x402/v1/market /v1/market 1 for one date; a range: 1 per 100 rows of limit (default 100), or of the span when shorter $0.01
/x402/v1/diff /v1/diff 1 for the newest run; between two dates: 1 per ticker $0.01; $0.05 for 50 tickers between dates
/x402/v1/funds /v1/funds 1 credit $0.01
/x402/v1/funds/holders /v1/funds/holders 1 per 100 rows of limit (default 100) $0.01
/x402/v1/funds/holdings /v1/funds/holdings 1 per 100 rows of limit (default 500) $0.01
/x402/v1/indexes /v1/indexes 1 credit $0.01
/x402/v1/indexes/members /v1/indexes/members 1 per 100 of the index's members on the date $0.01 (S&P 500), $0.02 (Russell 2000)
/x402/v1/insiders /v1/insiders 1 credit $0.01
/x402/v1/insiders/trades /v1/insiders/trades 1 per 100 rows of limit (default 100) $0.01
/x402/v1/insiders/holdings /v1/insiders/holdings 1 per 100 rows of limit (default 100) $0.01
/x402/v1/models /v1/models 1 credit $0.01
/x402/v1/models/holdings /v1/models/holdings 1 per 100 rows of limit (default 250) $0.01
/x402/v1/models/{slug} /v1/models/{slug} 1 credit $0.01
/x402/v1/models/{slug}/history /v1/models/{slug}/history 1 per 100 rows of limit (default 100) $0.01
/x402/v1/models/{slug}/holdings /v1/models/{slug}/holdings 1 credit $0.01
/x402/v1/models/{slug}/trades /v1/models/{slug}/trades 1 per 100 rows of limit (default 100) $0.01
/x402/v1/statements /v1/statements 1 per 100 rows of tickers x limit (default 8 periods); with since: of limit (default 100) $0.01; $0.02 for 50 tickers x 40 periods
/x402/v1/statements/{ticker} /v1/statements/{ticker} 1 per 100 periods of limit (default 8, at most 40; revisions counted at 10 versions a period) $0.01

Not offered over x402: /v1/account (needs an account), /v1/watchlist (needs an account), /v1/watchlist/diff (needs an account), /v1/schema/fields (free: no payment needed), /v1/status (free: no payment needed), and the routes that change an account (watchlist add and remove, device login).

Limits

  • Per wallet: 250 paid requests per 10 seconds per paying wallet (the Pro plan's per-key limit).
  • Per client: 250 requests per 10 seconds per client address, paid or not.

Over a limit you get 429 rate_limit_exceeded with Retry-After: 10; nothing is charged.

Errors

StatusMeaningCharged
402No payment, or the payment was refused (wrong amount, network or address, a bad signature, or settlement failed). The body's error says why; PAYMENT-REQUIRED has the terms to pay.No
400 price_too_highThe quote is above $5.00. Split the request.No
4xx, 5xx from the endpointThe same errors as /v1 (see Errors). The payment is not settled.No
429Over a limit. Retry after Retry-After seconds.No
502 settlement_unknownWe could not confirm the settlement, so no data was sent. If USDC left your wallet for it, contact support@tickerdb.com.Possibly
503 facilitator_unavailableThe payment could not be checked. Retry with the same payment.No
503 x402_unavailablePay-per-request is switched off. Use an API key.No