Skip to main content

Documentation Index

Fetch the complete documentation index at: https://coinstats.app/docs/llms.txt

Use this file to discover all available pages before exploring further.

Probably best free Bitcoin wallet API with xpub/ypub/zpub support. Track balances, transactions, derived addresses, and portfolio performance. Bitcoin wallet tracking is harder than other chains because of how HD (hierarchical deterministic) wallets work. A single user might have hundreds of derived addresses under one master key, and querying them individually is impractical. Most wallet apps, hardware wallets, and exchanges use HD wallets, which means a Bitcoin address lookup tool that only supports individual addresses is missing most of the picture. CoinStats Bitcoin API solves this by accepting extended public keys (xpub, ypub, zpub), so you can track all addresses in an HD wallet through a single API call. The API also supports single-address tracking for simpler use cases, and returns full transaction history with timestamps and USD values at the time of each transaction. The same Bitcoin wallet data is available through CoinStats MCP Server for AI agents and LLM-powered tools, so AI assistants can query Bitcoin wallets directly.

What You Get

xpub/ypub/zpub Support

Track all derived addresses from an HD wallet with a single extended public key.

Single Address Tracking

Query any individual Bitcoin address for balance and transaction history.

Full Transaction History

Every transaction with timestamps, amounts, and USD values at time of transaction.

UTXO Data

Unspent transaction output information for advanced wallet analysis.

Multi-Format Addresses

Legacy (1…), SegWit (3…), Native SegWit (bc1…), and Taproot (bc1p…) all supported.

Portfolio Performance

Historical portfolio value charts for tracking Bitcoin holdings over time.

Why xpub Support Matters

When a user sets up a Bitcoin wallet (whether it’s a Ledger, Trezor, Exodus, or any BIP-39 compatible wallet), the wallet software generates a master key. Every time the user receives a payment, the wallet creates a new address derived from that master key. After a few months of use, a single wallet might have 50, 100, or even 500 derived addresses. Without xpub support, a portfolio tracker or tax tool would need the user to manually list every address they’ve ever used. This is impractical and error-prone. With xpub support, you pass the extended public key once, and the API discovers all derived addresses automatically. This is how most production Bitcoin wallet integrations work. The CoinStats API accepts xpub, ypub (SegWit-wrapped), and zpub (Native SegWit) keys. All three work the same way: pass the key, get balances and transactions across all derived addresses.

Extended Public Key (xpub) Tracking

xpub vs Single Address

Featurexpub TrackingSingle Address
CoverageAll derived addressesOne address only
UTXO trackingCompletePer address
Credit cost4,000 credits40 credits
Use caseWallet apps, tax toolsBlock explorers, monitoring
Use xpub when you need a full picture of a user’s Bitcoin wallet. Use single address when you’re tracking a specific known address, like a deposit address or a cold storage address.
curl -H "X-API-KEY: your-api-key" \
  "https://openapiv1.coinstats.app/wallet/balance?address=xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz&connectionId=bitcoin"
4,000 credits per xpub request (covers all derived addresses) The higher credit cost reflects the computational work involved: the API needs to derive all addresses from the extended public key, check each one for balances and transactions, and aggregate the results. For most applications, this is a worthwhile trade-off compared to building your own derivation and scanning infrastructure.

Single Address Tracking

For simpler use cases where you only need one address:
curl -H "X-API-KEY: your-api-key" \
  "https://openapiv1.coinstats.app/wallet/balance?address=bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh&connectionId=bitcoin"
40 credits per request

Example Bitcoin Balance Response

[
  {
    "coinId": "bitcoin",
    "amount": 0.5,
    "name": "Bitcoin",
    "symbol": "BTC",
    "price": 96500.00,
    "priceBtc": 1.0,
    "imgUrl": "https://static.coinstats.app/coins/1650455588819.png",
    "pCh24h": 2.1,
    "rank": 1,
    "volume": 28000000000,
    "chain": "bitcoin"
  }
]
The response format is the same as other chains in the CoinStats API: an array of token objects with amount, price, 24h change, and volume. For Bitcoin, the array typically contains one entry (BTC), but for xpub queries it aggregates the total balance across all derived addresses.

Transaction History

Retrieve complete transaction history for a Bitcoin address or xpub:
curl -H "X-API-KEY: your-api-key" \
  "https://openapiv1.coinstats.app/wallet/transactions?address=bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh&connectionId=bitcoin&limit=20"
30 credits per request. Sync transactions first using PATCH /wallet/transactions. Each transaction record includes the timestamp, BTC amount, transaction hash, and the USD value at the time of the transaction. This is particularly important for tax tools, which need the fair market value at the time of each transaction for cost-basis calculations. The API also distinguishes between received and sent transactions, which simplifies gain/loss computation.

Portfolio Performance

Get historical portfolio value over time:
curl -H "X-API-KEY: your-api-key" \
  "https://openapiv1.coinstats.app/wallet/balance/chart?address=bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh&connectionId=bitcoin&period=1y"
Returns time-series data for rendering portfolio performance charts. Supported periods: 1d, 1w, 1m, 3m, 6m, 1y, all. This is useful for showing users how their Bitcoin holdings have performed over time, or for calculating returns over specific periods.

Credit Costs at a Glance

EndpointCreditsDescription
Single address balance40BTC balance for one address
xpub balance4,000Total BTC across all derived addresses
Transaction history30Paginated transaction list
Transaction sync50Index latest transactions
Portfolio chart40Historical portfolio value
The xpub endpoint costs more because it involves deriving and scanning all child addresses. For most wallet apps and tax tools, this is a single call per user session, making it cost-effective compared to building your own Bitcoin address scanning infrastructure.

What You Can Build With Bitcoin Wallet Data

Tax and Accounting Tools

Bitcoin tax reporting is complex because HD wallets generate new addresses for each transaction. Without xpub support, a tax tool would need users to manually identify and submit every address they’ve ever used. Some users don’t even know which addresses their wallet has generated, making manual submission unreliable. The CoinStats API handles this automatically: pass the xpub key, and the API returns transactions across all derived addresses with USD values at the time of each transaction. This gives you the raw data for FIFO, LIFO, or specific identification cost-basis methods. Each transaction includes the timestamp, BTC amount, and historical USD price, which is everything a tax engine needs. For users who have held Bitcoin across multiple wallets over time, your application can accept multiple xpub keys and aggregate the transaction history across all of them. The response format is consistent regardless of whether you query one xpub or one address, so the same parsing code handles both.

Bitcoin Portfolio Trackers

For portfolio apps, the balance endpoint returns current holdings with real-time USD valuation, and the chart endpoint provides historical performance data. Combined with transaction history, you can show users their total BTC holdings, unrealized gains/losses, average cost basis, and portfolio performance over any time period. A typical flow: user enters their xpub key (which they can export from their wallet software), your app calls the balance endpoint to get the current total, calls the chart endpoint for a performance graph, and calls the transaction endpoint for a full activity log. Three API calls give you a complete Bitcoin portfolio view.

Custody and Cold Storage Monitoring

Institutional users and custody solutions need to monitor Bitcoin held across multiple addresses and cold storage wallets. The xpub endpoint tracks all addresses under a master key, while single-address tracking works for known deposit or cold storage addresses. Both return the same response format, making it easy to aggregate across wallet types. For organizations that use multi-signature wallets, the API can track each cosigner’s xpub independently, giving a combined view of the multisig holdings. The UTXO data in the response is useful for custody solutions that need to verify the unspent outputs backing the wallet’s balance.

Bitcoin Payment Verification

If you’re building a payment processing system or a merchant tool that accepts Bitcoin, the single-address endpoint can verify that a payment has arrived at a specific address. Sync the address first, then query the transaction history to see if the expected payment has been confirmed. The response includes confirmation status and timestamps.

AI-Powered Bitcoin Analysis

Through CoinStats MCP Server, AI agents can check Bitcoin wallet balances, look up transaction history, and analyze portfolio performance using natural language. An AI assistant can answer questions like “What’s the balance of this xpub?” or “Show me the transaction history for this Bitcoin address.” This is useful for building research tools, chatbots, or copilot features that need Bitcoin wallet data.

Bitcoin vs. Other Chains

The CoinStats API uses the same endpoint format across all supported chains. If your application needs wallet data beyond Bitcoin, you can query Solana, Ethereum, EVM chains, and 120+ other networks by changing the connectionId parameter. See Solana Wallet API, Ethereum & EVM Chains page, or Multi-Chain Support page.

Address Format Support

The API accepts all standard Bitcoin address formats. The address type is detected automatically.
FormatPrefixExample
Legacy1...1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
SegWit (P2SH)3...3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy
Native SegWit (Bech32)bc1q...bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh
Taproot (Bech32m)bc1p...bc1p5d7rjq7g6rdk2yhzks9smlaqtedr4dekq08ge8ztwac72sfr9rusxg3297
xpubxpub...Extended public key for HD wallets
ypubypub...SegWit-wrapped extended public key
zpubzpub...Native SegWit extended public key

Getting Started

  1. Sign up at CoinStats API dashboard and generate an API key
  2. Try the single-address balance endpoint with the cURL example above
  3. For HD wallet tracking, export your xpub from your wallet software and use the xpub endpoint
  4. Explore the full endpoint reference in API docs
The free tier includes enough credits to test all Bitcoin endpoints. No credit card required to start.

Common Bitcoin Addresses

For testing and development:
TypeAddressDescription
Genesis Block1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNaSatoshi’s genesis address
SegWit Examplebc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlhNative SegWit address