> For the complete documentation index, see [llms.txt](https://docs.getblock.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getblock.io/api-reference/bitcoin-cash-bch/bitcoin-cash-blockbook-api/bb_getutxos-bitcoin-cash.md).

# bb\_getUTXOs - Bitcoin Cash

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

## Parameters

| Parameter  | Type    | Required | Description                                                         |
| ---------- | ------- | -------- | ------------------------------------------------------------------- |
| descriptor | string  | Yes      | Address, extended public key, or descriptor. URL-encode descriptors |
| confirmed  | boolean | No       | When true, return only confirmed outputs. Default false             |
| gap        | integer | No       | Derivation gap limit for xpub inputs, capped by the server          |

## Request

{% tabs %}
{% tab title="cURL (REST)" %}
{% code overflow="wrap" %}

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

{% endcode %}
{% endtab %}

{% tab title="cURL (JSON-RPC)" %}
{% code overflow="wrap" %}

```bash
curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "bb_getUTXOs",
    "params": [
        "bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a",
        {
            "confirmed": true
        }
    ],
    "id": "getblock.io"
}'
```

{% endcode %}
{% endtab %}

{% tab title="JavaScript" %}
{% code title="example.js" %}

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

{% endcode %}
{% endtab %}

{% tab title="Python" %}
{% code title="example.py" %}

```python
import requests

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

print(response.json())
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Response

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

## Response Parameters

| Field         | Type    | Description                                    |
| ------------- | ------- | ---------------------------------------------- |
| txid          | string  | Transaction id of the output                   |
| vout          | integer | Output index within the transaction            |
| value         | string  | Output value in satoshis                       |
| height        | integer | Block height at which the output was confirmed |
| confirmations | integer | Number of confirmations                        |
| address       | string  | Address that owns the output, for xpub 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

| Error Code   | Message        | Description                                      |
| ------------ | -------------- | ------------------------------------------------ |
| 400 / -32602 | Bad request    | The address, XPUB, or descriptor is malformed    |
| 404 / -32603 | Not found      | No indexed data exists for the requested account |
| 500 / -32603 | Internal error | The indexer failed to read account data          |
