Skip to content
Docs

Tokens

Look up token addresses

Pass addresses to the token list to enrich portfolio holdings; unregistered tokens come back in missing.

Endpoint

GET/v1/tokens?chainId=…&addresses=…

The same list endpoint, given up to 50 token ids for one chain — such as the address values from a portfolio — returns logos and verification in one call. Every verification level is returned (unless you pass verification), so you can warn about flagged tokens a user holds. There is no paging in this mode.

Query

FieldRequiredDescription
chainIdYesGray3 chain ID
addressesYesComma-separated token ids (max 50)
verificationNoOptional filter; default is every level
Request
curl -sS "https://ledger.gray3.io/v1/tokens?chainId=ethereum&addresses=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48,0x1234567890abcdef1234567890abcdef12345678" \
  -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": {
    "items": [
      { "_id": "tok_…", "chainId": "ethereum", "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "symbol": "USDC", "verification": "verified", "…": "…" }
    ],
    "missing": ["0x1234567890abcdef1234567890abcdef12345678"]
  }
}

Tokens not in the registry

missing lists the ids Gray has no registry entry for, for example a new or custom token. It still works everywhere else: balances, prices when available, transfers and webhooks. Show it with a generic icon and the symbol from the portfolio.

Token ids

Addresses are matched in the form the portfolio API returns. EVM addresses are lowercased. XRPL uses CURRENCY:issuer, Stellar CODE:issuer, Hedera 0.0.N, and Aptos/Sui the full coin type.

Errors

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

CodeHTTPWhen
unauthorized401Missing or invalid project credentials
credits_exhausted402No credits left this billing period
invalid_argument400Unknown chainId, bad limit, cursor or verification, or more than 50 addresses
not_found404Unknown token id
rate_limit_exceeded429Throttle — retry with backoff (retryable)
json
{
  "error": {
    "code": "unauthorized",
    "message": "Human-readable detail (may be sanitized).",
    "retryable": false
  }
}