getBlockHeader
curl --request GET \
--url https://ton-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e/api/v2/getBlockHeaderimport requests
url = "https://ton-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e/api/v2/getBlockHeader"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://ton-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e/api/v2/getBlockHeader', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ton-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e/api/v2/getBlockHeader",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://ton-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e/api/v2/getBlockHeader"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://ton-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e/api/v2/getBlockHeader")
.asString();require 'uri'
require 'net/http'
url = URI("https://ton-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e/api/v2/getBlockHeader")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": {
"workchain": 123,
"shard": "<string>",
"seqno": 123,
"root_hash": "<string>",
"file_hash": "<string>"
},
"global_id": 123,
"version": 123,
"after_merge": true,
"before_split": true,
"after_split": true,
"want_merge": true,
"want_split": true,
"validator_list_hash_short": 123,
"catchain_seqno": 123,
"min_ref_mc_seqno": 123,
"is_key_block": true,
"prev_key_block_seqno": 123,
"start_lt": "<string>",
"end_lt": "<string>",
"gen_utime": 123,
"vert_seqno": 123
}TON node API
getBlockHeader | TON v2
The getBlockHeader method retrieves the header of a specific block in the TON blockchain. getBlockHeader on TON v2 via Chainstack.
GET
/
getBlockHeader
getBlockHeader
curl --request GET \
--url https://ton-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e/api/v2/getBlockHeaderimport requests
url = "https://ton-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e/api/v2/getBlockHeader"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://ton-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e/api/v2/getBlockHeader', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ton-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e/api/v2/getBlockHeader",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://ton-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e/api/v2/getBlockHeader"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://ton-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e/api/v2/getBlockHeader")
.asString();require 'uri'
require 'net/http'
url = URI("https://ton-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e/api/v2/getBlockHeader")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": {
"workchain": 123,
"shard": "<string>",
"seqno": 123,
"root_hash": "<string>",
"file_hash": "<string>"
},
"global_id": 123,
"version": 123,
"after_merge": true,
"before_split": true,
"after_split": true,
"want_merge": true,
"want_split": true,
"validator_list_hash_short": 123,
"catchain_seqno": 123,
"min_ref_mc_seqno": 123,
"is_key_block": true,
"prev_key_block_seqno": 123,
"start_lt": "<string>",
"end_lt": "<string>",
"gen_utime": 123,
"vert_seqno": 123
}The
getBlockHeader method retrieves the header of a specific block in the TON blockchain. This method provides detailed metadata about a block, including its identifiers, state flags, and timing information.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
TON billing: full or archive by block ageThis method is billed as archive (2 RUs) when the requested block is 128 or more seqno behind the tip, and full (1 RU) otherwise. See Request units — TON method scope.
Parameters
workchain(integer, required) — The ID of the workchain. Example:-1for the masterchain.shard(string, required) — The ID of the shard. Example:"-9223372036854775808"for the masterchain.seqno(integer, required) — The sequence number of the block. Example:39064874.
JSON-RPC example
Shell
curl -X POST \
'https://ton-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e/api/v2/jsonRPC' \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getBlockHeader",
"params": {
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 39064874
}
}'
Response
id(object) — The identifier of the block, containing:workchain(integer) — The workchain ID of the block.shard(string) — The shard ID of the block.seqno(integer) — The sequence number of the block.root_hash(string) — The root hash of the block.file_hash(string) — The file hash of the block.
global_id(integer) — The global ID of the block.version(integer) — The version of the block.after_merge(boolean) — Whether the block was created after a merge.before_split(boolean) — Whether the block was created before a split.after_split(boolean) — Whether the block was created after a split.want_merge(boolean) — Whether the block wants to merge.want_split(boolean) — Whether the block wants to split.validator_list_hash_short(integer) — The short hash of the validator list.catchain_seqno(integer) — The sequence number in the catchain.min_ref_mc_seqno(integer) — The minimum referenced masterchain sequence number.is_key_block(boolean) — Whether the block is a key block.prev_key_block_seqno(integer) — The sequence number of the previous key block.start_lt(string) — The start logical time of the block.end_lt(string) — The end logical time of the block.gen_utime(integer) — The generation time of the block.vert_seqno(integer) — The vertical sequence number of the block.
Use case
A possible use case for thegetBlockHeader method in TON is for blockchain explorers, validators, or any application that needs detailed metadata about specific blocks. This method can be used to:
- Display comprehensive block information in a block explorer.
- Analyze the structure and evolution of the blockchain, including shard splits and merges.
- Verify the integrity and sequence of blocks in a custom validation process.
- Track key blocks and their relationships in the blockchain.
Query Parameters
Response
200 - application/json
The header of the specified block
Last modified on November 6, 2026
Was this page helpful?