New Here? Claim Your 30% Discount on Your First Blockchain Node Access!

banner image

Last updated on January 1, 1970

4 min read

Method get_block_headers_range undefined ()
connect with JSON-RPC protocol

get_block_headers_range

info-circle-fill

Similar to get_block_header_by_height above, but for a range of blocks. This method includes a starting block height and an ending block height as parameters to retrieve basic information about the range of blocks.

Parameters

start_height - unsigned int

The starting block's height.

None - unsigned int

The ending block's height.

Request

curl --location --request POST 'https://xmr.getblock.io/mainnet/json_rpc' \ 
--header 'x-api-key: YOUR-API-KEY' \ 
--header 'Content-Type: application/json' \ 
--data-raw '{"jsonrpc": "2.0",
"method": "get_block_headers_range",
"params": {"start_height": 1545999, "end_height": 1546000},
"id": "getblock.io"}'

Response

{
    "id": "getblock.io",
    "jsonrpc": "2.0",
    "result": {
        "credits": 0,
        "headers": [
            {
                "block_size": 80,
                "block_weight": 80,
                "cumulative_difficulty": 1,
                "cumulative_difficulty_top64": 0,
                "depth": 2394584,
                "difficulty": 1,
                "difficulty_top64": 0,
                "hash": "418015bb9ae982a1975da7d79277c2705727a56894ba0fb246adaabb1f4632e3",
                "height": 0,
                "long_term_weight": 80,
                "major_version": 1,
                "miner_tx_hash": "c88ce9783b4f11190d7b9c17a69c1c52200f9faaee8e98dd07e6811175177139",
                "minor_version": 0,
                "nonce": 10000,
                "num_txes": 0,
                "orphan_status": false,
                "pow_hash": "",
                "prev_hash": "0000000000000000000000000000000000000000000000000000000000000000",
                "reward": 17592186044415,
                "timestamp": 0,
                "wide_cumulative_difficulty": "0x1",
                "wide_difficulty": "0x1"
            }
        ],
        "status": "OK",
        "top_hash": "",
        "untrusted": false
    }
}
banner icon

Start Building with GetBlock RPCs for Free