TON DocsTON Docs
OnboardingNodesApplicationsAPIsContractsSmart contractsTolkTolk languageTVMTON Virtual MachineFoundationsBlockchain foundations

Get block

GET
/api/v2/getBlock

Get raw block data as a base64-encoded BoC.

Authorization

X-API-Key<token>

API key header of the form X-API-Key: <token>, where <token> is the API key. Requests without a key are limited to 1 RPS. Refer to the authentication guide for details.

In: header

Query Parameters

workchain*integer

The workchain to query. Use -1 for masterchain (validators, system contracts, config) or 0 for basechain (regular accounts and contracts). Most user transactions happen on workchain 0.

Formatint32
shard*string

The shard identifier. Masterchain always uses -9223372036854775808. For basechain, shards split and merge dynamically. Use the shards endpoint to discover current shard configuration.

seqno*integer

Block sequence number within the specified workchain and shard.

Formatint32
root_hash?string

The block's root hash. Together with file_hash, uniquely identifies a block.

file_hash?string

The block's file hash. Together with root_hash, uniquely identifies a block.

archival?boolean

Request data from archival nodes. Regular nodes keep at least the last 2 days of history. Set to true when querying old transactions or historical state. Archival requests may be slower.

Defaultfalse

Response Body

application/json

application/json

curl -X GET "https://example.com/api/v2/getBlock?workchain=0&shard=string&seqno=0"
{  "ok": true,  "result": {    "@type": "blocks.blockData",    "id": {      "@type": "ton.blockIdExt",      "workchain": 0,      "shard": "string",      "seqno": 0,      "root_hash": "string",      "file_hash": "string"    },    "data": "string"  },  "@extra": "string"}