Aggregation · market.candles

Price Candles

Bounded OHLCV history

Request
POST /v1/market/candles
Price
$0.04 USDC / fUSD
Typical latency
~500 ms
Settles on
Hedera testnet · x402
Try it in the browser

Data sources

  • Binance

    Primary OHLCV candles with volume

  • Bybit

    Candles cross-check, funding rate, open interest

  • OKX

    Candles cross-check and fallback

  • CoinGecko

    Spot prices, trending, categories, token prices

Input

JSON body (content-type: application/json). Add ?format=compact to get numbers only.

FieldTypeRules
symbols*string[]—
marketTypestringone of crypto, meme, forex, equity, etf · default "crypto"
intervalstringone of 1m, 5m, 15m, 1h, 4h, 1d · default "1h"
limitinteger≥ 2 · ≤ 500 · default 100

Code

import { x402Client } from '@x402/core/client'
import { wrapFetchWithPayment, decodePaymentResponseHeader } from '@x402/fetch'
import { ExactHederaScheme } from '@x402/hedera/exact/client'
import { createClientHederaSigner } from '@x402/hedera'
import { PrivateKey } from '@hiero-ledger/sdk'

// Your Hedera account pays USDC (0.0.429274 on testnet); Blocky402 pays the network fee.
const signer = createClientHederaSigner(process.env.HEDERA_ACCOUNT_ID!, PrivateKey.fromStringECDSA(process.env.HEDERA_PRIVATE_KEY!), { network: 'hedera:testnet' })
const client = x402Client.fromConfig({ schemes: [{ network: 'hedera:testnet', client: new ExactHederaScheme(signer) }] })
const paidFetch = wrapFetchWithPayment((input, init) => globalThis.fetch(input, init), client)

const res = await paidFetch('https://finality.accuracy.wtf/api/x402/v1/market/candles', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({"symbols":["BTC"],"marketType":"crypto","interval":"1h","limit":100}),
})
const { data, meta } = await res.json()           // $0.04 USDC, paid only if the call succeeds
const receipt = decodePaymentResponseHeader(res.headers.get('PAYMENT-RESPONSE')!)
console.log(data, meta.sources, receipt.transaction)

Illustrative response

{
  "success": true,
  "operationId": "market.candles",
  "requestId": "example",
  "data": {
    "candles": [
      {
        "time": 1700000000000,
        "open": 100,
        "high": 102,
        "low": 99,
        "close": 101,
        "volume": 1000
      }
    ]
  },
  "meta": {
    "sources": [
      "binance",
      "bybit",
      "okx",
      "coingecko"
    ],
    "asOf": "2026-11-07T00:00:00.000Z",
    "synthetic": true
  }
}