api/v2/xpub - Zcash

This endpoint returns wallet-level balance and transaction data for an extended public key or output descriptor, derived over transparent addresses. Zcash derives transparent accounts at BIP44 coin type 133, so paths read m/44'/133'/0'/....

Parameters

ParameterTypeLocationRequiredDescription
xpubstringpathYesExtended public key or supported output descriptor. URL-encode descriptors
detailsstringqueryNoDetail level: basic, tokens, tokenBalances, txids, txslight, or txs
tokensstringqueryNoWhich derived addresses to include: nonzero, used, or derived. Default nonzero
gapintegerqueryNoDerivation gap limit, capped by the server

Request

bashcurl --location --request GET 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/xpub/<XPUB>?details=basic'

example.js

javascriptconst response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/xpub/<XPUB>?details=basic'
);
console.log(await response.json());

example.py

pythonimport requests

response = requests.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/xpub/<XPUB>?details=basic')

print(response.json())

Response

json{
    "address": "<XPUB>",
    "balance": "0",
    "totalReceived": "0",
    "totalSent": "0",
    "unconfirmedBalance": "0",
    "unconfirmedTxs": 0,
    "txs": 0
}

Response Parameters

FieldTypeDescription
addressstringThe queried extended public key or descriptor
balancestringCombined transparent balance of the wallet in zatoshis
totalReceivedstringCombined total received in zatoshis
totalSentstringCombined total sent in zatoshis
txsintegerNumber of transactions across the derived addresses
tokensarrayDerived address rows, present when details is tokens or higher

This covers transparent derivation only. Shielded Sapling and Orchard accounts are derived from spending and viewing keys under ZIP-32, not from a BIP32 extended public key, and are not indexed. The response shown is the zeroed account returned for a key with no Zcash history; substitute an xpub from a Zcash wallet's transparent account to see its balances.

Use Cases

  • Wallet Balances: Read a whole transparent wallet in one call
  • Address Discovery: List which derived addresses have been used

Error Handling

HTTP StatusMessageDescription
400Bad requestA path or query parameter is malformed
403ForbiddenMissing or invalid ACCESS-TOKEN
404Not foundNo indexed data exists for the request
500Internal errorThe indexer failed to process the request