POSTGet block

TON Mainnethttps://ton-mainnet.nodit.io/api/v2/getBlock
CU30

Get raw block data as a base64-encoded BoC.

Request Body
workchaininteger (int32)required

Workchain ID: -1 for masterchain, 0 for basechain. Most user transactions are on workchain 0.

shardstringrequired

Shard identifier. A signed 64-bit integer. Masterchain uses -9223372036854775808.

seqnointeger (int32)required

Block sequence number (seqno) within the specified workchain and shard.

root_hashstring

A 256-bit hash value. Accepts either hex format (64 characters) or base64 format (44 characters). Used for block hashes, transaction hashes, and cryptographic proofs.

file_hashstring

A 256-bit hash value. Accepts either hex format (64 characters) or base64 format (44 characters). Used for block hashes, transaction hashes, and cryptographic proofs.

archivalstring

Request data from archival nodes. Regular nodes keep at least the last 2 days of history, so set this to true when querying older blocks. Archival requests may be slower.

Responses
okbooleanrequired

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

@typestring (enum)required

TonLib type identifier for raw block data responses. Always blocks.blockData.

idobjectrequired

Extended identifier of the returned block.

@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.

datastringrequired

Full block BoC encoded as base64.

@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 POST "https://ton-mainnet.nodit.io/api/v2/getBlock" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "workchain": -1,
    "shard": "-9223372036854775808",
    "seqno": 107892772
  }'
Response
Example · 200
{
  "ok": true,
  "result": {
    "@type": "blocks.blockData",
    "id": {
      "@type": "ton.blockIdExt",
      "workchain": -1,
      "shard": "-9223372036854775808",
      "seqno": 107892772,
      "root_hash": "CZ71j2Ea/GLWj3Nc4qYFjHwU5WKnoR6a8OucP1StF/s=",
      "file_hash": "EgSbEso6FAMwFTf3B3yI1KeEu6cu2JNiwr/yWJWlKgc="
    },
    "data": "te6ccuICATEAAQAAI58AAAAkAMwA8gGIAmoDBgM4A1oDaQOCA5wEDAR8BMgFcAWwBqIG2gb6BzoILAicCUgJlQm4CdwKiAqoCsYK5AsACxwLOAtUC3ALjAuoC8QMagzkDQgNKA10DcAN4A4ADiAOQA5gDoAOoA7ADuAPihAIEGoQ7hE6EgYSJhI0ElIScBKOEqwSyhLo..."
  },
  "@extra": "1795684359:13:10.669"
}