Bitcoin Wallet Integration

CoinStats API provides robust Bitcoin wallet integration with advanced features including extended public key (xpub) support, enabling you to track entire wallet hierarchies and monitor all derived addresses from a single request.

Key Features

  • πŸ”‘ Extended Public Key (xpub) Support: Track entire HD wallets with a single xpub
  • πŸ“ Single Address Tracking: Monitor individual Bitcoin addresses
  • πŸ’° UTXO Management: Detailed unspent transaction output tracking
  • πŸ“Š Transaction History: Complete transaction history with block confirmations
  • ⚑ Lightning Network: Support for Lightning Network transactions
  • πŸ”’ Multi-Signature: Track multi-sig wallet addresses
  • πŸ“ˆ Portfolio Value: Real-time BTC value and historical performance

Extended Public Key (xpub) Tracking

Track an entire HD wallet using the extended public key:
curl -H "X-API-KEY: your-api-key" \
  "https://openapiv1.coinstats.app/wallet/balance?address=xpub6BosfCnifzxcFwrSzQiqu2DBVTshkCXacvNsWGYJVVhhawA7d4R5WSWGFNbi8Aw6ZRc1brxMyWMzG3DSSSSoekkudhUd9yLb6qx39T9nMdj&connectionId=bitcoin"
40 credits per request - covers all derived addresses automatically

xpub vs Single Address

Advantages:
  • Tracks all derived addresses automatically
  • Monitors both receiving and change addresses
  • No need to know individual addresses
  • Future-proof as new addresses are generated
  • Single API call covers entire wallet
Use Cases:
  • HD wallet tracking
  • Exchange cold storage monitoring
  • Corporate treasury management
  • Multi-user wallet services

Single Address Tracking

Monitor individual Bitcoin addresses:
curl -H "X-API-KEY: your-api-key" \
  "https://openapiv1.coinstats.app/wallet/balance?address=1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa&connectionId=bitcoin"

Example Bitcoin Balance Response

[
  {
    "coinId": "bitcoin",
    "amount": 1.5,
    "name": "Bitcoin",
    "symbol": "BTC",
    "price": 96847.50,
    "priceBtc": 1.0,
    "imgUrl": "https://static.coinstats.app/coins/1458729675.png",
    "pCh24h": 2.3,
    "rank": 1,
    "volume": 28000000000,
    "chain": "bitcoin",
    "contractAddress": null,
    "decimals": 8
  }
]

Transaction History

Get detailed Bitcoin transaction history with UTXO information:
curl -H "X-API-KEY: your-api-key" \
  "https://openapiv1.coinstats.app/wallet/transactions?address=xpub6BosfCnifzxcFwrSzQiqu2DBVTshkCXacvNsWGYJVVhhawA7d4R5WSWGFNbi8Aw6ZRc1brxMyWMzG3DSSSSoekkudhUd9yLb6qx39T9nMdj&connectionId=bitcoin&limit=50"
40 credits per request. Always sync transactions first for accuracy.

Portfolio Performance

Track Bitcoin wallet performance over time:
curl -H "X-API-KEY: your-api-key" \
  "https://openapiv1.coinstats.app/wallet/chart?address=xpub6BosfCnifzxcFwrSzQiqu2DBVTshkCXacvNsWGYJVVhhawA7d4R5WSWGFNbi8Aw6ZRc1brxMyWMzG3DSSSSoekkudhUd9yLb6qx39T9nMdj&connectionId=bitcoin&type=1y"

Advanced Bitcoin Features

Multi-Signature Wallet Tracking

Monitor multi-sig wallets with detailed threshold information:
curl -H "X-API-KEY: your-api-key" \
  "https://openapiv1.coinstats.app/wallet/balance?address=3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy&connectionId=bitcoin"

UTXO Management

Track unspent transaction outputs for advanced wallet management:
// Get transactions with UTXO details
const utxoData = await fetch('https://openapiv1.coinstats.app/wallet/transactions?address=bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4&connectionId=bitcoin&types=balance', {
  headers: { 'X-API-KEY': 'your-api-key' }
});

Fee Analysis

Monitor Bitcoin network fees and transaction costs:
// Track fee patterns
const feeData = await fetch('https://openapiv1.coinstats.app/wallet/transactions?address=1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa&connectionId=bitcoin&types=fee', {
  headers: { 'X-API-KEY': 'your-api-key' }
});

Address Format Support

FormatPrefixDescriptionExample
xpubxpubExtended public key (Legacy)xpub6BosfCnifzxc...
ypubypubExtended public key (P2WPKH-P2SH)ypub6Ww3ibxVfGzL...
zpubzpubExtended public key (P2WPKH)zpub6rFR7y4Q2Aij...
Legacy1P2PKH addresses1A1zP1eP5QGefi2D...
SegWitbc1P2WPKH/P2WSH addressesbc1qw508d6qejxtdg...
P2SH3Script hash addresses3J98t1WpEZ73CNmQ...
Recommended: Use xpub/ypub/zpub for comprehensive wallet tracking instead of individual addresses.

Use Cases

Corporate Treasury

Track company Bitcoin holdings across multiple HD wallets using xpub keys

Exchange Monitoring

Monitor hot and cold wallet balances for cryptocurrency exchanges

DCA Tracking

Track dollar-cost averaging strategies across multiple addresses

Inheritance Planning

Monitor Bitcoin inheritance wallets with automated alerts

Common Bitcoin Addresses

For testing and development:
TypeAddress/KeyDescription
Genesis Address1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNaBitcoin’s first address
SegWit Examplebc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4Sample SegWit address
Sample xpubxpub6BosfCnifzxcFwrSzQiqu2DBVTshkCXacvNsWGYJVVhhawA7d4R5WSWGFNbi8Aw6ZRc1brxMyWMzG3DSSSSoekkudhUd9yLb6qx39T9nMdjTest extended key
xpub Security: Extended public keys reveal all derived addresses. Never share xpub keys publicly in production environments.
Bitcoin transaction syncing may take longer due to block confirmation requirements. Allow extra time for accurate data.
  • Documentation: This site contains comprehensive API documentation
  • Telegram Chat: For quick help and to connect with other developers, join our API Support Telegram group
  • Email Support: You can reach us directly at api.support@coinstats.app for personalized assistance.