Skip to content
Docs

Portfolio and balances

Multi-chain portfolio

GET /v1/portfolio/multi returns balances for one address across up to 20 chains per request.

Endpoint

GET/v1/portfolio/multi

Query

  • address (required)
  • chainIds (optional) — comma-separated; omit to fan out all plan chains
Request
curl -sS "https://blockchain.gray3.io/v1/portfolio/multi?address=0xYourAddress&chainIds=ethereum,base,solana" \
  -H "X-Gray-Project-Id: proj_your_project_id" \
  -H "Authorization: Bearer gray_sk_your_secret"

Response

HTTP 200 — success envelope wraps the payload in data.

json
{
  "data": {
    "address": "0xYourAddress",
    "chains": [
      {
        "chainId": "ethereum",
        "portfolio": {
          "chainId": "ethereum",
          "address": "0xYourAddress",
          "assets": [],
          "source": "indexer"
        }
      },
      {
        "chainId": "solana",
        "error": "portfolio_unavailable"
      }
    ],
    "source": "multi"
  }
}

Each entry in data.chains has either portfolio or error (machine code string). The request can succeed at HTTP 200 with partial failures—always render per-chain status.

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
invalid_argument400Missing address or invalid chainIds list
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)
portfolio_unavailable503Entire multi call failed (rare—per-chain errors are usually inline) (retryable)
json
{
  "error": {
    "code": "invalid_argument",
    "message": "Human-readable detail (may be sanitized).",
    "retryable": false
  }
}