# Chainmetric API > Reference for the Chainmetric data API: token, wallet and launch data on EVM chains and Solana, over HTTP and server-sent events. **Basics** - Base URL: `https://api.chainmetric.io`. - Auth: send `Authorization: `, the bare key. - `Authorization: Bearer ` is refused with `403` at the edge. Do not add `Bearer`. - Chain ids: Ethereum `1`, BNB Chain `56`, Base `8453`, Solana `1399811149`. - EVM addresses: 40 hex characters, lowercase, no `0x`. Solana addresses: base58, case-sensitive. - Every answer is JSON in one envelope; the document is in `data`. - A value that cannot be computed exactly is `null`, never `0`. - The full spec is at [/openapi.json](/openapi.json). Every page is also Markdown at `.md`. **From question to route** | Question | Route | |---|---| | Price, market cap, volume, holders of a token | `GET /v2/token/{chain_id}/{address}/stats` | | Recent buys and sells of a token | `GET /v2/token/{chain_id}/{address}/trades` | | Price history or a chart | `GET /v2/token/{chain_id}/{address}/ohlcv?interval=1h` | | Liquidity added or removed | `GET /v2/token/{chain_id}/{address}/liquidity` | | Top holders of a token | `GET /v2/token/{chain_id}/{address}/positions` | | Who funded a wallet | `GET /v2/wallet/{chain_id}/{address}/funding?hops=root` | | What a wallet holds of one token | `GET /v2/wallet/{chain_id}/{wallet}/position/{token}` | | What launched just now | `GET /v2/pilot/trenches/{chain_id}?view=launches` | | Live trades, resumable | `GET /v2/stream/token/{chain_id}/{address}/replay` | Trades, liquidity and holders answer on EVM chains; Solana support for them is in progress. **Errors and retries** - Every error is `{"error": "...", "message": "...", "statusCode": 400}`. - `400`: the request is wrong. Fix it; do not retry unchanged. - `401`: the key is missing, unknown or revoked. `404`: unknown chain, token or resource. - `429`: the key's rate limit is reached. Back off exponentially and retry. - `503`: busy or catching up. Wait `Retry-After` seconds when sent, then retry. - `500`, `502`, `504`: retry with exponential backoff, at most a few times. **Streams** - `/v2/stream/...` routes are server-sent events: `event:` and `data:` lines, one JSON envelope per event. - Resumable streams send `id:` lines. Reconnect with header `Last-Event-ID: ` to resume. - The trades and liquidity replay streams also start from history with `from_block` or `from_seq`. - A `: keepalive` comment arrives every 20 seconds. **Three calls** ```sh curl -s -H "Authorization: $CHAINMETRIC_KEY" https://api.chainmetric.io/v2/token/1/c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2/stats curl -s -H "Authorization: $CHAINMETRIC_KEY" "https://api.chainmetric.io/v2/token/1/c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2/trades?limit=3" curl -s -H "Authorization: $CHAINMETRIC_KEY" "https://api.chainmetric.io/v2/pilot/trenches/1399811149?view=curves&limit=3" ``` **Every page, as Markdown** - [For AI agents](https://docs.chainmetric.com/agents.md): Everything an agent needs to call the Chainmetric API, on one page. - [Authentication](https://docs.chainmetric.com/authentication.md): Send the bare key in the Authorization header; Bearer is refused. - [Chains and addresses](https://docs.chainmetric.com/chains-and-addresses.md): Which chain ids the API takes in the path, and how addresses are written in requests and answers. - [Errors and retries](https://docs.chainmetric.com/errors.md): The one error shape every route uses, and what to do with each status code. - [Chainmetric API](https://docs.chainmetric.com/index.md): Token, wallet and launch data on Ethereum, BNB Chain, Base and Solana, over HTTP and server-sent events. - [Mobula-compatible endpoints](https://docs.chainmetric.com/mobula-compatible.md): Routes that answer in the shape of the Mobula API, for clients that already speak it. - [Streams](https://docs.chainmetric.com/streams.md): Live updates over server-sent events, and how to resume a stream after a disconnect. - [Chainmetric API: overview](https://docs.chainmetric.com/api.md): The API reference, built from the OpenAPI spec. - [Token stats](https://docs.chainmetric.com/api/operations/get-token-stats.md): Returns one token's current price, market cap, supply, volume, trade counts, price change and holder make-up in one document. - [Token trades](https://docs.chainmetric.com/api/operations/get-token-trades.md): Returns the latest swaps in one token, newest first by default, optionally in one pool. - [Token price candles (OHLCV)](https://docs.chainmetric.com/api/operations/get-token-ohlcv.md): Returns price candles for one token at one interval, oldest first. - [Token liquidity changes](https://docs.chainmetric.com/api/operations/get-token-liquidity.md): Returns liquidity adds and removes in the token's pools, newest first by default. - [Token holders](https://docs.chainmetric.com/api/operations/get-token-positions.md): Returns the wallets that hold one token, ranked by balance, largest first. - [Wallet funding](https://docs.chainmetric.com/api/operations/get-wallet-funding.md): Returns who sent funds to a wallet and whom it sent funds to, and can walk back through the funders. - [Wallet position in a token](https://docs.chainmetric.com/api/operations/get-wallet-position.md): Returns one wallet's position in one token: balance, its USD value, share of supply, buy and sell counts and volumes, and labels. - [New launches (trenches)](https://docs.chainmetric.com/api/operations/get-trenches.md): Returns cards for tokens launching on a chain right now, one view at a time. - [Stream live token trades](https://docs.chainmetric.com/api/operations/stream-token-live.md): Opens a server-sent event stream of one token's trades as they happen, with no history and no resume. - [Stream token candles](https://docs.chainmetric.com/api/operations/stream-token-ohlcv.md): Opens a server-sent event stream of one token's candles at one interval. - [Stream token trades](https://docs.chainmetric.com/api/operations/stream-token-trades.md): Opens a server-sent event stream of one token's trades. - [Stream token liquidity changes](https://docs.chainmetric.com/api/operations/stream-token-liquidity.md): Opens a server-sent event stream of liquidity adds and removes in one token's pools. - [Stream new launches](https://docs.chainmetric.com/api/operations/stream-trenches.md): Opens a server-sent event stream of launch cards for one chain, across all views. - [Token logo image](https://docs.chainmetric.com/api/operations/get-logo.md): Returns a token logo as a WebP image. - [Health check](https://docs.chainmetric.com/api/operations/get-health.md): Returns `{"status":"ok"}` when the API is up. ## Documentation Sets - [Abridged documentation](https://docs.chainmetric.com/llms-small.txt): a compact version of the documentation for Chainmetric API, with non-essential content removed - [Complete documentation](https://docs.chainmetric.com/llms-full.txt): the full documentation for Chainmetric API ## Notes - The complete documentation includes all content from the official documentation - The content is automatically generated from the same source as the official documentation ## Optional - [OpenAPI spec](https://docs.chainmetric.com/openapi.json): the full API as OpenAPI 3.1 JSON