Providers

Blockchair

One dashboard API for Bitcoin, Ethereum and eCash. Works without a key, ranks higher with one, and is the only provider that names the block a balance was read at.
provider
create("blockchair")
auth
optional BLOCKCHAIR_API_KEY
chains
Bitcoin, Ethereum, eCash
capabilities
balance, history, tx detail, block
endpoint
api.blockchair.com
default chain
ethereum

Address it

const blockchair = await create("blockchair"); // BLOCKCHAIR_API_KEY is optional
await blockchair.getBalance("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", "bitcoin");

The key is optional. Set BLOCKCHAIR_API_KEY and Blockchair joins the configured tier of provider selection; leave it unset and it stays a keyless candidate that shows up in the fallback pass, after Mempool on Bitcoin.

What it reads

/{chain}/dashboards/address/:address for balance and history, /{chain}/dashboards/transaction/:hash for one transaction, /{chain}/dashboards/block/:number for a block. Balances, history, details and blocks; no contracts, tokens or gas.

Gotchas

  • The data format differs between the UTXO chains and Ethereum, and the provider maps both. eCash amounts are satoshis at two decimals, so 100 satoshis is 1 XEC.
  • The dashboard answer carries context.state, the chain height when it was built, and that is what Balance.blockNumber shows. Every other provider's balance endpoint says nothing about a block.
  • funded and spent are the address's cumulative received and spent totals, in satoshis.

Where it lives

src/providers/blockchair.ts.

@agntn/explorers·MIT license· Read-only. Addresses you type go to a public explorer API, never to a wallet.