Block

Get by Hash

This endpoint retrieves the block details of a given hash.

(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 section.

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

Example Request

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

Example Response

{
    "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
}

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.

(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 section.

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

Example Request

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

Example Response

{
    "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
}

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.

Example pages element in "Get block by height/hash" response:
{
    "hash": "000000000000000004a288072ebb35e37233f419918f9783d499979cb6ac33eb",
    ...
    "pages": {
        "uri": [
            "/block/hash/000000000000000000885a4d8e9912f085b42288adc58b3ee5830a7da9f4fef4/page/1",
            "/block/hash/000000000000000000885a4d8e9912f085b42288adc58b3ee5830a7da9f4fef4/page/2",
            ...
    ],
        "size": 50000
    }
HTTP Request
GET https://api.whatsonchain.com/v1/bsv/<network>/block/hash/<hash>/page/<number>
Example Request
curl --location --request GET  "https://api.whatsonchain.com/v1/bsv/main/block/hash/000000000000000000885a4d8e9912f085b42288adc58b3ee5830a7da9f4fef4/page/1"
Example Response
[
    "89b4e01ea1ab27edb6ea66899637b526faebeb42ca0302ff9ed916670f1330fe",
    "1097bfc9b1f586352a1ab29afd27c1f89e0a5d9790ea08a2b2a7d988ea6f2cfe",
    ....
]

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 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.

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

Example Request

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

Example Response

{
    "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
}

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.

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

Example Request

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

Example Response

[{
    "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
},
...
]

URL Parameters

Parameter
Description

chain

Desired blockchain: bsv or btc.

network

Selected network: main or test.

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.

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.

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

Example Request

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

Example Response

{
   "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"
       ...
   ]
}

URL Parameters

Parameter
Description

chain

Desired blockchain: bsv or btc.

network

Selected network: main or test.

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.

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

Example Request

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

URL Parameters

Parameter
Description

chain

Desired blockchain: bsv or btc.

network

Selected network: main or test.

count (optional)

Headers requested: between 1 (default) and 100.

Last updated

Was this helpful?