Skip to content
Docs

Prices

Multi-token prices

POST /v1/prices/multi returns USD prices for up to 50 tokens across chains in one call.

Endpoint

POST/v1/prices/multi

Body

tokens — array of { chainId, address? }, max 50.

Request
curl -sS -X POST "https://blockchain.gray3.io/v1/prices/multi" \
  -H "X-Gray-Project-Id: proj_your_project_id" \
  -H "Authorization: Bearer gray_sk_your_secret" \
  -H "Content-Type: application/json" \
  -d '{
  "tokens": [
    { "chainId": "ethereum" },
    { "chainId": "base", "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" }
  ]
}'

Response

HTTP 200 — success envelope wraps the payload in data.

json
{
  "data": {
    "quotes": [
      { "chainId": "ethereum", "priceUsd": "3200.12" }
    ],
    "failures": [
      {
        "chainId": "base",
        "address": "0x…",
        "code": "not_found",
        "message": "Token not priced"
      }
    ],
    "asOf": "2026-10-15T08:00:00.000Z",
    "source": "aggregator"
  }
}

HTTP 200 with partial data is normal: priced tokens sit in quotes, failures in failures. Use asOf for staleness in UI.

Errors

Errors use HTTP { "error": { "code", "message", "retryable" } }. Branch on code, not the message text.

Every authenticated route may also return unauthorized (401), revoked_secret (401), forbidden (403), credits_exhausted (402), plan_feature_denied (403), rate_limit_exceeded (429, retryable), and invalid_argument (413) for request bodies over 256 KiB.

CodeHTTPWhen
unsupported_capability400Testnet chain id or feature disabled on testnets (prices, NFTs, DeFi, swap)
invalid_argument400Missing or malformed chainId, address, or body fields
plan_chain_denied403chainId is not on the project plan
chain_disabled403Chain turned off in Console › Networks
unsupported_capability400Capability not offered for this chain (e.g. testnet prices)
prices_batch_limit400More than 50 tokens in POST /v1/prices/multi
prices_unavailable503The price service is temporarily unavailable (retryable)
json
{
  "error": {
    "code": "unsupported_capability",
    "message": "Human-readable detail (may be sanitized).",
    "retryable": false
  }
}