Block

Fetch a block by number

Fetches block data for a given block number from the Nimiq RPC, including its transactions.

GET
/getBlockByNumber/{number}
/getBlockByNumber/{number}

Path Parameters

number
Required
integer

The number of the block to fetch.

curl -X GET "https://test.nimiqhub.com/getBlockByNumber/4158990"

Block data successfully retrieved

{
  "data": {
    "hash": "string",
    "size": 0,
    "batch": 0,
    "epoch": 0,
    "network": "string",
    "version": 0,
    "number": 0,
    "timestamp": 0,
    "parentHash": "string",
    "seed": "string",
    "extraData": "string",
    "stateHash": "string",
    "bodyHash": "string",
    "historyHash": "string",
    "transactions": [
      {
        "hash": "string",
        "blockNumber": 0,
        "timestamp": 0,
        "confirmations": 0,
        "size": 0,
        "relatedAddresses": [
          "string"
        ],
        "from": "string",
        "fromType": 0,
        "to": "string",
        "toType": 0,
        "value": 0,
        "fee": 0,
        "senderData": "string",
        "recipientData": "string",
        "flags": 0,
        "validityStartHeight": 0,
        "proof": "string",
        "networkId": 0,
        "executionResult": true
      }
    ],
    "type": "string",
    "isElectionBlock": true,
    "parentElectionHash": "string",
    "nextBatchInitialPunishedSet": [
      0
    ],
    "justification": {
      "round": 0,
      "sig": {
        "signature": "string",
        "signers": [
          0
        ]
      }
    }
  },
  "metadata": null
}