Aggregation · market.tokenPrices

Token Prices

ERC-20 / on-chain token USD prices

Request
GET /v1/market/token-prices
Price
$0.045 USDC / fUSD
Typical latency
~400 ms
Settles on
Hedera testnet · x402
Try it in the browser

Data sources

  • CoinGecko

    Spot prices, trending, categories, token prices

Input

Query string parameters. Add ?format=compact to get numbers only.

FieldTypeRules
networkstringdefault "eth"
addresses*string[]—

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/token-prices?network=eth&addresses=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48%2C0x6b175474e89094c44da98b954eedeac495271d0f', { method: 'GET' })
const { data, meta } = await res.json()           // $0.045 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.tokenPrices",
  "requestId": "example",
  "data": {
    "tokenPrices": [
      {
        "network": "eth",
        "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "priceUsd": 1
      }
    ]
  },
  "meta": {
    "sources": [
      "coingecko"
    ],
    "asOf": "2026-11-07T00:00:00.000Z",
    "synthetic": true
  }
}