TON DocsTON Docs
OnboardingNodesApplicationsAPIsContractsSmart contractsTolkTolk languageTVMTON Virtual MachineFoundationsBlockchain foundations

Get blocks

GET
/api/v3/blocks

Return blocks that match the specified filters.

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

Workchain of the block.

shard?string

Shard ID of the block. Provide this parameter with workchain. Example: 8000000000000000.

seqno?integer

Sequence number of the block. Provide this parameter with workchain and shard.

root_hash?string

Root hash of the block.

file_hash?string

File hash of the block.

mc_seqno?integer

Masterchain block sequence number.

start_utime?integer

Query blocks with a generation timestamp at or after the specified timestamp.

end_utime?integer

Query blocks with a generation timestamp at or before the specified timestamp.

start_lt?integer

Query blocks where lt is at or above the specified value.

end_lt?integer

Query blocks where lt is at or below the specified value.

limit?integer

Limit the number of rows to return. Use with offset to batch requests.

offset?integer

Skip the first N rows. Use with limit to batch requests.

sort?string

Sort blocks by generation timestamp.

Response Body

application/json

application/json

curl -X GET "https://example.com/api/v3/blocks"
{
  "blocks": [
    {
      "after_merge": true,
      "after_split": true,
      "before_split": true,
      "created_by": "string",
      "end_lt": "0",
      "file_hash": "string",
      "flags": 0,
      "gen_catchain_seqno": 0,
      "gen_utime": "0",
      "global_id": 0,
      "key_block": true,
      "master_ref_seqno": 0,
      "masterchain_block_ref": {
        "seqno": 0,
        "shard": "0",
        "workchain": 0
      },
      "min_ref_mc_seqno": 0,
      "prev_blocks": [
        {
          "seqno": 0,
          "shard": "0",
          "workchain": 0
        }
      ],
      "prev_key_block_seqno": 0,
      "rand_seed": "string",
      "root_hash": "string",
      "seqno": 0,
      "shard": "0",
      "start_lt": "0",
      "tx_count": 0,
      "validator_list_hash_short": 0,
      "version": 0,
      "vert_seqno": 0,
      "vert_seqno_incr": true,
      "want_merge": true,
      "want_split": true,
      "workchain": 0
    }
  ]
}
{
  "code": 0,
  "error": "string"
}