Get xpub

Returns balances and transactions of an xpub or output descriptor, applicable only for Bitcoin-type coins.

This method will use 10 Compute Units.

Reference: Here

GET /api/v2/xpub/<xpub|descriptor>[?page=<page>&pageSize=<size>&from=<block height>&to=<block height>&details=<basic|tokens|tokenBalances|txids|txs>&tokens=<nonzero|used|derived>&secondary=eur]


Required parameters

xpub OR descriptor- string, required.

Optional parameters

  • page: specifies page of returned transactions, starting from 1. If out of range, Blockbook returns the closest possible page.

  • pageSize: number of transactions returned by call (default and maximum 1000)

  • from, to: filter of the returned transactions from block height to block height (default no filter)

  • details: specifies level of details returned by request (default txids)

    • basic: return only xpub balances, without any derived addresses and transactions

    • tokens: basic + tokens (addresses) derived from the xpub, subject to tokens parameter

    • tokenBalances: basic + tokens (addresses) derived from the xpub with balances, subject to tokens parameter

    • txids: tokenBalances + list of txids, subject to from, to filter and paging

    • txs: tokenBalances + list of transaction with details, subject to from, to filter and paging

  • tokens: specifies what tokens (xpub addresses) are returned by the request (default nonzero)

    • nonzero: return only addresses with nonzero balance

    • used: return addresses with at least one transaction

    • derived: return all derived addresses

  • secondary: specifies secondary (fiat) currency in which the token and total balances are returned in addition to crypto values


Example response

  "page": 1,
  "totalPages": 1,
  "itemsOnPage": 1000,
  "address": "dgub8sbe5Mi8LA4dXB9zPfLZW8arm...9Vjp2HHx91xdDEmWYpmD49fpoUYF",
  "balance": "90000000",
  "totalReceived": "3093381250",
  "totalSent": "3083381250",
  "unconfirmedBalance": "0",
  "unconfirmedTxs": 0,
  "txs": 5,
  "txids": [
  "usedTokens": 2,
  "tokens": [
      "type": "XPUBAddress",
      "name": "DUCd1B3YBiXL5By15yXgSLZtEkvwsgEdqS",
      "path": "m/44'/3'/0'/0/0",
      "transfers": 3,
      "decimals": 8,
      "balance": "90000000",
      "totalReceived": "2903986975",
      "totalSent": "2803986975"
      "type": "XPUBAddress",
      "name": "DKu2a8Wo6zC2dmBBYXwUG3fxWDHbKnNiPj",
      "path": "m/44'/3'/0'/1/0",
      "transfers": 2,
      "decimals": 8,
      "balance": "0",
      "totalReceived": "279394275",
      "totalSent": "279394275"
  "secondaryValue": 21195.47633568

curl<YOUR_API_KEY_HERE>/api/v2/xpub/<xpub|descriptor> \
 -X GET \
 -H "Content-Type: application/json"

Last updated