Blocks

Hint

The rules for generating queries to the node are given in module How to use REST API.

GET /blocks/height

Returns block number of current blockchain state.

Method Response:

{
  "height": 7788
}

GET /blocks/height/{signature}

Returns height (number) of block by its signature.

GET /blocks/first

Returns contents of first block (genesis block).

GET /blocks/last

Returns contents of last block.

Method Response:

{
  "version": 2,
  "timestamp": 1479313809528,
  "reference": "4MLXQDbARiJDEAoy5vZ8QYh1yNnDhdGhGWkDKna8J6QXb7agVpFEi16hHBGUxxnq8x4myG4w66DR4Ze8FM5dh8Gi",
  "nxtconsensus": {
    "basetarget": 464,
    "generationsignature": "7WUV2TufaRAyjiCPFdnAWbn2Q7Jk7nBmWbnnDXKDEeJv"
  },
  "transactions": [
    {
      "type": 2,
      "id": "64hxaxZvB9iD1cfRf1j8KPTXs4qE7SHaDWTZKoUvgfVZotaJUtSGa5Bxi86ufAfp5ifoNAGknBqS9CpxBKG9RNVR",
      "fee": 100000,
      "timestamp": 1479313757194,
      "signature": "64hxaxZvB9iD1cfRf1j8KPTXs4qE7SHaDWTZKoUvgfVZotaJUtSGa5Bxi86ufAfp5ifoNAGknBqS9CpxBKG9RNVR",
      "sender": "3NBVqYXrapgJP9atQccdBPAgJPwHDKkh6A8",
      "senderPublicKey": "CRxqEuxhdZBEHX42MU4FfyJxuHmbDBTaHMhM3Uki7pLw",
      "recipient": "3N8UPtqiy322NVr1fLP7SaK1AaCU7oPaVuy",
      "amount": 1000000000
    }
  ],
  "generator": "3N5GRqzDBhjVXnCn44baHcz2GoZy5qLxtTh",
  "signature": "4ZhZdLAvaGneLU4K4b2eTgRQvbBjEZrtwo1qAhM9ar3A3weGEutbfNKM4WJ9JZnV8BXenx8JRGVNwpfxf3prGaxd",
  "fee": 100000,
  "blocksize": 369
}

GET /blocks/at/{height}

Returns contents of block at height {height}.

GET /blocks/seq/{from}/{to}

Returns contents of blocks ranging from {from} to {to}.

GET /blocks/seqext/{from}/{to}

Returns contents of blocks with additional transactions info ranging from {from} to {to}.

GET /blocks/signature/{signature}

Returns contents of block by its signature {signature}.

GET /blocks/address/{address}/{from}/{to}

Returns all blocks generated (mined) by address {address}.

GET /blocks/child/{signature}

Returns block inherited from block with signature {signature}.

GET /blocks/headers/at/{height}

Returns block header at height {height}.

GET /blocks/headers/seq/{from}/{to}

Returns block headers ranging from {from} to {to}.

GET /blocks/headers/last

Returns header of last block in the blockchain.