api/v2/utxo - Bitcoin Cash

This endpoint returns the unspent transaction outputs for an address, extended public key, or descriptor. These outputs are the inputs available when constructing a spending transaction.

Parameters

ParameterTypeLocationRequiredDescription
addressOrXpubstringpathYesAddress, extended public key, or descriptor. URL-encode descriptors
confirmedbooleanqueryNoWhen true, return only confirmed outputs. Default false
gapintegerqueryNoDerivation gap limit for xpub inputs, capped by the server

Request

bashcurl --location --request GET 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/utxo/bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a?confirmed=true'

example.js

javascriptconst response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/utxo/bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a?confirmed=true'
);
console.log(await response.json());

example.py

pythonimport requests

response = requests.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/api/v2/utxo/bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a?confirmed=true')

print(response.json())

Response

json[
    {
        "txid": "10b54fd708ab2e5703979b4ba27ca0339882abc2062e77fbe51e625203a49642",
        "vout": 1,
        "value": "9407625",
        "height": 684634,
        "confirmations": 1197
    }
]

An address query returns no address or path, because the owning address is the one in the request. Querying an xpub or descriptor adds both to each output, identifying which derived address owns it:

json[
    {
        "txid": "10b54fd708ab2e5703979b4ba27ca0339882abc2062e77fbe51e625203a49642",
        "vout": 1,
        "value": "9407625",
        "height": 684634,
        "confirmations": 1197,
        "address": "bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a",
        "path": "m/44'/145'/0'/0/0"
    }
]

Response Parameters

FieldTypeDescription
txidstringTransaction id of the output
voutintegerOutput index within the transaction
valuestringOutput value in satoshis
heightintegerBlock height at which the output was confirmed. Omitted when unconfirmed
confirmationsintegerNumber of confirmations. 0 for unconfirmed outputs
addressstringOwning address. Returned only for xpub and descriptor queries
pathstringDerivation path of the owning address. Only for xpub and descriptor queries

Use Cases

  • Coin Selection: Read spendable outputs when building a transaction
  • Balance Construction: Sum output values to compute a spendable balance
  • Wallet Funding: Find the UTXOs behind a wallet before spending
  • Confirmed Filtering: Restrict to confirmed outputs for settlement flows

Error Handling

HTTP StatusMessageDescription
400Bad requestThe address, XPUB, or descriptor is malformed
404Not foundNo indexed data exists for the requested account
500Internal errorThe indexer failed to read account data