Blocks
Get the most recent block number
Returns number of the most recent block.
Sample request
https://api.main.atgraphite.com/api
?module=block
&action=getlatestblockno
&apikey=YourApiKeyToken
Sample response
{
"status": "1",
"message": "OK",
"result": "0x26a8c"
}
Get block header by block number
Returns block header (including hashes of the transactions) by block number.
Sample request
https://api.main.atgraphite.com/api
?module=block
&action=getblockbyno
&blockno=4000
&apikey=YourApiKeyToken
Request query parameters
blockno*
a nonnegative integer that represents the block number
Sample response
{
"message": "OK",
"status": "1",
"result": {
"confirmations": "339013",
"decodedExtraData": {
"awn": 28000,
"signature": "0x77effa4dd280642e45f3eccc3a70318b530241e06d0e5c51283b8385638c3dae6358465dd700dbfb0f7382d6343c60b23e9f4b3fbf9b2700a5d178061c38cd5500",
"validators": [
"0xcedfbaf9728a447bad47a0b1b9637dd87b569967",
"0x876c2a819e5ff874f3bf7ba6bb702b3d669bd8c4",
"0xc4ec71b541e0830c090a39d7534d78e36e797073",
"0xa07b131a8f4feca511dbf5cb75bc42fbb606c840",
"0x2e51ff20551537d3cdadf0db406d66a0ecba4eda",
"0x8ae6be0dedb5e4f7531c08d1642f7c058be3fbd1",
"0xddca5562cf3914e6815c87746109f478a46a6373"
],
"vanity": "0xd883010101846765746888676f312e31392e39856c696e757800000000000000"
},
"difficulty": "0x01",
"epoch": true,
"extraData": "0xd883010101846765746888676f312e31392e39856c696e75780000000000000000000000000000006d60cedfbaf9728a447bad47a0b1b9637dd87b569967876c2a819e5ff874f3bf7ba6bb702b3d669bd8c4c4ec71b541e0830c090a39d7534d78e36e797073a07b131a8f4feca511dbf5cb75bc42fbb606c8402e51ff20551537d3cdadf0db406d66a0ecba4eda8ae6be0dedb5e4f7531c08d1642f7c058be3fbd1ddca5562cf3914e6815c87746109f478a46a637377effa4dd280642e45f3eccc3a70318b530241e06d0e5c51283b8385638c3dae6358465dd700dbfb0f7382d6343c60b23e9f4b3fbf9b2700a5d178061c38cd5500",
"gasLimit": "0x1c9c380",
"gasUsed": "0xa410",
"gasUsedPercentage": "0.140000",
"hash": "0x5b3c968bbb6f09f1742b38c0f608f5e509af0dc452c992d1fefd8071468a8542",
"internalTransactionCount": "0",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0xc4ec71b541e0830c090a39d7534d78e36e797073",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0200000000000000",
"number": "0xfa0",
"parentHash": "0x81f0c6eeff8bb15d93faa313fb5400709e4c1e88b15bec4621586750200ed90a",
"receiptsRoot": "0xd95b673818fa493deec414e01e610d97ee287c9421c8eff4102b1647c1a184e4",
"reward": "756000000000000",
"size": "0x3de",
"slashingVote": null,
"stateRoot": "0x7c6dd81c890afdbfe84689062e9ae11452cd4b1efd899b70725678197e1f892c",
"timestamp": "0x6740df66",
"totalDifficulty": "0x0fa1",
"transactionCount": "2",
"transactionFees": "756000000000000",
"transactionsRoot": "0x742017cee12a062cbd0b42194cbfd9e096d9417e3e42e361306218cb7774d1ab"
}
}
Note: If the block is an epoch block (the
epoch
flag is set totrue
), then theextraData
field contains, in addition to other fields, a list of validators. Otherwise, the list is always empty.
Get block header by block hash
Returns block header (including hashes of the transactions) by block hash.
Sample request
https://api.main.atgraphite.com/api
?module=block
&action=getblockbyhash
&blockhash=0x5b3c968bbb6f09f1742b38c0f608f5e509af0dc452c992d1fefd8071468a8542
&apikey=YourApiKeyToken
Request query parameters
blockhash*
hash of contents of the block
Sample response
{
"message": "OK",
"status": "1",
"result": {
"confirmations": "339013",
"decodedExtraData": {
"awn": 28000,
"signature": "0x77effa4dd280642e45f3eccc3a70318b530241e06d0e5c51283b8385638c3dae6358465dd700dbfb0f7382d6343c60b23e9f4b3fbf9b2700a5d178061c38cd5500",
"validators": [
"0xcedfbaf9728a447bad47a0b1b9637dd87b569967",
"0x876c2a819e5ff874f3bf7ba6bb702b3d669bd8c4",
"0xc4ec71b541e0830c090a39d7534d78e36e797073",
"0xa07b131a8f4feca511dbf5cb75bc42fbb606c840",
"0x2e51ff20551537d3cdadf0db406d66a0ecba4eda",
"0x8ae6be0dedb5e4f7531c08d1642f7c058be3fbd1",
"0xddca5562cf3914e6815c87746109f478a46a6373"
],
"vanity": "0xd883010101846765746888676f312e31392e39856c696e757800000000000000"
},
"difficulty": "0x01",
"epoch": true,
"extraData": "0xd883010101846765746888676f312e31392e39856c696e75780000000000000000000000000000006d60cedfbaf9728a447bad47a0b1b9637dd87b569967876c2a819e5ff874f3bf7ba6bb702b3d669bd8c4c4ec71b541e0830c090a39d7534d78e36e797073a07b131a8f4feca511dbf5cb75bc42fbb606c8402e51ff20551537d3cdadf0db406d66a0ecba4eda8ae6be0dedb5e4f7531c08d1642f7c058be3fbd1ddca5562cf3914e6815c87746109f478a46a637377effa4dd280642e45f3eccc3a70318b530241e06d0e5c51283b8385638c3dae6358465dd700dbfb0f7382d6343c60b23e9f4b3fbf9b2700a5d178061c38cd5500",
"gasLimit": "0x1c9c380",
"gasUsed": "0xa410",
"gasUsedPercentage": "0.140000",
"hash": "0x5b3c968bbb6f09f1742b38c0f608f5e509af0dc452c992d1fefd8071468a8542",
"internalTransactionCount": "0",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0xc4ec71b541e0830c090a39d7534d78e36e797073",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0200000000000000",
"number": "0xfa0",
"parentHash": "0x81f0c6eeff8bb15d93faa313fb5400709e4c1e88b15bec4621586750200ed90a",
"receiptsRoot": "0xd95b673818fa493deec414e01e610d97ee287c9421c8eff4102b1647c1a184e4",
"reward": "756000000000000",
"size": "0x3de",
"slashingVote": null,
"stateRoot": "0x7c6dd81c890afdbfe84689062e9ae11452cd4b1efd899b70725678197e1f892c",
"timestamp": "0x6740df66",
"totalDifficulty": "0x0fa1",
"transactionCount": "2",
"transactionFees": "756000000000000",
"transactionsRoot": "0x742017cee12a062cbd0b42194cbfd9e096d9417e3e42e361306218cb7774d1ab"
}
}
Get an array of block headers by block number range
Returns an array of block headers by block number range (maximum of 20 blocks per call).
Sample request
https://api.main.atgraphite.com/api
?module=block
&action=getblockrange
&startblock=4000
&endblock=4000
&sort=asc
&apikey=YourApiKeyToken
Request query parameters
startblock*
the integer block number that represents the first number of range
endblock*
the integer block number that represents the last number of range
sort*
the sorting preference, use asc
to sort by ascending and desc
to sort by descending
Sample response
{
"status": "1",
"message": "OK-Missing",
"result": [
{
"confirmations": "339013",
"decodedExtraData": {
"awn": 28000,
"signature": "0x77effa4dd280642e45f3eccc3a70318b530241e06d0e5c51283b8385638c3dae6358465dd700dbfb0f7382d6343c60b23e9f4b3fbf9b2700a5d178061c38cd5500",
"validators": [
"0xcedfbaf9728a447bad47a0b1b9637dd87b569967",
"0x876c2a819e5ff874f3bf7ba6bb702b3d669bd8c4",
"0xc4ec71b541e0830c090a39d7534d78e36e797073",
"0xa07b131a8f4feca511dbf5cb75bc42fbb606c840",
"0x2e51ff20551537d3cdadf0db406d66a0ecba4eda",
"0x8ae6be0dedb5e4f7531c08d1642f7c058be3fbd1",
"0xddca5562cf3914e6815c87746109f478a46a6373"
],
"vanity": "0xd883010101846765746888676f312e31392e39856c696e757800000000000000"
},
"difficulty": "0x01",
"epoch": true,
"extraData": "0xd883010101846765746888676f312e31392e39856c696e75780000000000000000000000000000006d60cedfbaf9728a447bad47a0b1b9637dd87b569967876c2a819e5ff874f3bf7ba6bb702b3d669bd8c4c4ec71b541e0830c090a39d7534d78e36e797073a07b131a8f4feca511dbf5cb75bc42fbb606c8402e51ff20551537d3cdadf0db406d66a0ecba4eda8ae6be0dedb5e4f7531c08d1642f7c058be3fbd1ddca5562cf3914e6815c87746109f478a46a637377effa4dd280642e45f3eccc3a70318b530241e06d0e5c51283b8385638c3dae6358465dd700dbfb0f7382d6343c60b23e9f4b3fbf9b2700a5d178061c38cd5500",
"gasLimit": "0x1c9c380",
"gasUsed": "0xa410",
"gasUsedPercentage": "0.140000",
"hash": "0x5b3c968bbb6f09f1742b38c0f608f5e509af0dc452c992d1fefd8071468a8542",
"internalTransactionCount": "0",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0xc4ec71b541e0830c090a39d7534d78e36e797073",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0200000000000000",
"number": "0xfa0",
"parentHash": "0x81f0c6eeff8bb15d93faa313fb5400709e4c1e88b15bec4621586750200ed90a",
"receiptsRoot": "0xd95b673818fa493deec414e01e610d97ee287c9421c8eff4102b1647c1a184e4",
"reward": "756000000000000",
"size": "0x3de",
"slashingVote": null,
"stateRoot": "0x7c6dd81c890afdbfe84689062e9ae11452cd4b1efd899b70725678197e1f892c",
"timestamp": "0x6740df66",
"totalDifficulty": "0x0fa1",
"transactionCount": "2",
"transactionFees": "756000000000000",
"transactionsRoot": "0x742017cee12a062cbd0b42194cbfd9e096d9417e3e42e361306218cb7774d1ab"
}
]
}
Get an array of block headers by number list
Returns an array of block headers by number list (maximum of 20 blocks per call).
Sample request
https://api.main.atgraphite.com/api
?module=block
&action=getblocklist
&blockno=4000,4001
&sort=asc
&apikey=YourApiKeyToken
Request query parameters
blockno*
the numbers separated by ,
sort
the sorting preference, use asc
to sort by ascending and desc
to sort by descending, desc
is default
Sample response
{
"message": "OK-Missing/Invalid API Key, free rate limit applied",
"result": [
{
"confirmations": "339105",
"decodedExtraData": {
"awn": 28007,
"signature": "0x7329de1e4808a90ac206f533f4d25d053b4620d3cddcf08551c9b795078bb9a3258b15895fe88193b7f5b249b870c6b6fe2c368dcf3c430969b0fcc1b676b39a00",
"vanity": "0xd883010101846765746888676f312e31392e39856c696e757800000000000000"
},
"difficulty": "0x01",
"epoch": false,
"extraData": "0xd883010101846765746888676f312e31392e39856c696e75780000000000000000000000000000006d677329de1e4808a90ac206f533f4d25d053b4620d3cddcf08551c9b795078bb9a3258b15895fe88193b7f5b249b870c6b6fe2c368dcf3c430969b0fcc1b676b39a00",
"gasLimit": "0x1c9c380",
"gasUsed": "0x14820",
"gasUsedPercentage": "0.280000",
"hash": "0x4bb12210633e11af577bb235e55a63bf475a39eb5fec6d6abe4c2f89e7e0b308",
"internalTransactionCount": "0",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x876c2a819e5ff874f3bf7ba6bb702b3d669bd8c4",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0400000000000000",
"number": "0xfa1",
"parentHash": "0x5b3c968bbb6f09f1742b38c0f608f5e509af0dc452c992d1fefd8071468a8542",
"receiptsRoot": "0x04deb4be6955e1a300123be48007597f67e4229f8ce70f4f10388de6fd3fa267",
"reward": "1512000000000000",
"size": "0x436",
"slashingVote": null,
"stateRoot": "0x1a81b1809ed73c59e0680d9111f8a09e9c31f0b421450d109a28d29312b3f28e",
"timestamp": "0x6740df69",
"totalDifficulty": "0x0fa2",
"transactionCount": "4",
"transactionFees": "1512000000000000",
"transactionsRoot": "0xc8e65fa1d4919a558961bea81162ddfc730b386582f06e350fa2f0427cd7300a"
},
{
"confirmations": "339106",
"decodedExtraData": {
"awn": 28000,
"signature": "0x77effa4dd280642e45f3eccc3a70318b530241e06d0e5c51283b8385638c3dae6358465dd700dbfb0f7382d6343c60b23e9f4b3fbf9b2700a5d178061c38cd5500",
"validators": [
"0xcedfbaf9728a447bad47a0b1b9637dd87b569967",
"0x876c2a819e5ff874f3bf7ba6bb702b3d669bd8c4",
"0xc4ec71b541e0830c090a39d7534d78e36e797073",
"0xa07b131a8f4feca511dbf5cb75bc42fbb606c840",
"0x2e51ff20551537d3cdadf0db406d66a0ecba4eda",
"0x8ae6be0dedb5e4f7531c08d1642f7c058be3fbd1",
"0xddca5562cf3914e6815c87746109f478a46a6373"
],
"vanity": "0xd883010101846765746888676f312e31392e39856c696e757800000000000000"
},
"difficulty": "0x01",
"epoch": true,
"extraData": "0xd883010101846765746888676f312e31392e39856c696e75780000000000000000000000000000006d60cedfbaf9728a447bad47a0b1b9637dd87b569967876c2a819e5ff874f3bf7ba6bb702b3d669bd8c4c4ec71b541e0830c090a39d7534d78e36e797073a07b131a8f4feca511dbf5cb75bc42fbb606c8402e51ff20551537d3cdadf0db406d66a0ecba4eda8ae6be0dedb5e4f7531c08d1642f7c058be3fbd1ddca5562cf3914e6815c87746109f478a46a637377effa4dd280642e45f3eccc3a70318b530241e06d0e5c51283b8385638c3dae6358465dd700dbfb0f7382d6343c60b23e9f4b3fbf9b2700a5d178061c38cd5500",
"gasLimit": "0x1c9c380",
"gasUsed": "0xa410",
"gasUsedPercentage": "0.140000",
"hash": "0x5b3c968bbb6f09f1742b38c0f608f5e509af0dc452c992d1fefd8071468a8542",
"internalTransactionCount": "0",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0xc4ec71b541e0830c090a39d7534d78e36e797073",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0200000000000000",
"number": "0xfa0",
"parentHash": "0x81f0c6eeff8bb15d93faa313fb5400709e4c1e88b15bec4621586750200ed90a",
"receiptsRoot": "0xd95b673818fa493deec414e01e610d97ee287c9421c8eff4102b1647c1a184e4",
"reward": "756000000000000",
"size": "0x3de",
"slashingVote": null,
"stateRoot": "0x7c6dd81c890afdbfe84689062e9ae11452cd4b1efd899b70725678197e1f892c",
"timestamp": "0x6740df66",
"totalDifficulty": "0x0fa1",
"transactionCount": "2",
"transactionFees": "756000000000000",
"transactionsRoot": "0x742017cee12a062cbd0b42194cbfd9e096d9417e3e42e361306218cb7774d1ab"
}
],
"status": "1"
}
Get block number by block timestamp
Returns block number by the closest timestamp.
Sample request
https://api.main.atgraphite.com/api
?module=block
&action=getblocknobytimestamp
×tamp=1658293068
&closest=after
&apikey=YourApiKeyToken
Request query parameters
timestamp*
a nonnegative integer that represents the block timestamp (Unix timestamp in seconds)
closest*
direction to find the closest block number to given timestamp. Available values: before
and after
Sample response
{
"status": "1",
"message": "OK",
"result": "0x1"
}
Get block account balances changes by block number
Returns all account balances changes in a block by block number.
Sample request
https://api.main.atgraphite.com/api
?module=block
&action=getblockbalancechanges
&blockno=10000
&apikey=YourApiKeyToken
Request query parameters
blockno*
a nonnegative integer that represents the block number
Sample response
{
"status": "1",
"message": "OK",
"result": [
{
"address": "0x0000000000000000000000000000000000000000",
"balance": "69706756410585043245",
"balanceChange": "6725754630960973",
"prevChangeBlockNumber": "9999",
"prevChangeTimeStamp": "1702143759"
},
{
"address": "0x0aea70d72d5e2218cf9af28410ed388ae03b799b",
"balance": "1337130978337379414956755",
"balanceChange": "-7103754630960973",
"prevChangeBlockNumber": "9999",
"prevChangeTimeStamp": "1702143759"
},
{
"address": "0xa40e515e604b41a4a3f6f4baa321fd87f6ff6f66",
"balance": "1093554000000000000",
"balanceChange": "378000000000000",
"prevChangeBlockNumber": "9998",
"prevChangeTimeStamp": "1702143747"
}
]
}
Last updated