# Block

## Get by Hash

This endpoint retrieves the block details of a given hash.

{% hint style="info" %}
(BSV-only) For a block with up to 1000 transactions, all transaction ids are returned in response to this call.

* If a block has more than 1000 transactions, only the top 100 transaction ids are returned.
* To get the remaining ids see the [Get Block Pages](#get-block-pages) section.
  {% endhint %}

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/<chain>/<network>/block/hash/<hash>
```

{% endcode %}

#### Example Request

{% tabs %}
{% tab title="BSV" %}
{% code overflow="wrap" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/block/hash/000000000000000004a288072ebb35e37233f419918f9783d499979cb6ac33eb"
```

{% endcode %}
{% endtab %}

{% tab title="BTC" %}
{% code overflow="wrap" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/block/hash/00000000000000000002145230780fd4fd371945f9365664d98a2631358d3f8c"
```

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

#### Example Response

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

```json
{
    "hash": "000000000000000004a288072ebb35e37233f419918f9783d499979cb6ac33eb",
    "confirmations": 330021,
    "size": 14421,
    "height": 575045,
    "version": 536928256,
    "versionHex": "2000e000",
    "merkleroot": "4ebcba09addd720991d03473f39dce4b9a72cc164e505cd446687a54df9b1585",
    "txcount": 5,
    "nTx": 0,
    "num_tx": 5,
    "tx": ["bb146889d71357667c58a37258f40b0521a6ba7a259fbfa721b747d55567551a", "c7e8317b48e72644e2b83c87c54f61bcda82326392f969a097fb801aed69b500", "fd39debc631cf1a97702052fa60303d53062d6f2c1b624ab1f5fc0d20233736f", "65cb37947ccb7c5b7cc4ac36a200613bfc39a7f7c6c0314a23dbcc5b3908b5b8", "0f9d562702259822778193ff46f0c6d5e4aa744a433982770d3134e2bf454d10"],
    "time": 1553416668,
    "mediantime": 1553414858,
    "nonce": 87914848,
    "bits": "180997ee",
    "difficulty": 114608607557.4425,
    "chainwork": "000000000000000000000000000000000000000000ddf5d385546872bab7dc01",
    "previousblockhash": "00000000000000000988156c7075dc9147a5b62922f1310862e8b9000d46dd9b",
    "nextblockhash": "00000000000000000112b36a37c10235fa0c991f680bc5482ba9692e0ae697db",
    "coinbaseTx": {
        "txid": "bb146889d71357667c58a37258f40b0521a6ba7a259fbfa721b747d55567551a",
        "hash": "bb146889d71357667c58a37258f40b0521a6ba7a259fbfa721b747d55567551a",
        "version": 1,
        "size": 119,
        "locktime": 0,
        "vin": [{
            "coinbase": "0345c6082f626d67706f6f6c2e636f6d2f473173717918707a8aae4a936f101e0000",
            "txid": "",
            "vout": 0,
            "scriptSig": {
                "asm": "",
                "hex": ""
            },
            "sequence": 4294967295
        }],
        "vout": [{
            "value": 12.50023822,
            "n": 0,
            "scriptPubKey": {
                "asm": "OP_DUP OP_HASH160 85770ad0ee64a4f3ee4027e199c32f876e03a2d9 OP_EQUALVERIFY OP_CHECKSIG",
                "hex": "76a91485770ad0ee64a4f3ee4027e199c32f876e03a2d988ac",
                "reqSigs": 1,
                "type": "pubkeyhash",
                "addresses": ["1DAhUiQxHzL1oAusoUDdUM89spXuAG1sqy"],
                "isTruncated": false
            }
        }],
        "blockhash": "000000000000000004a288072ebb35e37233f419918f9783d499979cb6ac33eb",
        "confirmations": 330021,
        "time": 1553416668,
        "blocktime": 1553416668,
        "blockheight": 575045
    },
    "totalFees": 0.0002382199999999557,
    "miner": "Bmgpool",
    "pages": null
}
```

{% endtab %}

{% tab title="BTC" %}

```json
{
    "tx": ["f89b6ba9d48b1adb98d8e8f37ac9611183826a9f361bac970c562f42a76fed15", ...]
    "miner": "AntPool",
    "hash": "00000000000000000002145230780fd4fd371945f9365664d98a2631358d3f8c",
    "confirmations": 578,
    "size": 1509584,
    "height": 904510,
    "version": 546201600,
    "versionHex": "208e6000",
    "merkleroot": "0736388ae96f0cfbea8995039e9ecea3ddcec17ab54d2e737267c3df4c7b4818",
    "txcount": 5072,
    "time": 1751923471,
    "mediantime": 1751920846,
    "nonce": 3906737240,
    "bits": "17026816",
    "difficulty": 116958512019762.1,
    "chainwork": "0000000000000000000000000000000000000000d07aa30757a4549b9da2c8c2",
    "previousblockhash": "000000000000000000015a6b45bf7b5f5ca04553206f980de6f11c62a3e9a3b4",
    "nextblockhash": "00000000000000000001df5557c00a211ad5613ff0e2402df124c58b4dd17729",
    "totalFees": 0.048824670000000125,
    "src": "bitcoin",
    "coinbaseTx": {
        "hex": "010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff56033ecd0d194d696e656420627920416e74506f6f6c20b600c900259e479ffabe6d6d500729c2badb393c33ecb43df4d1b1cfb72500e1bbc007bd8d7e40686cde9913100000000000000000000bb837e9e80000000000ffffffff07220200000000000017a91442402a28dd61f2718a4b27ae72a4791d5bbdade78721ddea120000000017a9145249bdf2c131d43995cff42e8feee293f79297a8870000000000000000266a24aa21a9ed4b61cde4f19f3e7e56901daf86503053b3e5d555ca2a9f1931e831844a75facb00000000000000002f6a2d434f52450142fdeae88682a965939fee9b7b2bd5b99694ff644e3ecda72cb7961caa4b541b1e322bcfe0b5a0300000000000000000146a12455853415401000d130f0e0e0b041f1200130000000000000000296a277379733aae4701474853a120872f92d1cfed38b1b72411f262ba2488a79035706a3a761a761f0000000000000000002b6a2952534b424c4f434b3a42c1fa55569b4e42870d0389e18cbee1cb1aceb4328ab065760c511500764bc50120000000000000000000000000000000000000000000000000000000000000000000000000",
        "txid": "f89b6ba9d48b1adb98d8e8f37ac9611183826a9f361bac970c562f42a76fed15",
        "hash": "045aec8ab9081f3d39cbb2ba0a7a28ce93eb0accfe3b5308246844d01b4e6de0",
        "size": 471,
        "version": 1,
        "locktime": 0,
        "vout": [{
            "value": 0.00000546,
            "n": 0,
            "scriptPubKey": {
                "asm": "OP_HASH160 42402a28dd61f2718a4b27ae72a4791d5bbdade7 OP_EQUAL",
                "hex": "a91442402a28dd61f2718a4b27ae72a4791d5bbdade787",
                "reqSigs": 1,
                "type": "scripthash",
                "addresses": ["37jKPSmbEGwgfacCr2nayn1wTaqMAbA94Z"],
                "isTruncated": false
            },
            "scripthash": "6ae165e8ea6275a089d2222c7a8ac38585de11861c06c420352d464793a099d0"
        },
        ...
        ],
        "blockhash": "00000000000000000002145230780fd4fd371945f9365664d98a2631358d3f8c",
        "confirmations": 578,
        "time": 1751923471,
        "blocktime": 1751923471,
        "vincount": 1,
        "voutcount": 7,
        "voutvalue": 3.17382467,
        "vin": [{
            "n": 0,
            "coinbase": "033ecd0d194d696e656420627920416e74506f6f6c20b600c900259e479ffabe6d6d500729c2badb393c33ecb43df4d1b1cfb72500e1bbc007bd8d7e40686cde9913100000000000000000000bb837e9e80000000000",
            "sequence": 4294967295,
            "minerInfo": {
                "name": "AntPool",
                "link": "https://www.antpool.com/",
                "type": "tag"
            }
        }]
    }
}
```

{% endtab %}
{% endtabs %}

**URL Parameters**

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

## Get by Height

This endpoint retrieves the block details of a given block height.

{% hint style="info" %}
(BSV-only) For a block with up to 1000 transactions, all transaction ids are returned in response to this call.

* If a block has more than 1000 transactions, only the top 100 transaction ids are returned.
* To get the remaining ids see the [Get Block Pages](#get-block-pages) section.
  {% endhint %}

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/<chain>/<network>/block/height/<height>
```

{% endcode %}

#### Example Request

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

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/block/height/575045"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/block/height/904510"
```

{% endtab %}
{% endtabs %}

#### Example Response

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

```json
{
    "hash": "000000000000000004a288072ebb35e37233f419918f9783d499979cb6ac33eb",
    "confirmations": 330022,
    "size": 14421,
    "height": 575045,
    "version": 536928256,
    "versionHex": "2000e000",
    "merkleroot": "4ebcba09addd720991d03473f39dce4b9a72cc164e505cd446687a54df9b1585",
    "txcount": 5,
    "nTx": 0,
    "num_tx": 5,
    "tx": ["bb146889d71357667c58a37258f40b0521a6ba7a259fbfa721b747d55567551a", "c7e8317b48e72644e2b83c87c54f61bcda82326392f969a097fb801aed69b500", "fd39debc631cf1a97702052fa60303d53062d6f2c1b624ab1f5fc0d20233736f", "65cb37947ccb7c5b7cc4ac36a200613bfc39a7f7c6c0314a23dbcc5b3908b5b8", "0f9d562702259822778193ff46f0c6d5e4aa744a433982770d3134e2bf454d10"],
    "time": 1553416668,
    "mediantime": 1553414858,
    "nonce": 87914848,
    "bits": "180997ee",
    "difficulty": 114608607557.4425,
    "chainwork": "000000000000000000000000000000000000000000ddf5d385546872bab7dc01",
    "previousblockhash": "00000000000000000988156c7075dc9147a5b62922f1310862e8b9000d46dd9b",
    "nextblockhash": "00000000000000000112b36a37c10235fa0c991f680bc5482ba9692e0ae697db",
    "coinbaseTx": {
        "txid": "bb146889d71357667c58a37258f40b0521a6ba7a259fbfa721b747d55567551a",
        "hash": "bb146889d71357667c58a37258f40b0521a6ba7a259fbfa721b747d55567551a",
        "version": 1,
        "size": 119,
        "locktime": 0,
        "vin": [{
            "coinbase": "0345c6082f626d67706f6f6c2e636f6d2f473173717918707a8aae4a936f101e0000",
            "txid": "",
            "vout": 0,
            "scriptSig": {
                "asm": "",
                "hex": ""
            },
            "sequence": 4294967295
        }],
        "vout": [{
            "value": 12.50023822,
            "n": 0,
            "scriptPubKey": {
                "asm": "OP_DUP OP_HASH160 85770ad0ee64a4f3ee4027e199c32f876e03a2d9 OP_EQUALVERIFY OP_CHECKSIG",
                "hex": "76a91485770ad0ee64a4f3ee4027e199c32f876e03a2d988ac",
                "reqSigs": 1,
                "type": "pubkeyhash",
                "addresses": ["1DAhUiQxHzL1oAusoUDdUM89spXuAG1sqy"],
                "isTruncated": false
            }
        }],
        "blockhash": "000000000000000004a288072ebb35e37233f419918f9783d499979cb6ac33eb",
        "confirmations": 330022,
        "time": 1553416668,
        "blocktime": 1553416668,
        "blockheight": 575045
    },
    "totalFees": 0.0002382199999999557,
    "miner": "Bmgpool",
    "pages": null
}
```

{% endtab %}

{% tab title="BTC" %}

```json
{
    "tx": ["f89b6ba9d48b1adb98d8e8f37ac9611183826a9f361bac970c562f42a76fed15", ...]
    "miner": "AntPool",
    "hash": "00000000000000000002145230780fd4fd371945f9365664d98a2631358d3f8c",
    "confirmations": 578,
    "size": 1509584,
    "height": 904510,
    "version": 546201600,
    "versionHex": "208e6000",
    "merkleroot": "0736388ae96f0cfbea8995039e9ecea3ddcec17ab54d2e737267c3df4c7b4818",
    "txcount": 5072,
    "time": 1751923471,
    "mediantime": 1751920846,
    "nonce": 3906737240,
    "bits": "17026816",
    "difficulty": 116958512019762.1,
    "chainwork": "0000000000000000000000000000000000000000d07aa30757a4549b9da2c8c2",
    "previousblockhash": "000000000000000000015a6b45bf7b5f5ca04553206f980de6f11c62a3e9a3b4",
    "nextblockhash": "00000000000000000001df5557c00a211ad5613ff0e2402df124c58b4dd17729",
    "totalFees": 0.048824670000000125,
    "src": "bitcoin",
    "coinbaseTx": {
        "hex": "010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff56033ecd0d194d696e656420627920416e74506f6f6c20b600c900259e479ffabe6d6d500729c2badb393c33ecb43df4d1b1cfb72500e1bbc007bd8d7e40686cde9913100000000000000000000bb837e9e80000000000ffffffff07220200000000000017a91442402a28dd61f2718a4b27ae72a4791d5bbdade78721ddea120000000017a9145249bdf2c131d43995cff42e8feee293f79297a8870000000000000000266a24aa21a9ed4b61cde4f19f3e7e56901daf86503053b3e5d555ca2a9f1931e831844a75facb00000000000000002f6a2d434f52450142fdeae88682a965939fee9b7b2bd5b99694ff644e3ecda72cb7961caa4b541b1e322bcfe0b5a0300000000000000000146a12455853415401000d130f0e0e0b041f1200130000000000000000296a277379733aae4701474853a120872f92d1cfed38b1b72411f262ba2488a79035706a3a761a761f0000000000000000002b6a2952534b424c4f434b3a42c1fa55569b4e42870d0389e18cbee1cb1aceb4328ab065760c511500764bc50120000000000000000000000000000000000000000000000000000000000000000000000000",
        "txid": "f89b6ba9d48b1adb98d8e8f37ac9611183826a9f361bac970c562f42a76fed15",
        "hash": "045aec8ab9081f3d39cbb2ba0a7a28ce93eb0accfe3b5308246844d01b4e6de0",
        "size": 471,
        "version": 1,
        "locktime": 0,
        "vout": [{
            "value": 0.00000546,
            "n": 0,
            "scriptPubKey": {
                "asm": "OP_HASH160 42402a28dd61f2718a4b27ae72a4791d5bbdade7 OP_EQUAL",
                "hex": "a91442402a28dd61f2718a4b27ae72a4791d5bbdade787",
                "reqSigs": 1,
                "type": "scripthash",
                "addresses": ["37jKPSmbEGwgfacCr2nayn1wTaqMAbA94Z"],
                "isTruncated": false
            },
            "scripthash": "6ae165e8ea6275a089d2222c7a8ac38585de11861c06c420352d464793a099d0"
        },
        ...
        ],
        "blockhash": "00000000000000000002145230780fd4fd371945f9365664d98a2631358d3f8c",
        "confirmations": 578,
        "time": 1751923471,
        "blocktime": 1751923471,
        "vincount": 1,
        "voutcount": 7,
        "voutvalue": 3.17382467,
        "vin": [{
            "n": 0,
            "coinbase": "033ecd0d194d696e656420627920416e74506f6f6c20b600c900259e479ffabe6d6d500729c2badb393c33ecb43df4d1b1cfb72500e1bbc007bd8d7e40686cde9913100000000000000000000bb837e9e80000000000",
            "sequence": 4294967295,
            "minerInfo": {
                "name": "AntPool",
                "link": "https://www.antpool.com/",
                "type": "tag"
            }
        }]
    }
}
```

{% endtab %}
{% endtabs %}

**URL Parameters**

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

## Get Block Pages (BSV-only)

If a block has more than **1000** transactions, the page URLs will be provided in the `pages` element when getting a block by hash or height.

{% code title="Example pages element in "Get block by height/hash" response:" %}

```json
{
    "hash": "000000000000000004a288072ebb35e37233f419918f9783d499979cb6ac33eb",
    ...
    "pages": {
        "uri": [
            "/block/hash/000000000000000000885a4d8e9912f085b42288adc58b3ee5830a7da9f4fef4/page/1",
            "/block/hash/000000000000000000885a4d8e9912f085b42288adc58b3ee5830a7da9f4fef4/page/2",
            ...
    ],
        "size": 50000
    }
```

{% endcode %}

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/bsv/<network>/block/hash/<hash>/page/<number>
```

{% endcode %}

{% code title="Example Request" %}

```shell
curl --location --request GET  "https://api.whatsonchain.com/v1/bsv/main/block/hash/000000000000000000885a4d8e9912f085b42288adc58b3ee5830a7da9f4fef4/page/1"
```

{% endcode %}

{% code title="Example Response" %}

```json
[
    "89b4e01ea1ab27edb6ea66899637b526faebeb42ca0302ff9ed916670f1330fe",
    "1097bfc9b1f586352a1ab29afd27c1f89e0a5d9790ea08a2b2a7d988ea6f2cfe",
    ....
]
```

{% endcode %}

**URL Parameters**

| Parameter | Description                         |
| --------- | ----------------------------------- |
| network   | Selected network: `main` or `test`. |
| hash      | Block hash.                         |
| number    | Page number.                        |

## Get Header by Hash or Height

This endpoint retrieves the block header details of a given hash or height.

Use *`?format=block-headers-client`* as a query parameter for the [block-headers-client](https://github.com/bitcoin-sv/block-headers-client) response format.

Possible values for the status when the block-headers-client format is requested:

1. `active`: Block is a part of the current active chain.
2. `orphaned`: Block is not a part of the current active chain.

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/<chain>/<network>/block/<hashOrHeight>/header
```

{% endcode %}

#### Example Request

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

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/block/000000000000000004a288072ebb35e37233f419918f9783d499979cb6ac33eb/header"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/block/00000000000000000000c1412566504aeb8921b82126172437d3dd04e8683b9a/header"
```

{% endtab %}
{% endtabs %}

#### Example Response

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

```json
{
    "hash": "000000000000000004a288072ebb35e37233f419918f9783d499979cb6ac33eb",
    "confirmations": 330022,
    "size": 14421,
    "height": 575045,
    "version": 536928256,
    "versionHex": "2000e000",
    "merkleroot": "4ebcba09addd720991d03473f39dce4b9a72cc164e505cd446687a54df9b1585",
    "time": 1553416668,
    "mediantime": 1553414858,
    "nonce": 87914848,
    "bits": "180997ee",
    "difficulty": 114608607557.4425,
    "chainwork": "000000000000000000000000000000000000000000ddf5d385546872bab7dc01",
    "previousblockhash": "00000000000000000988156c7075dc9147a5b62922f1310862e8b9000d46dd9b",
    "nextblockhash": "00000000000000000112b36a37c10235fa0c991f680bc5482ba9692e0ae697db",
    "nTx": 0,
    "num_tx": 5
}
```

{% endtab %}

{% tab title="BTC" %}

```json
{
    "hash": "00000000000000000000c1412566504aeb8921b82126172437d3dd04e8683b9a",
    "previousblockhash": "000000000000000000020988865dd391816915731f44a2c50bd5f0a45e4ba44a",
    "nextblockhash": "0000000000000000000246cd1ee83a0f684c11046899b27a90befd83c85bc8d3",
    "height": 905073,
    "confirmations": 34,
    "time": 1752236138,
    "version": 537214976,
    "versionHex": "20054000",
    "merkleroot": "5581b409a5067197468e82e20599eef9678f81880fa3e902cc08b0c648693549",
    "bits": "17026816",
    "nonce": 3798315392,
    "difficulty": 116958512019762.1,
    "txcount": 2945,
    "nTx": 2945,
    "chainwork": "0000000000000000000000000000000000000000d164940637443d7138ea87dc",
    "mediantime": 1752234300
}
```

{% endtab %}
{% endtabs %}

**URL Parameters**

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

## Get Headers

This endpoint retrieves the last 10 block headers.

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/<chain>/<network>/block/headers
```

{% endcode %}

#### Example Request

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

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/block/headers"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/block/headers"
```

{% endtab %}
{% endtabs %}

#### Example Response

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

```json
[{
    "hash": "000000000000000001c1f8612fde5c70ba17d52b76db6f5c1e6403613f67dc72",
    "confirmations": 1,
    "size": 8187014,
    "height": 905066,
    "version": 738197504,
    "versionHex": "2c000000",
    "merkleroot": "63b4bd4890b9c0866981608b4208877f72a37245be8bf03c70d990372b25a8d5",
    "time": 1752245194,
    "mediantime": 1752242975,
    "nonce": 3389927517,
    "bits": "181584ed",
    "difficulty": 51093569403.56039,
    "chainwork": "0000000000000000000000000000000000000000016755aed8ebac0032110051",
    "previousblockhash": "00000000000000000d4a64c6818ed5a694b0f02a674fab052f04c44f8ab82a0a",
    "nextblockhash": "",
    "nTx": 0,
    "num_tx": 1027
}, {
    "hash": "00000000000000000d4a64c6818ed5a694b0f02a674fab052f04c44f8ab82a0a",
    "confirmations": 2,
    "size": 3055109,
    "height": 905065,
    "version": 575381504,
    "versionHex": "224ba000",
    "merkleroot": "2e48066f4155602c02580087f6418cc9c215d50c5d5dd7675b74f5df7e82aa84",
    "time": 1752244987,
    "mediantime": 1752242284,
    "nonce": 526349350,
    "bits": "181573d9",
    "difficulty": 51252456251.77387,
    "chainwork": "0000000000000000000000000000000000000000016755a2f375c70ebdaa0ab3",
    "previousblockhash": "0000000000000000112ea3732c0417a2cee0130e9217dbba1b0ff078c92c904e",
    "nextblockhash": "000000000000000001c1f8612fde5c70ba17d52b76db6f5c1e6403613f67dc72",
    "nTx": 0,
    "num_tx": 3116
},
...
]
```

{% endtab %}

{% tab title="BTC" %}

```json
[{
    "hash": "00000000000000000002676232151539d2094d342e4ca69e42f90dcc010b5166",
    "previousblockhash": "0000000000000000000061958ebfa47a17b104af4cf77cd0f23141748397d505",
    "nextblockhash": "",
    "height": 905087,
    "confirmations": 1,
    "time": 1752245105,
    "version": 769130496,
    "versionHex": "2dd80000",
    "merkleroot": "b63f3f987192f8f067687b6548a1279d5ead90f08310280f085a067e02f119c8",
    "bits": "17026816",
    "nonce": 3104566716,
    "difficulty": 116958512019762.1,
    "txcount": 0,
    "nTx": 4505,
    "chainwork": "0000000000000000000000000000000000000000d16a654564630b4d9c4412c0",
    "mediantime": 1752240725
}, {
    "hash": "0000000000000000000061958ebfa47a17b104af4cf77cd0f23141748397d505",
    "previousblockhash": "000000000000000000023b837b327cf7baa43b41850501d6be7e3e48d0021f62",
    "nextblockhash": "00000000000000000002676232151539d2094d342e4ca69e42f90dcc010b5166",
    "height": 905086,
    "confirmations": 2,
    "time": 1752244939,
    "version": 536895488,
    "versionHex": "20006000",
    "merkleroot": "2c16c87bcfbca675178a5a72c011262863b998e562a6e4b8a1472465cca6258a",
    "bits": "17026816",
    "nonce": 3008593203,
    "difficulty": 116958512019762.1,
    "txcount": 0,
    "nTx": 3835,
    "chainwork": "0000000000000000000000000000000000000000d169fae57373212b952b6442",
    "mediantime": 1752239292
},
...
]
```

{% endtab %}
{% endtabs %}

**URL Parameters**

<table><thead><tr><th width="224">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></tbody></table>

## Get Header Bytes File Links

This endpoint retrieves a list of block header binary file links and each file only contains 80-byte block headers. These contain 10,000 block headers per file up to height `760,000`.&#x20;

Then 2,000 blocks per file after height `760,001` . New files are automatically created after every 2,000 blocks and added to the list.

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/<chain>/<network>/block/headers/resources
```

{% endcode %}

#### Example Request

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

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/block/headers/resources"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/block/headers/resources"
```

{% endtab %}
{% endtabs %}

#### Example Response

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

```json
{
   "files":[
      "https://api.whatsonchain.com/v1/bsv/main/block/headers/0_10000_headers.bin",
      "https://api.whatsonchain.com/v1/bsv/main/block/headers/100001_110000_headers.bin",
      "https://api.whatsonchain.com/v1/bsv/main/block/headers/110001_120000_headers.bin"
       ...
   ]
}
```

{% endtab %}

{% tab title="BTC" %}

```json
{
    "files": [
        "https://api.whatsonchain.com/v1/btc/main/block/headers/0_2000_headers.bin",
        "https://api.whatsonchain.com/v1/btc/main/block/headers/2001_4000_headers.bin",
        "https://api.whatsonchain.com/v1/btc/main/block/headers/4001_6000_headers.bin",
        ...
    ]
}
```

{% endtab %}
{% endtabs %}

**URL Parameters**

<table><thead><tr><th width="224">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></tbody></table>

## Get Latest Header Bytes

This endpoint retrieves the latest specified number of block headers (up to `100`) as a binary file. If "the `count` parameter is not provided, returns the latest header file, with up to 2000 block headers.

{% code title="HTTP Request" %}

```
GET https://api.whatsonchain.com/v1/bsv/main/block/headers/latest?count=<count>
```

{% endcode %}

#### Example Request

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

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/bsv/main/block/headers/latest?count=10"
```

{% endtab %}

{% tab title="BTC" %}

```sh
curl --location --request GET "https://api.whatsonchain.com/v1/btc/main/block/headers/latest?count=10"
```

{% endtab %}
{% endtabs %}

**URL Parameters**

<table><thead><tr><th width="224">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>count (optional)</td><td>Headers requested: between <code>1</code> (default) and <code>100</code>.</td></tr></tbody></table>
