Block

Fetch a block by hash

Fetches a block given its hash from the Nimiq RPC. It has an option to include the transactions in the block, which defaults to false.

GET
/getBlockByHash/{hash}/{includeBody}
/getBlockByHash/4125f730a0047b21d80dda211dff905d250875e5fd2f9c5a0220ad7d195883e5/false

Path Parameters

hash
Required
string

The hash of the block to fetch.

includeBody
Required
boolean

Whether to include the transactions in the block.

curl -X GET "https://api.nimiqhub.com/getBlockByHash/4125f730a0047b21d80dda211dff905d250875e5fd2f9c5a0220ad7d195883e5/false"

Block data successfully retrieved

{
  "data": {
    "hash": "4125f730a0047b21d80dda211dff905d250875e5fd2f9c5a0220ad7d195883e5",
    "size": 953,
    "batch": 18783,
    "epoch": 27,
    "network": "TestAlbatross",
    "version": 1,
    "number": 4158990,
    "timestamp": 1721924547762,
    "parentHash": "c3b04e9d6110b7947b2570218db730af6f111ed7a6f0b742ccf4c836504a1523",
    "seed": "c415e09c88c71b28e47ae497d2f5908cbedf5dedbc1fb344bfb6619255b4aad1eeb54bb4d0ef51846ea691b7a1c19a6edd883cc9d859297313ce517f7c13470b59bd9bb39547106db4f071a4247a362dfba442cb2844f288a19efbe7e2d1fd06",
    "extraData": "",
    "stateHash": "3770e2514ed96885c08a6de85c24e3353da7e2208c0aa41955b810550a3d54e7",
    "bodyHash": "76460f2f4d70923eb750de3dec20d7b2dfa7167e11cce691652916a16751063c",
    "historyHash": "1f9f21aa3fa230a9c3760d58b8bcbd5e32e0346b9fc9547add179fb132d130f9",
    "transactions": [
      {
        "hash": "49815d047ede23f3bee9b18496f8c8dd7328ab31ce1eea42fb7b6df3d2949c3b",
        "blockNumber": 4158990,
        "timestamp": 1721924547762,
        "confirmations": 70329,
        "size": 48,
        "relatedAddresses": [
          "NQ57 2F6C X3GB Y9B7 04U5 2BVA 4BVC M2T0 ELRL",
          "NQ81 C01N BASE 0000 0000 0000 0000 0000 0000"
        ],
        "from": "NQ81 C01N BASE 0000 0000 0000 0000 0000 0000",
        "fromType": 0,
        "to": "NQ57 2F6C X3GB Y9B7 04U5 2BVA 4BVC M2T0 ELRL",
        "toType": 0,
        "value": 28231971,
        "fee": 0,
        "senderData": "",
        "recipientData": "",
        "flags": 0,
        "validityStartHeight": 4158990,
        "proof": "",
        "networkId": 5,
        "executionResult": true
      }
    ],
    "type": "macro",
    "isElectionBlock": false,
    "parentElectionHash": "9f2f261d639dc246978a00eb618f69b4438c7247fc9baf00f1cdbe9d8f69f4be",
    "nextBatchInitialPunishedSet": [
      69
    ],
    "justification": {
      "round": 0,
      "sig": {
        "signature": "82b95c9a0aefe3a6968e2690d263118a7304414ab8135916cd9357323e96262fee0099233a678faffb3ae1fb6329b01123b8c68b801d8f7b3d2f56cf706d586823d1ba2d788cd7b60c95705c67d829ee43e741bce05ff16256348b0cdafa80",
        "signers": [
          70,
          71
        ]
      }
    }
  },
  "metadata": null
}