GETLookup block

TON Mainnethttps://ton-mainnet.nodit.io/api/v2/lookupBlock
CU20

Finds a block by position or time. Specify workchain and shard, then provide exactly one of: seqno (exact block number), lt (find block containing this logical time), or unixtime (find block closest to this timestamp). Returns the full block ID including hashes needed for verification.

Query Parameters
workchaininteger (int32)required

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.

shardstringrequired

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

seqnointeger (int32)

Query state at a specific block height. If omitted, returns the current state. Use this to look up historical data at a specific point in time.

ltstring

Logical time of a block

unixtimeinteger (int32)

UNIX timestamp of a block

Responses
okbooleanrequired

Returns true if the request succeeded; otherwise false. See the error field for details.

@typestring (enum)required

TonLib type identifier for full block identifiers. Refer to the TonLib type reference for a full list.

workchainintegerrequired

Workchain ID: -1 for masterchain, 0 for basechain.

shardstringrequired

Shard identifier as a signed 64-bit integer string. Masterchain uses -9223372036854775808.

seqnointegerrequired

Block sequence number within its workchain and shard. For the masterchain (workchain -1), this equals the global block height. For basechain shards (workchain 0), this is the sequence number local to that specific shard, not a global height.

root_hashstringrequired

Root hash of the block. Together with file_hash, uniquely identifies a block.

file_hashstringrequired

Hash of the serialized block file. Together with root_hash, uniquely identifies a block.

@extrastring

Optional request ID that can be passed in the request and received back in the response. Useful for matching async responses.

X-API-KEY
Request
cURL
curl -X GET "https://ton-mainnet.nodit.io/api/v2/lookupBlock?workchain=-1&shard=-9223372036854775808&seqno=107892772" \
  -H "X-API-KEY: {YOUR_API_KEY}"
Response
Example · 200
{
  "ok": true,
  "result": {
    "@type": "ton.blockIdExt",
    "workchain": -1,
    "shard": "-9223372036854775808",
    "seqno": 107892772,
    "root_hash": "CZ71j2Ea/GLWj3Nc4qYFjHwU5WKnoR6a8OucP1StF/s=",
    "file_hash": "EgSbEso6FAMwFTf3B3yI1KeEu6cu2JNiwr/yWJWlKgc="
  },
  "@extra": "1795684348:_:0.004:c"
}