Blocks

Query blocks information.

get
Get Block from Shard

https://api.elrond.com/block/:shardId/:nonce
This endpoint allows one to query the hash and the content of a Block committed by a Shard.
Request
Response
Request
Path Parameters
shardId
required
number
The Shard ID. 0, 1, 2 etc. Use 4294967295 in order to query the Metachain.
nonce
required
number
The Block nonce (height).
Response
200: OK
Block details retrieved successfully.
{
"block": {
"nonce": 34547,
"hash": "ad6a...",
"transactions": [
{
"hash": "10e9...",
"fee": "10000000000000000",
"miniBlockHash": "37d5...",
"nonce": 18,
"round": 35968,
"value": "50000000000000000000000",
"receiver": "erd1...",
"sender": "erd1...",
"receiverShard": 0,
"senderShard": 0,
"gasPrice": 200000000000,
"gasLimit": 50000,
"gasUsed": 50000,
"data": "",
"signature": "0ac90...",
"timestamp": 1591271808,
"status": "Success",
"scResults": null
}
]
}
}

This endpoint is only is only defined by the Proxy. The Observer does not expose this endpoint.

get
Get Block by Nonce

http://localhost:8080/block/by-nonce/:nonce
This endpoint allows one to query a Block by its nonce (or height).
Request
Response
Request
Path Parameters
nonce
required
number
The Block nonce (height).
Query Parameters
withTxs
optional
boolean
Whether to include the transactions in the response.
Response
200: OK
Block retrieved successfully, with transactions included.
{
"data": {
"block": {
"nonce": 130,
"round": 131,
"hash": "c5f5...",
"epoch": 11,
"shardID": 1,
"numTxs": 15129,
"miniBlocks": [
{
"hash": "cf7c...",
"type": "TxBlock",
"sourceShardID": 0,
"destinationShardID": 1,
"transactions": [
// ...
{
"type": "normal",
"nonce": 3,
"value": "1",
"receiver": "erd1...",
"sender": "erd1...",
"gasPrice": 1000000000,
"gasLimit": 50000,
"data": "YXJiaXRyYXJ5IGRhdGEgaGVyZQ==",
"signature": "...",
"status": "executed"
}
// ...
]
},
{
"hash": "d467...",
"type": "TxBlock",
"sourceShardID": 1,
"destinationShardID": 0,
"transactions": [
// ...
{
"type": "normal",
"nonce": 411,
"value": "1",
"receiver": "erd1...",
"sender": "erd1...",
"gasPrice": 1000000000,
"gasLimit": 50000,
"data": "arbitrary data here",
"signature": "...",
"status": "partially-executed"
}
// ...
]
}
]
}
},
"error": "",
"code": "successful"
}

This endpoint is only available on Observers with FullHistory.Enabled = true. This endpoint is not available on the Proxy.

get
Get Block by Hash

http://localhost:8080/block/by-hash/:hash
This endpoint allows one to query a Block by its hash.
Request
Response
Request
Path Parameters
hash
required
string
The Block hash.
Query Parameters
withTxs
optional
boolean
Whether to include the transactions in the response.
Response
200: OK
Block retrieved successfully, with transactions included.
{
"data": {
"block": {
"nonce": 130,
"round": 131,
"hash": "c5f5...",
"epoch": 11,
"shardID": 1,
"numTxs": 15129,
"miniBlocks": [
{
"hash": "cf7c...",
"type": "TxBlock",
"sourceShardID": 0,
"destinationShardID": 1,
"transactions": [
// ...
{
"type": "normal",
"nonce": 3,
"value": "1",
"receiver": "erd1...",
"sender": "erd1...",
"gasPrice": 1000000000,
"gasLimit": 50000,
"data": "YXJiaXRyYXJ5IGRhdGEgaGVyZQ==",
"signature": "...",
"status": "executed"
}
// ...
]
},
{
"hash": "d467...",
"type": "TxBlock",
"sourceShardID": 1,
"destinationShardID": 0,
"transactions": [
// ...
{
"type": "normal",
"nonce": 411,
"value": "1",
"receiver": "erd1...",
"sender": "erd1...",
"gasPrice": 1000000000,
"gasLimit": 50000,
"data": "YXJiaXRyYXJ5IGRhdGEgaGVyZQ==",
"signature": "...",
"status": "partially-executed"
}
// ...
]
}
]
}
},
"error": "",
"code": "successful"
}

This endpoint is only available on Observers with FullHistory.Enabled = true. This endpoint is not available on the Proxy.