Get Block Header
curl --request GET \
--url https://toncenter.com/api/v2/getBlockHeaderimport requests
url = "https://toncenter.com/api/v2/getBlockHeader"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://toncenter.com/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://toncenter.com/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://toncenter.com/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://toncenter.com/api/v2/getBlockHeader")
.asString();require 'uri'
require 'net/http'
url = URI("https://toncenter.com/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{
"ok": true,
"result": {
"@type": "blocks.header",
"id": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 1,
"root_hash": "8GYhhrigd8CwZGrRT59iulLDcgiTYuvOAzFJxugc0Ts=",
"file_hash": "V+XzykEwun4yePZhAEPZk77RbMfMOgS/S4GiJkSKY6s="
},
"global_id": -239,
"version": 0,
"after_merge": false,
"after_split": false,
"before_split": false,
"want_merge": false,
"want_split": false,
"validator_list_hash_short": -1447544682,
"catchain_seqno": 0,
"min_ref_mc_seqno": 1,
"is_key_block": false,
"prev_key_block_seqno": 0,
"start_lt": "1000000",
"end_lt": "1000012",
"gen_utime": 1573822385,
"prev_blocks": [
{
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 0,
"root_hash": "F6OpKZKqvqeFp6CQmFomXNMfMj2EnaUSOXN+Mh+wVWk=",
"file_hash": "XplPz01CXAps5qeSWUtxcyBfdAo5zVb1N979KLSKD24="
}
],
"@extra": "1755814930.1088252:0:0.1467032130574265"
}
}Blocks
Get Block Header
Get metadata of a given block.
GET
/
getBlockHeader
Get Block Header
curl --request GET \
--url https://toncenter.com/api/v2/getBlockHeaderimport requests
url = "https://toncenter.com/api/v2/getBlockHeader"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://toncenter.com/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://toncenter.com/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://toncenter.com/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://toncenter.com/api/v2/getBlockHeader")
.asString();require 'uri'
require 'net/http'
url = URI("https://toncenter.com/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{
"ok": true,
"result": {
"@type": "blocks.header",
"id": {
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 1,
"root_hash": "8GYhhrigd8CwZGrRT59iulLDcgiTYuvOAzFJxugc0Ts=",
"file_hash": "V+XzykEwun4yePZhAEPZk77RbMfMOgS/S4GiJkSKY6s="
},
"global_id": -239,
"version": 0,
"after_merge": false,
"after_split": false,
"before_split": false,
"want_merge": false,
"want_split": false,
"validator_list_hash_short": -1447544682,
"catchain_seqno": 0,
"min_ref_mc_seqno": 1,
"is_key_block": false,
"prev_key_block_seqno": 0,
"start_lt": "1000000",
"end_lt": "1000012",
"gen_utime": 1573822385,
"prev_blocks": [
{
"@type": "ton.blockIdExt",
"workchain": -1,
"shard": "-9223372036854775808",
"seqno": 0,
"root_hash": "F6OpKZKqvqeFp6CQmFomXNMfMj2EnaUSOXN+Mh+wVWk=",
"file_hash": "XplPz01CXAps5qeSWUtxcyBfdAo5zVb1N979KLSKD24="
}
],
"@extra": "1755814930.1088252:0:0.1467032130574265"
}
}⌘I

