Query the chain · xpub balance API
xpub balance API for HD wallet addresses and totals
An xpub is the extended public key at the top of a Bitcoin HD wallet, and every receive and change address in that wallet derives from it. The xpub balance API takes an xpub (or ypub or zpub), derives the address chain, checks each derived address against the fully-indexed blockchain, and returns the combined balance to the satoshi along with the transactions behind it, so you track a whole wallet from one key instead of registering addresses one by one.
This is what wallets, exchanges and portfolio tools need to show a live balance without holding any private key: the extended public key only reveals addresses and history, never spend authority. BitcoinDatabase indexes every block since 2009, so gap-limit scanning, used-versus-fresh address detection and totals come back in one call. The same data is queryable in SQL and dashboards. Informational on-chain data only, not financial advice.
REST API · SQL · dashboards · indexed from genesis
Hit Run to query the fully-indexed Bitcoin blockchain.
BTC
30-day trend
informational on-chain data · not financial advice
Indexed from genesis queryable in seconds
On-chain data not financial advice
Why it works
What you get with xpub balance api
One key, every address
Pass an xpub, ypub or zpub and we derive the receive and change addresses, scan them against the indexed chain to the gap limit, and return which are used and what each holds.
Whole-wallet balance
Sum the balance across every derived address to the satoshi and pull the combined transaction history, so a portfolio or exchange view reflects the full HD wallet, not a single address.
Watch-only and safe
An extended public key exposes addresses and their history, never the ability to spend. Track balances and monitor deposits without ever touching a private key or seed.
What it handles
The indexed Bitcoin chain, queryable your way
Look up an address, a transaction, a UTXO, the rich list or an on-chain metric, by REST API, SQL or dashboard. The same authoritative data, reconciled block-by-block against the canonical chain, without running a node.
- Derive receive and change addresses from an xpub, ypub or zpub
- Total an HD wallet balance to the satoshi in one call
- Detect used versus fresh addresses within the gap limit
- Pull combined transaction history across a wallet
- Query the same data via REST, SQL or dashboards
{
"address": "bc1qxy2k…l0wdv8",
"balance_btc": 68432.10,
"balance_usd": 4612165420,
"tx_count": 1284,
"unspent_outputs": 37,
"first_seen": "2014-02-09"
}
Why BitcoinDatabase
One platform, queryable three ways
Not a raw node to sync, not an indexer to build, and not five vendors to stitch together. The fully-indexed Bitcoin blockchain, available as a REST API, as SQL, and as dashboards, on one authoritative dataset.
REST API
Typed JSON for addresses, transactions, balances, UTXOs and metrics. Drop it into apps, wallets, explorers and agents with curl, Python or our SDKs.
SQL access
Run SQL directly against the indexed Bitcoin dataset for ad-hoc analysis, cohorts and exports, the same data the API and dashboards read from.
Compliance-first
Informational on-chain data and analytics only. Entity labels and flow tracing are framed as tooling to support a regulated team's own review, not accusations.
Good questions
Questions about xpub balance api
Explore more
More ways to query Bitcoin with BitcoinDatabase
Bitcoin API
Query addresses, transactions and balances across the whole indexed chain in one call.
Learn moreBitcoin block explorer API
Power an explorer with blocks, transactions and addresses, no node to maintain.
Learn moreBitcoin address lookup
Look up any Bitcoin address: balance, full history and UTXOs in one query.
Learn moreStop running a node. Just query Bitcoin.
Run your first query now and get on-chain data back by REST API, SQL or dashboard, indexed from the genesis block. Informational on-chain data only, not financial advice.
Indexed from genesis · REST · SQL · dashboards · addresses, transactions, UTXOs, metrics