version - Tezos
Example code for the /version REST method. Complete guide on how to use the /version REST method in GetBlock Web3 documentation
Returns the Octez node version, network protocol, and commit information. Use it to confirm the node build serving a GetBlock endpoint.
Endpoint
GET /versionExample
export TEZOS_REST=https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/
curl "${TEZOS_REST}version"const axios = require('axios');
const response = await axios.get('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/version', {
headers: { 'Content-Type': 'application/json' }
});
console.log(response.data);import requests
response = requests.get(
'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/version',
headers={'Content-Type': 'application/json'}
)
print(response.json())use reqwest::Client;
use serde_json::Value;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let response = client
.get("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/version")
.header("Content-Type", "application/json")
.send()
.await?
.json::<Value>()
.await?;
println!("Result: {}", response);
Ok(())
}Response
{
"version": {
"major": 21,
"minor": 0,
"additional_info": "release"
},
"network_version": {
"chain_name": "TEZOS_MAINNET",
"distributed_db_version": 2,
"p2p_version": 1
},
"commit_info": {
"commit_hash": "abcd1234",
"commit_date": "2025-01-15T00:00:00Z"
}
}Response Fields
version
object
Semantic node version
network_version
object
Chain name and protocol versions
commit_info
object
Build commit hash and date
Use Cases
Node Identification: Confirm the Octez build and network behind an endpoint
Compatibility: Check protocol/p2p versions before integrating
Error Handling
400 / Bad request
Bad request
A path or body parameter was invalid
404 / Not found
Not found
The block, contract, or resource does not exist
403 / RBAC: access denied
Access denied
The GetBlock access token is missing or incorrect
Was this helpful?