← Protocols
Chainbase
01Description

Hyperdata Network and onchain data API: REST endpoints, SQL Data Cloud, and Manuscript streaming framework for accessing balances, transfers, NFTs, and decoded contract data across 90+ blockchains.

02Best for
  • 01REST queries for token balances and NFTs
  • 02address labels and contract metadata
  • 03SQL analytics over decoded data
  • 04AI agents needing onchain context
  • 05stream pipelines via Manuscript
03Install
  • pnpm add axios
04Environment variables
VariableScopeDescription
CHAINBASE_API_KEYServerAPI key from console.chainbase.com. Sent as the `x-api-key` header on every request. Server-side only — exposing it lets anyone drain your quota.
05Prompt snippet
Use Chainbase's Web3 API from a server route. Authenticate with the `x-api-key` header. Common endpoints: `GET https://api.chainbase.online/v1/account/balance?chain_id=1&address=0x...` (native balance), `GET /v1/account/tokens?chain_id=1&address=0x...` (ERC20 balances), `GET /v1/account/nfts?chain_id=1&address=0x...`, `GET /v1/token/metadata?chain_id=1&contract_address=0x...`. For ad-hoc analytics use the SQL Data Cloud: `POST /v1/dw/query` with `{ query: 'SELECT ... FROM ethereum.transactions WHERE ...' }` returning a `task_id`, then poll `GET /v1/dw/task/{task_id}` until status `finished` and fetch results. Cache results by (chain_id, address) since balance endpoints have per-second rate caps.
06Gotchas
  • Free tier has tight per-second rate limits (default ~30 RPS) and a monthly compute-unit cap — bursty wallet pages must cache or proxy through a queue or you'll 429.
  • SQL Data Cloud queries are async with a 100,000-row alpha limit — never call `/dw/query` from a user-facing request handler without queueing; use the REST endpoints for low-latency lookups.
  • Chain coverage is 90+ chains but skews EVM — Bitcoin, Cosmos, Sui, Aptos support is partial; check the supported chain list at docs.chainbase.com before promising a non-EVM feature.
  • Decoded tables for newly deployed contracts can lag raw `transactions`/`logs` tables by hours — for fresh launches, decode manually with the contract ABI.
  • `CHAINBASE_API_KEY` must stay server-side; do NOT inline it in `NEXT_PUBLIC_*` or in client bundles.
07Alternatives