getBlock
Retrieves block information by block ID or height.
Endpoint
GET /nxt?requestType=getBlock
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
block | string | No | Block ID (hex or numeric) |
height | int | No | Block height |
Note: Either block or height must be provided.
Request Example
# By block ID
curl "http://localhost:22024/nxt?requestType=getBlock&block=12345678901234567890"
# By height
curl "http://localhost:22024/nxt?requestType=getBlock&height=1000000"
Response
{
"block": "12345678901234567890",
"height": 1000000,
"generator": "1234567890",
"generatorPublicKey": "hexPublicKey",
"timestamp": 123456789,
"numberOfTransactions": 10,
"totalFeeFQT": "100000000",
"version": 1,
"baseTarget": "1234567890",
"cumulativeDifficulty": "123456789012345678901234567890",
"previousBlock": "98765432109876543210",
"nextBlock": "11111111111111111111",
"payloadHash": "hexPayloadHash",
"generationSignature": "hexGenerationSignature",
"previousBlockHash": "hexPreviousBlockHash",
"blockSignature": "hexBlockSignature",
"transactions": [],
"lastBlock": "blockId",
"requestProcessingTime": 5
}
Response Fields
| Field | Type | Description |
|---|---|---|
block | string | Block ID |
height | number | Block height |
generator | string | Generator account ID |
generatorPublicKey | string | Generator public key |
timestamp | number | Block timestamp |
numberOfTransactions | number | Number of transactions |
totalFeeFQT | string | Total fee in FQT |
version | number | Block version |
baseTarget | string | Base target |
cumulativeDifficulty | string | Cumulative difficulty |
previousBlock | string | Previous block ID |
nextBlock | string | Next block ID |
payloadHash | string | Payload hash |
generationSignature | string | Generation signature |
previousBlockHash | string | Previous block hash |
blockSignature | string | Block signature |
transactions | array | Transaction IDs or objects |
lastBlock | string | Last block ID |
Source
GetBlock.java, JSONData.block()
Tags
BLOCKS