> For the complete documentation index, see [llms.txt](https://docs.taal.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.taal.com/core-products/whatsonchain/un-spent-transaction-outputs.md).

# (Un)Spent Transaction Outputs

## Get Unspent UTXOs by Address

This endpoint retrieves a combined, ordered list of both confirmed and unconfirmed UTXOs for a given address.&#x20;

{% hint style="info" %}

* Returns up to 100k unconfirmed results in one request.
* Confirmed results are paginated if more than 1000 are available.
* The rest can be accessed using the provided `next-page` token.
  {% endhint %}

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/bsv/<network>/address/<address>/unspent/all
```

{% endcode %}

#### Example Request

{% tabs %}
{% tab title="BSV" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/address/1L2F8wYxTRagCZLnsm2engg8ngGECSeuE5/unspent/all"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/address/1AR9sWV7ZR2C2ohGSDDKXipCfZ3RLGynHM/unspent/all"
```

{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="BSV" %}

```json
{
    "address": "1L2F8wYxTRagCZLnsm2engg8ngGECSeuE5",
    "script": "b3005d46af31c4b5675b73c17579b7bd366dfe10635b7b43ac111aea5226efb6",
    "result": [{
        "height": 861499,
        "tx_pos": 1,
        "tx_hash": "ab0f76f957662335f98ee430a665f924c28310ec5126c2aede56086f9233326f",
        "value": 154,
        "isSpentInMempoolTx": false,
        "status": "confirmed"
    }, {
        "height": 861925,
        "tx_pos": 99,
        "tx_hash": "54e27d08c371b67746fd3088b78eecb9acef91f497f7e776d11d605635b9dc20",
        "value": 1000,
        "isSpentInMempoolTx": false,
        "status": "confirmed"
    },
    ...
    ],
    "error": ""
}
```

{% endtab %}

{% tab title="BTC" %}

```json
{
    "address": "1AR9sWV7ZR2C2ohGSDDKXipCfZ3RLGynHM",
    "script": "7b93a4e57dfc0cfacc47f486caac7f446ae6b366f8b708260962e7ca7d39f4fb",
    "result": [{
        "tx_pos": 0,
        "tx_hash": "891459059f872c18bd27e7cfc9a5f2a8567f6739d4535bd07281de22379dd193",
        "value": 505370,
        "isSpentInMempoolTx": false,
        "hex": "76a914674a8527a29f25613552267d0edfd181212becdc88ac",
        "status": "unconfirmed"
    },
    ...
    {
        "height": 881136,
        "tx_pos": 0,
        "tx_hash": "764da85a1e8a383d5a41e3bb7b7b9303bc99f92e258ed4bfbea3aefed4f617d7",
        "value": 600,
        "isSpentInMempoolTx": false,
        "status": "confirmed"
    },
    ...
    ],
    "error": ""
}
```

{% endtab %}
{% endtabs %}

**URL Parameters**

| Parameter | Description                         |
| --------- | ----------------------------------- |
| network   | Selected network: `main` or `test`. |
| address   | Address.                            |

## Get Unconfirmed UTXOs by Address

This endpoint retrieves an ordered list of unconfirmed UTXOs for a given address.

{% hint style="info" %}
Returns up to 100k results in one request.
{% endhint %}

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/bsv/<network>/address/<address>/unconfirmed/unspent
```

{% endcode %}

#### Example Request

{% tabs %}
{% tab title="BSV" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/address/12drYTV2c9nZMrxep9ewpWPdLrV5bNcWF2/unconfirmed/unspent"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/address/bc1qcvltc5pzeq7dt52x0q0yjhlzlmvufusd0vm27a/unconfirmed/unspent"
```

{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="BSV" %}

```json
{
    "address": "12drYTV2c9nZMrxep9ewpWPdLrV5bNcWF2",
    "script": "2d4ec8100056a819943df89efb3ac6a37a44bdf46a307dc390c31f6db31a092f",
    "result": [{
        "tx_pos": 0,
        "tx_hash": "bdcfb99b692a3418f79471ca970a201149d19ba97d0ca5c0b89949bdb627a1c9",
        "value": 85,
        "isSpentInMempoolTx": false,
        "hex": "76a91411f074cf02b2c8070c424384493cb5c8548ae20788ac"
    }, {
        "tx_pos": 0,
        "tx_hash": "575e01c3ef02809308c835308a643199e56c3eb80816a28c1db51f31968c413d",
        "value": 17000,
        "isSpentInMempoolTx": false,
        "hex": "76a91411f074cf02b2c8070c424384493cb5c8548ae20788ac"
    },
    ...
    ],
    "error": ""
}
```

{% endtab %}

{% tab title="BTC" %}

```json
{
    "address": "bc1qcvltc5pzeq7dt52x0q0yjhlzlmvufusd0vm27a",
    "script": "d429f1c1970baaa6e8e1367b1e8689aafaefed972c0351a2223ceba047f22fdd",
    "result": [{
        "tx_pos": 0,
        "tx_hash": "a3c6d8dd8c7c777527e9e45803cf2e9efda9d09bcde7830368e1719b292938fd",
        "value": 1382600,
        "isSpentInMempoolTx": false,
        "hex": "0014c33ebc5022c83cd5d146781e495fe2fed9c4f20d"
    }],
    "error": ""
}
```

{% endtab %}
{% endtabs %}

**URL Parameters**

| Parameter | Description                         |
| --------- | ----------------------------------- |
| network   | Selected network: `main` or `test`. |
| address   | Address.                            |

## Bulk Unconfirmed UTXOs by Address

This endpoint retrieves an ordered list of unconfirmed UTXOs for a given set of addresses

{% hint style="info" %}

* Max 20 addresses per request.
* Returns up to 100 items in one request.
  {% endhint %}

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/bsv/<network>/addresses/unconfirmed/unspent
```

{% endcode %}

{% code title="Request Data" %}

```json
{
    "addresses": [
    	"<address>",
    	"<address>",
        ...
    ]
}
```

{% endcode %}

#### Example Request

{% tabs %}
{% tab title="BSV" %}

```sh
curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/addresses/unconfirmed/unspent" \
  --header "Content-Type: application/json" \
  --data "{\"addresses\" : [\"12drYTV2c9nZMrxep9ewpWPdLrV5bNcWF2\",\"1uEVHTbkzhz6pFfMQEYoimE2bQZNbhRC8\" ] }"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request POST "https://api.whatsonchain.com/v1/btc/main/addresses/unconfirmed/unspent" \
  --header "Content-Type: application/json" \
  --data "{\"addresses\" : [\"bc1qcvltc5pzeq7dt52x0q0yjhlzlmvufusd0vm27a\",\"bc1qvqny32utwemf32rlvk0tghjn6h40wwtn7feq7p\" ] }"
```

{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="BSV" %}

```json
[{
    "address": "12drYTV2c9nZMrxep9ewpWPdLrV5bNcWF2",
    "script": "2d4ec8100056a819943df89efb3ac6a37a44bdf46a307dc390c31f6db31a092f",
    "result": [{
        "tx_pos": 0,
        "tx_hash": "bdcfb99b692a3418f79471ca970a201149d19ba97d0ca5c0b89949bdb627a1c9",
        "value": 85,
        "isSpentInMempoolTx": false,
        "hex": "76a91411f074cf02b2c8070c424384493cb5c8548ae20788ac"
    }, {
        "tx_pos": 0,
        "tx_hash": "575e01c3ef02809308c835308a643199e56c3eb80816a28c1db51f31968c413d",
        "value": 17000,
        "isSpentInMempoolTx": false,
        "hex": "76a91411f074cf02b2c8070c424384493cb5c8548ae20788ac"
    },
    ...
    ],
    "error": ""
}, {
    "address": "1uEVHTbkzhz6pFfMQEYoimE2bQZNbhRC8",
    "script": "b1654010d45195751fd392c13819834726edc87d6508f94cff4e41f643db2e49",
    "result": [{
        "tx_pos": 0,
        "tx_hash": "ee568800fe3c442fc458e2a1471ac0c697d1b6c31d4185e016a58700514c82cc",
        "value": 85,
        "isSpentInMempoolTx": false,
        "hex": "76a91409e0e39164714f25254ac278fc939933b1fe21f888ac"
    }, {
        "tx_pos": 0,
        "tx_hash": "186e0bd354cc0ba6a00a70529b60940a553eef4e468d109c7c8614d04d260ee9",
        "value": 85,
        "isSpentInMempoolTx": false,
        "hex": "76a91409e0e39164714f25254ac278fc939933b1fe21f888ac"
    },
    ...
    ],
    "error": ""
}]
```

{% endtab %}

{% tab title="BTC" %}

```json
[{
    "address": "bc1qcvltc5pzeq7dt52x0q0yjhlzlmvufusd0vm27a",
    "script": "d429f1c1970baaa6e8e1367b1e8689aafaefed972c0351a2223ceba047f22fdd",
    "result": [{
        "tx_pos": 0,
        "tx_hash": "a3c6d8dd8c7c777527e9e45803cf2e9efda9d09bcde7830368e1719b292938fd",
        "value": 1382600,
        "isSpentInMempoolTx": false,
        "hex": "0014c33ebc5022c83cd5d146781e495fe2fed9c4f20d"
    }],
    "error": ""
}, {
    "address": "bc1qvqny32utwemf32rlvk0tghjn6h40wwtn7feq7p",
    "script": "d939bd1751111e7cd8fb0d2a6945941e947a4bdcb396acd5635df8292fc3a375",
    "result": [{
        "tx_pos": 1,
        "tx_hash": "a3c6d8dd8c7c777527e9e45803cf2e9efda9d09bcde7830368e1719b292938fd",
        "value": 2010800,
        "isSpentInMempoolTx": false,
        "hex": "0014602648ab8b767698a87f659eb45e53d5eaf73973"
    }],
    "error": ""
}]
```

{% endtab %}
{% endtabs %}

**URL Parameters**

| Parameter | Description                         |
| --------- | ----------------------------------- |
| network   | Selected network: `main` or `test`. |

## Get Confirmed UTXOs by Address

This endpoint retrieves an ordered list of confirmed UTXOs for a given address.

{% hint style="info" %}

* `isSpentInMempoolTx` flag enables filtering of spent unconfirmed transactions from this set.
* Pagination is available using the provided `next-page` token.
  {% endhint %}

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/<chain>/<network>/address/<address>/confirmed/unspent
```

{% endcode %}

#### Example Request

{% tabs %}
{% tab title="BSV" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/address/1Dbj1LUxTqtuZ1U52KZiZChLPHkTAMiD6h/confirmed/unspent"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/address/1AR9sWV7ZR2C2ohGSDDKXipCfZ3RLGynHM/confirmed/unspent"
```

{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="BSV" %}

```json
{
    "address": "1Dbj1LUxTqtuZ1U52KZiZChLPHkTAMiD6h",
    "script": "0374d9ee2df8e5d7c5fd8359f33456996f2a1a9c76d9c783d2f8d5ee05ba5832",
    "result": [{
        "height": 797518,
        "tx_pos": 0,
        "tx_hash": "6cc9631ef3dad77eb0141134167f20469d0b4e61405de57fe6a9ac71b943bb9f",
        "value": 181827,
        "isSpentInMempoolTx": false
    }],
    "error": ""
}
```

{% endtab %}

{% tab title="BTC" %}

```json
{
    "address": "1AR9sWV7ZR2C2ohGSDDKXipCfZ3RLGynHM",
    "script": "7b93a4e57dfc0cfacc47f486caac7f446ae6b366f8b708260962e7ca7d39f4fb",
    "result": [{
        "height": 881136,
        "tx_pos": 0,
        "tx_hash": "764da85a1e8a383d5a41e3bb7b7b9303bc99f92e258ed4bfbea3aefed4f617d7",
        "value": 600,
        "isSpentInMempoolTx": false
    }, {
        "height": 886287,
        "tx_pos": 1,
        "tx_hash": "12b8cf9dfaed801d448b6a36d4fc534245560108cc0ae067a13073dab7238a12",
        "value": 601,
        "isSpentInMempoolTx": false
    },
    ...
    ],
    "error": ""
}
```

{% endtab %}
{% endtabs %}

**URL Parameters**

<table><thead><tr><th width="349">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>chain</td><td>Desired blockchain: <code>bsv</code> or <code>btc</code>.</td></tr><tr><td>network</td><td>Selected network: <code>main</code> or <code>test</code>.</td></tr><tr><td>address</td><td>Address.</td></tr><tr><td>limit</td><td>Between <code>1</code> and <code>10000</code> (default).</td></tr><tr><td>token</td><td>Provided <code>next-page</code> token.</td></tr></tbody></table>

## Bulk Confirmed UTXOs by Address

This endpoint retrieves an ordered list of confirmed UTXOs for a given set of addresses

{% hint style="info" %}

* Max 20 addresses per request.
* Returns up to 20 items in one request.
  {% endhint %}

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/<chain>/<network>/addresses/confirmed/unspent
```

{% endcode %}

{% code title="Request Data" %}

```json
{
    "addresses": [
    	"<address>",
    	"<address>",
        ...
    ]
}
```

{% endcode %}

#### Example Request

{% tabs %}
{% tab title="BSV" %}

```sh
curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/addresses/confirmed/unspent" \
  --header "Content-Type: application/json" \
  --data "{\"addresses\" : [\"16ZBEb7pp6mx5EAGrdeKivztd5eRJFuvYP\",\"1KGHhLTQaPr4LErrvbAuGE62yPpDoRwrob\" ] }"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request POST "https://api.whatsonchain.com/v1/btc/main/addresses/confirmed/unspent" \
  --header "Content-Type: application/json" \
  --data "{\"addresses\" : [\"3MqUP6G1daVS5YTD8fz3QgwjZortWwxXFd\",\"382UwmXW5WgrS7kmG3XQLHV1ivVjTJzS94\" ] }"
```

{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="BSV" %}

```json
[{
    "address": "16ZBEb7pp6mx5EAGrdeKivztd5eRJFuvYP",
    "result": [{
        "height": 657540,
        "tx_pos": 1,
        "tx_hash": "d75485c2329a533fd06b5f55a3f21644741c0258f2974d5d989e946a0bb4357f",
        "value": 25000000
    },{
        "height": 657542,
        "tx_pos": 1,
        "tx_hash": "55a656d50327ec3237fa6e821ab62294695cfd508d631dc9b04dc3a395cf0a37",
        "value": 25000000
    }],
    "error": ""
},{
    "address": "1KGHhLTQaPr4LErrvbAuGE62yPpDoRwrob",
    "result": [{
        "height": 658133,
        "tx_pos": 1,
        "tx_hash": "7ae43aac97396bc99616d8273c6cd9b57f017d6d49aca742fbc8c214fee49fa7",
        "value": 25000000
    },{
        "height": 658134,
        "tx_pos": 1,
        "tx_hash": "5b25a56bbb959f9cf4b3e48dbbe412bf5cc85e655d27f87c3bfb07aa6aa01518",
        "value": 25000000
    }],
    "error": ""
}]
```

{% endtab %}

{% tab title="BTC" %}

```json
[{
    "address": "3MqUP6G1daVS5YTD8fz3QgwjZortWwxXFd",
    "script": "d9d46113eb0f3759c0dabf23b87b58a4c76a0633d13add20922cc5f6ede8ddd9",
    "result": [{
        "height": 891917,
        "tx_pos": 0,
        "tx_hash": "a367face4189b870b340ba391ef336e756305f65f2e060ae8486d100ab89f33a",
        "value": 546,
        "isSpentInMempoolTx": false
    }, {
        "height": 891978,
        "tx_pos": 0,
        "tx_hash": "608ffca4e1a21fc767f802e37f2c673db7b9ab6076cbbffa82bd090af56eebbf",
        "value": 546,
        "isSpentInMempoolTx": false
    },
    ...
    ],
    "nextPageToken": "000000002f0100004c000000010000004000000064396434363131336562306633373539633064616266323362383762353861346337366130363333643133616464323039323263633566366564653864646439016900000005000000010000000004000000000d9c0d040000000000043a40000000613336376661636534313839623837306233343062613339316566333336653735363330356636356632653036306165383438366431303061623839663333610400000000000000ebffffff8a448b12ab55abccc87bef8c6e82e38301000000390000000119000000140000000100000008000000b3eee3a4f216cea2010119000000140000000100000008000000b3eee3a4f216cea2010101000000164715117e017b366640b372f29546ae010000000000ffffffff000000000002",
    "error": ""
}, {
    "address": "382UwmXW5WgrS7kmG3XQLHV1ivVjTJzS94",
    "script": "f55f33505fe16e01f0e79fde7259d71191c901a6b40833d5297251ce64b5705b",
    "result": null,
    "error": ""
}]
```

{% endtab %}
{% endtabs %}

**URL Parameters**

| Parameter | Description                         |
| --------- | ----------------------------------- |
| chain     | Desired blockchain: `bsv` or `btc`. |
| network   | Selected network: `main` or `test`. |

## Get Unspent UTXOs by Script

This endpoint retrieves a combined, ordered list of both confirmed and unconfirmed UTXOs for a given script.

{% hint style="info" %}

* Returns up to 100k unconfirmed results in one request.
* Confirmed results are paginated if more than 1000 are available.
* The rest can be accessed using the provided `next-page` token.
  {% endhint %}

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/bsv/<network>/script/<scriptHash>/unspent/all
```

{% endcode %}

#### Example Request

{% tabs %}
{% tab title="BSV" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/script/b3005d46af31c4b5675b73c17579b7bd366dfe10635b7b43ac111aea5226efb6/unspent/all"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/script/d429f1c1970baaa6e8e1367b1e8689aafaefed972c0351a2223ceba047f22fdd/unspent/all"
```

{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="BSV" %}

```json
{
    "script": "b3005d46af31c4b5675b73c17579b7bd366dfe10635b7b43ac111aea5226efb6",
    "result": [{
        "height": 861499,
        "tx_pos": 1,
        "tx_hash": "ab0f76f957662335f98ee430a665f924c28310ec5126c2aede56086f9233326f",
        "value": 154,
        "isSpentInMempoolTx": false,
        "status": "confirmed"
    }, {
        "height": 861925,
        "tx_pos": 99,
        "tx_hash": "54e27d08c371b67746fd3088b78eecb9acef91f497f7e776d11d605635b9dc20",
        "value": 1000,
        "isSpentInMempoolTx": false,
        "status": "confirmed"
    },
    ...
    ],
    "error": ""
}
```

{% endtab %}

{% tab title="BTC" %}

```json
{
    "script": "d429f1c1970baaa6e8e1367b1e8689aafaefed972c0351a2223ceba047f22fdd",
    "result": [{
        "tx_pos": 0,
        "tx_hash": "a3c6d8dd8c7c777527e9e45803cf2e9efda9d09bcde7830368e1719b292938fd",
        "value": 1382600,
        "isSpentInMempoolTx": false,
        "hex": "0014c33ebc5022c83cd5d146781e495fe2fed9c4f20d",
        "status": "unconfirmed"
    }, {
        "height": 904501,
        "tx_pos": 1,
        "tx_hash": "dc625944cd7fc5761c93b337063fff0ed2c127c79b092159a2ede4491e5961db",
        "value": 142777600,
        "isSpentInMempoolTx": false,
        "status": "confirmed"
    },
    ...
    ],
    "error": ""
}
```

{% endtab %}
{% endtabs %}

**URL Parameters**

| Parameter  | Description                                                                                                               |
| ---------- | ------------------------------------------------------------------------------------------------------------------------- |
| network    | Selected network: `main` or `test`.                                                                                       |
| scriptHash | Script hash: `Sha256` hash of the binary bytes of the locking script (`ScriptPubKey`), expressed as a hexadecimal string. |

## Get Unconfirmed UTXOs by Script

This endpoint retrieves the ordered list of unconfirmed UTXOs for a given script.

{% hint style="info" %}
Returns up to 100k results in one request.
{% endhint %}

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/bsv/<network>/script/<scriptHash>/unconfirmed/unspent
```

{% endcode %}

#### Example Request

{% tabs %}
{% tab title="BSV" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/script/b1654010d45195751fd392c13819834726edc87d6508f94cff4e41f643db2e49/unconfirmed/unspent"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/script/0954dff09a1f76f413f53ff8f92f58f0b36b3abad8ef9dcd98ba55686ea9dad8/unconfirmed/unspent"
```

{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="BSV" %}

```json
{
    "script": "b1654010d45195751fd392c13819834726edc87d6508f94cff4e41f643db2e49",
    "result": [{
        "tx_pos": 0,
        "tx_hash": "ee568800fe3c442fc458e2a1471ac0c697d1b6c31d4185e016a58700514c82cc",
        "value": 85,
        "isSpentInMempoolTx": false,
        "hex": "76a91409e0e39164714f25254ac278fc939933b1fe21f888ac"
    }, {
        "tx_pos": 0,
        "tx_hash": "186e0bd354cc0ba6a00a70529b60940a553eef4e468d109c7c8614d04d260ee9",
        "value": 85,
        "isSpentInMempoolTx": false,
        "hex": "76a91409e0e39164714f25254ac278fc939933b1fe21f888ac"
    },
    ...
    ],
    "error": ""
}
```

{% endtab %}

{% tab title="BTC" %}

```json
{
    "script": "0954dff09a1f76f413f53ff8f92f58f0b36b3abad8ef9dcd98ba55686ea9dad8",
    "result": [{
        "tx_pos": 0,
        "tx_hash": "71e1ffb4b435000ad3fce89ed660a1f618787381e10b0b11426def778a9ab6de",
        "value": 47600669,
        "isSpentInMempoolTx": false,
        "hex": "a914424f29a8a84fa867814ff9ded43379c9dc9a681487"
    }, {
        "tx_pos": 0,
        "tx_hash": "bf7f0cb602bdecd290e8a93924e34f915d4e9c9e3b3cec35d0f5c26950066ba0",
        "value": 30202537,
        "isSpentInMempoolTx": false,
        "hex": "a914424f29a8a84fa867814ff9ded43379c9dc9a681487"
    },
    ...
    ],
    "error": ""
}
```

{% endtab %}
{% endtabs %}

**URL Parameters**

| Parameter  | Description                                                                                                               |
| ---------- | ------------------------------------------------------------------------------------------------------------------------- |
| network    | Selected network: `main` or `test`.                                                                                       |
| scriptHash | Script hash: `Sha256` hash of the binary bytes of the locking script (`ScriptPubKey`), expressed as a hexadecimal string. |

## Bulk Unconfirmed UTXOs by Script

This endpoint retrieves an ordered list of unconfirmed UTXOs for a given set of script hashes.

{% hint style="info" %}

* Max 20 scripthashes per request.
* Returns up to 20 items in one request.
  {% endhint %}

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/bsv/<network>/scripts/unconfirmed/unspent
```

{% endcode %}

{% code title="Request Data" %}

```json
{
    "scripts": [
        "<script>",
        "<script>",
        ...
    ]
}
```

{% endcode %}

#### Example Request

{% tabs %}
{% tab title="BSV" %}

```sh
curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/scripts/unconfirmed/unspent" \
  --header "Content-Type: application/json" \
  --data "{\"scripts\" : [\"b1654010d45195751fd392c13819834726edc87d6508f94cff4e41f643db2e49\",\"2d4ec8100056a819943df89efb3ac6a37a44bdf46a307dc390c31f6db31a092f\" ] }"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request POST "https://api.whatsonchain.com/v1/btc/main/scripts/unconfirmed/unspent" \
  --header "Content-Type: application/json" \
  --data "{\"scripts\" : [\"0954dff09a1f76f413f53ff8f92f58f0b36b3abad8ef9dcd98ba55686ea9dad8\",\"721ab98a12c78293b02278d19c45bb99c83a5289907f2854e3271c1aaf93b0f3\" ] }"
```

{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="BSV" %}

```json
[{
    "script": "b1654010d45195751fd392c13819834726edc87d6508f94cff4e41f643db2e49",
    "result": [{
        "tx_pos": 0,
        "tx_hash": "ee568800fe3c442fc458e2a1471ac0c697d1b6c31d4185e016a58700514c82cc",
        "value": 85,
        "isSpentInMempoolTx": false,
        "hex": "76a91409e0e39164714f25254ac278fc939933b1fe21f888ac"
    }, {
        "tx_pos": 0,
        "tx_hash": "186e0bd354cc0ba6a00a70529b60940a553eef4e468d109c7c8614d04d260ee9",
        "value": 85,
        "isSpentInMempoolTx": false,
        "hex": "76a91409e0e39164714f25254ac278fc939933b1fe21f888ac"
    },
    ...
    ],
    "error": ""
}, {
    "script": "2d4ec8100056a819943df89efb3ac6a37a44bdf46a307dc390c31f6db31a092f",
    "result": [{
        "tx_pos": 0,
        "tx_hash": "bdcfb99b692a3418f79471ca970a201149d19ba97d0ca5c0b89949bdb627a1c9",
        "value": 85,
        "isSpentInMempoolTx": false,
        "hex": "76a91411f074cf02b2c8070c424384493cb5c8548ae20788ac"
    }, {
        "tx_pos": 0,
        "tx_hash": "575e01c3ef02809308c835308a643199e56c3eb80816a28c1db51f31968c413d",
        "value": 17000,
        "isSpentInMempoolTx": false,
        "hex": "76a91411f074cf02b2c8070c424384493cb5c8548ae20788ac"
    },
    ...
    ],
    "error": ""
}]
```

{% endtab %}

{% tab title="BTC" %}

```json
[{
    "script": "0954dff09a1f76f413f53ff8f92f58f0b36b3abad8ef9dcd98ba55686ea9dad8",
    "result": [{
        "tx_pos": 0,
        "tx_hash": "64362c322487a25f9f7cab377ab27490256347db06d96da581cc10e9956119ca",
        "value": 5752365,
        "isSpentInMempoolTx": false,
        "hex": "a914424f29a8a84fa867814ff9ded43379c9dc9a681487"
    }, {
        "tx_pos": 1,
        "tx_hash": "a12d907e49794e6c47fefde137bac977065337b8989917bf998ce58892479fc6",
        "value": 46203,
        "isSpentInMempoolTx": false,
        "hex": "a914424f29a8a84fa867814ff9ded43379c9dc9a681487"
    },
    ...
    ],
    "error": ""
}, {
    "script": "721ab98a12c78293b02278d19c45bb99c83a5289907f2854e3271c1aaf93b0f3",
    "result": null,
    "error": ""
}]
```

{% endtab %}
{% endtabs %}

**URL Parameters**

| Parameter | Description                         |
| --------- | ----------------------------------- |
| network   | Selected network: `main` or `test`. |

## Get Confirmed UTXOs by Script

This endpoint retrieves the ordered list of confirmed UTXOs for a given script.

{% hint style="info" %}

* `isSpentInMempoolTx` flag enables filtering of spent unconfirmed transactions from this set.
* Pagination is available using the provided `next-page` token.
  {% endhint %}

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/<chain>/<network>/script/<scriptHash>/confirmed/unspent
```

{% endcode %}

#### Example Request

{% tabs %}
{% tab title="BSV" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/script/0374d9ee2df8e5d7c5fd8359f33456996f2a1a9c76d9c783d2f8d5ee05ba5832/confirmed/unspent"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/script/aebd9e3018dbb5eed9220f275d3098dad2448fecd1c4c253d8c75a780bb08ce3/confirmed/unspent"
```

{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="BSV" %}

```json
{
    "script": "0374d9ee2df8e5d7c5fd8359f33456996f2a1a9c76d9c783d2f8d5ee05ba5832",
    "result": [{
        "height": 797518,
        "tx_pos": 0,
        "tx_hash": "6cc9631ef3dad77eb0141134167f20469d0b4e61405de57fe6a9ac71b943bb9f",
        "value": 181827,
        "isSpentInMempoolTx": false
    }],
    "error": ""
}
```

{% endtab %}

{% tab title="BTC" %}

```json
{
    "script": "aebd9e3018dbb5eed9220f275d3098dad2448fecd1c4c253d8c75a780bb08ce3",
    "result": [{
        "height": 904231,
        "tx_pos": 1,
        "tx_hash": "97b654a463364bf0fa0035dcb315abcdcf6c39ab4e522b3488060ba7098f55f0",
        "value": 2388665,
        "isSpentInMempoolTx": false
    }, {
        "height": 904268,
        "tx_pos": 0,
        "tx_hash": "fe18d4743815e5c152824063d08040d1df9bde0fcbe964288c3035cc16f63f0e",
        "value": 6389114,
        "isSpentInMempoolTx": false
    },
    ...
    ],
    "error": ""
}
```

{% endtab %}
{% endtabs %}

**URL Parameters**

| Parameter  | Description                                                                                                               |
| ---------- | ------------------------------------------------------------------------------------------------------------------------- |
| chain      | Desired blockchain: `bsv` or `btc`.                                                                                       |
| network    | Selected network: `main` or `test`.                                                                                       |
| scriptHash | Script hash: `Sha256` hash of the binary bytes of the locking script (`ScriptPubKey`), expressed as a hexadecimal string. |
| limit      | Between `1` and `10000` (default).                                                                                        |
| token      | Provided `next-page` token.                                                                                               |

## Bulk Confirmed UTXOs by Script

This endpoint retrieves an ordered list of confirmed UTXOs for a given set of script hashes.

{% hint style="info" %}

* Max 20 script hashes per request.
* Returns up to 20 items in one request.
  {% endhint %}

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/<chain>/<network>/scripts/confirmed/unspent
```

{% endcode %}

{% code title="Request Data" %}

```json
{
    "scripts": [
        "<script>",
        "<script>",
        ...
    ]
}
```

{% endcode %}

#### Example Request

{% tabs %}
{% tab title="BSV" %}

```sh
curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/scripts/confirmed/unspent" \
  --header "Content-Type: application/json" \
  --data "{\"scripts\" : [\"f814a7c3a40164aacc440871e8b7b14eb6a45f0ca7dcbeaea709edc83274c5e7\",\"995ea8d0f752f41cdd99bb9d54cb004709e04c7dc4088bcbbbb9ea5c390a43c3\" ] }"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request POST "https://api.whatsonchain.com/v1/btc/main/scripts/confirmed/unspent" \
  --header "Content-Type: application/json" \
  --data "{\"scripts\" : [\"aebd9e3018dbb5eed9220f275d3098dad2448fecd1c4c253d8c75a780bb08ce3\",\"843bf6ea60946a9ff5cf1d526878177317b88dcba83db33a4036ae9ca9f1f0cf\" ] }"
```

{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="BSV" %}

```json
[{
    "script": "f814a7c3a40164aacc440871e8b7b14eb6a45f0ca7dcbeaea709edc83274c5e7",
    "result": [{
        "height": 620539,
        "tx_pos": 0,
        "tx_hash": "4ec3b63d764558303eda720e8e51f69bbcfe81376075657313fb587306f8a9b0",
        "value": 450000,
        "isSpentInMempoolTx": false
    }],
    "error": ""
}, {
    "script": "995ea8d0f752f41cdd99bb9d54cb004709e04c7dc4088bcbbbb9ea5c390a43c3",
    "result": [],
    "error": ""
}]
```

{% endtab %}

{% tab title="BTC" %}

```json
[{
    "script": "aebd9e3018dbb5eed9220f275d3098dad2448fecd1c4c253d8c75a780bb08ce3",
    "result": [{
        "height": 904231,
        "tx_pos": 1,
        "tx_hash": "97b654a463364bf0fa0035dcb315abcdcf6c39ab4e522b3488060ba7098f55f0",
        "value": 2388665,
        "isSpentInMempoolTx": false
    }, {
        "height": 904268,
        "tx_pos": 0,
        "tx_hash": "fe18d4743815e5c152824063d08040d1df9bde0fcbe964288c3035cc16f63f0e",
        "value": 6389114,
        "isSpentInMempoolTx": false
    }, 
    ...
    ],
    "error": ""
}, {
    "script": "843bf6ea60946a9ff5cf1d526878177317b88dcba83db33a4036ae9ca9f1f0cf",
    "result": [{
        "height": 891509,
        "tx_pos": 0,
        "tx_hash": "d38d3c310658daf5bfa5ab65e18509dd1f532de99c12d51373f39abf4c66feb3",
        "value": 1785,
        "isSpentInMempoolTx": false
    }],
    "error": ""
}]
```

{% endtab %}
{% endtabs %}

**URL Parameters**

| Parameter | Description                         |
| --------- | ----------------------------------- |
| chain     | Desired blockchain: `bsv` or `btc`. |
| network   | Selected network: `main` or `test`. |

## Get Unconfirmed Spent Tx Output

This endpoint retrieves where the specified unconfirmed transaction output was spent.

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<txid>/<voutIndex>/unconfirmed/spent
```

{% endcode %}

#### Example Request

{% tabs %}
{% tab title="BSV" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/c6647a562ac6a3cce0f46c2fb2b417cbd5daf1258f2a96d7556e6b9304f2889a/0/unconfirmed/spent"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/tx/f656777a198cc497da4ed2f159f56868508fce40b3d32edeca770aba79afd52a/1/unconfirmed/spent"
```

{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="BSV" %}

```json
{
    "txid": "6fe244e16ea34b30ec2888c41d7e05a36fc1838de6a612008adf71c99678c0c1",
    "vin": 0,
    "status": "unconfirmed"
}
```

{% endtab %}

{% tab title="BTC" %}

```json
{
    "txid": "246523804e2fd48cf27314897d3abe8d2737376549c21b162dec64aa741265df",
    "vin": 0,
    "status": "unconfirmed"
}
```

{% endtab %}
{% endtabs %}

**URL Parameters**

| Parameter | Description                         |
| --------- | ----------------------------------- |
| network   | Selected network: `main` or `test`. |
| txid      | Transaction ID.                     |
| voutIndex | Output index.                       |

## Get Confirmed Spent Tx Output

This endpoint retrieves where the specified confirmed transaction output was spent.

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<txid>/<voutIndex>/confirmed/spent
```

{% endcode %}

#### Example Request

{% tabs %}
{% tab title="BSV" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/17d533c6a215223a62eef389707f77bef1601a18e4e994805a7846c3f3d50870/2/confirmed/spent"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/tx/27e9a5d180186ccd0ff343a11e6595cec753ed9dcc7e62e977112bf8bf426436/0/confirmed/spent"
```

{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="BSV" %}

```json
{
    "txid": "87645a7c4a9a5a9b9cd1468db19cdba44129c35cc487fc57c4d8843141ad2551",
    "vin": 2,
    "status": "confirmed"
}
```

{% endtab %}

{% tab title="BTC" %}

```json
{
    "txid": "ad7e7be78c298efdc375c3500d17199b9051825afcc91a6974c615a81f9a0afd",
    "vin": 0,
    "status": "confirmed"
}
```

{% endtab %}
{% endtabs %}

**URL Parameters**

| Parameter | Description                         |
| --------- | ----------------------------------- |
| chain     | Desired blockchain: `bsv` or `btc`. |
| network   | Selected network: `main` or `test`. |
| txid      | Transaction ID.                     |
| voutIndex | Output index.                       |

## Get Spent Transaction Output

This endpoint retrieves where the specified transaction output was spent, checking both confirmed and unconfirmed in a single call.

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/bsv/<network>/tx/<txid>/<voutIndex>/spent
```

{% endcode %}

#### Example Request

{% tabs %}
{% tab title="BSV" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/tx/17d533c6a215223a62eef389707f77bef1601a18e4e994805a7846c3f3d50870/2/spent"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/tx/27e9a5d180186ccd0ff343a11e6595cec753ed9dcc7e62e977112bf8bf426436/0/spent"
```

{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="BSV" %}

```json
{
    "txid": "87645a7c4a9a5a9b9cd1468db19cdba44129c35cc487fc57c4d8843141ad2551",
    "vin": 2,
    "status": "confirmed"
}
```

{% endtab %}

{% tab title="BTC" %}

```json
{
    "txid": "ad7e7be78c298efdc375c3500d17199b9051825afcc91a6974c615a81f9a0afd",
    "vin": 0,
    "status": "confirmed"
}
```

{% endtab %}
{% endtabs %}

**URL Parameters**

| Parameter | Description                         |
| --------- | ----------------------------------- |
| network   | Selected network: `main` or `test`. |
| txid      | Transaction ID.                     |
| voutIndex | Output index.                       |

**Errors**

| Error             | Description                                                                 |
| ----------------- | --------------------------------------------------------------------------- |
| `400 Bad Request` | If UTXO is unknown.                                                         |
| `404 Not Found`   | If UTXO is known but spent details are not found, i.e., it's still unspent. |

## Bulk Spent Transaction Outputs

This endpoint retrieves where the specified transaction outputs were spent, checking both confirmed and unconfirmed in a single call.

{% hint style="info" %}
Max 20 transaction outputs per request.
{% endhint %}

{% code title="HTTP Request" %}

```
POST https://api.whatsonchain.com/v1/bsv/<network>/utxos/spent
```

{% endcode %}

{% code title="Request Data" %}

```json
{
    "utxos": [
        {
        "txid": "<txid>",
        "vout": <vout>
        },
        {
        "txid": "<txid>",
        "vout": <vout>
        },
        ...
    ]
}
```

{% endcode %}

#### Example Request

{% tabs %}
{% tab title="BSV" %}

```sh
curl --location --request POST "https://api.whatsonchain.com/v1/bsv/main/utxos/spent" \
  --header "Content-Type: application/json" \
  --data "{\"utxos\" :[{ \"txid\" :\"87645a7c4a9a5a9b9cd1468db19cdba44129c35cc487fc57c4d8843141ad2551\", \"vout\" : 2}, {\"txid\" :\"c6647a562ac6a3cce0f46c2fb2b417cbd5daf1258f2a96d7556e6b9304f2889a\", \"vout\" : 0}]}"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request POST "https://api.whatsonchain.com/v1/btc/main/utxos/spent" \
  --header "Content-Type: application/json" \
  --data "{\"utxos\" :[{ \"txid\" :\"27e9a5d180186ccd0ff343a11e6595cec753ed9dcc7e62e977112bf8bf426436\", \"vout\" : 0}, {\"txid\" :\"f656777a198cc497da4ed2f159f56868508fce40b3d32edeca770aba79afd52a\", \"vout\" : 1}]}"
```

{% endtab %}
{% endtabs %}

#### Example Response

{% tabs %}
{% tab title="BSV" %}

```json
[{
    "utxo": {
        "txid": "87645a7c4a9a5a9b9cd1468db19cdba44129c35cc487fc57c4d8843141ad2551",
        "vout": 2
    },
    "spentIn": {
        "txid": "87645a7c4a9a5a9b9cd1468db19cdba44129c35cc487fc57c4d8843141ad2551",
        "vin": 2,
        "status": "confirmed"
    },
    "error": ""
}, {
    "utxo": {
        "txid": "c6647a562ac6a3cce0f46c2fb2b417cbd5daf1258f2a96d7556e6b9304f2889a",
        "vout": 0
    },
    "spentIn": {
        "txid": "c6647a562ac6a3cce0f46c2fb2b417cbd5daf1258f2a96d7556e6b9304f2889a",
        "vin": 0,
        "status": "unconfirmed"
    },
    "error": ""
}]
```

{% endtab %}

{% tab title="BTC" %}

```json
[{
    "utxo": {
        "txid": "27e9a5d180186ccd0ff343a11e6595cec753ed9dcc7e62e977112bf8bf426436",
        "vout": 0
    },
    "spentIn": {
        "txid": "27e9a5d180186ccd0ff343a11e6595cec753ed9dcc7e62e977112bf8bf426436",
        "vin": 0,
        "status": "confirmed"
    },
    "error": ""
}, {
    "utxo": {
        "txid": "f656777a198cc497da4ed2f159f56868508fce40b3d32edeca770aba79afd52a",
        "vout": 1
    },
    "spentIn": {
        "txid": "f656777a198cc497da4ed2f159f56868508fce40b3d32edeca770aba79afd52a",
        "vin": 1,
        "status": "confirmed"
    },
    "error": ""
}]
```

{% endtab %}
{% endtabs %}

**URL Parameters**

| Parameter | Description                         |
| --------- | ----------------------------------- |
| network   | Selected network: `main` or `test`. |

**Errors**

| Parameter         | Description                                                                 |
| ----------------- | --------------------------------------------------------------------------- |
| `400 Bad Request` | If UTXO is unknown.                                                         |
| `404 Not Found`   | If UTXO is known but spent details are not found, i.e., it's still unspent. |

## ElectrumX Wrapper for ElectrumSV (Beta)

We've created a wrapper for our UTXO service that acts exactly like an ElectrumX server that you can plug into the [ElectrumSV](https://electrumsv.io/) wallet (Network - Server).

Use any of these URLs to try it out and let us know what you think in the [Telegram channel](https://t.co/2WWqPUGUoK):

* URL1: <http://electrumx-adapter-1.whatsonchain.com/>
* URL2: <http://electrumx-adapter-2.whatsonchain.com/>

Use either the `50001` ,`50002` , or `50003` port.
