Skip to main content

getBlock

Retrieves block information by block ID or height.

Endpoint

GET /nxt?requestType=getBlock

Parameters

NameTypeRequiredDescription
blockstringNoBlock ID (hex or numeric)
heightintNoBlock 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

FieldTypeDescription
blockstringBlock ID
heightnumberBlock height
generatorstringGenerator account ID
generatorPublicKeystringGenerator public key
timestampnumberBlock timestamp
numberOfTransactionsnumberNumber of transactions
totalFeeFQTstringTotal fee in FQT
versionnumberBlock version
baseTargetstringBase target
cumulativeDifficultystringCumulative difficulty
previousBlockstringPrevious block ID
nextBlockstringNext block ID
payloadHashstringPayload hash
generationSignaturestringGeneration signature
previousBlockHashstringPrevious block hash
blockSignaturestringBlock signature
transactionsarrayTransaction IDs or objects
lastBlockstringLast block ID

Source

GetBlock.java, JSONData.block()

Tags

BLOCKS