network/status - Cardano

This endpoint returns the current status of the network, including the current and genesis block identifiers, the latest block timestamp, and connected peers.

Parameters

The request body is a JSON object with the following fields.

FieldTypeRequiredDescription
network_identifierobjectYesThe network to query, with blockchain and network
metadataobjectNoOptional metadata object

Request

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/network/status' \
--header 'Content-Type: application/json' \
--data-raw '{
    "network_identifier": {
        "blockchain": "cardano",
        "network": "mainnet"
    },
    "metadata": {}
}'
javascriptconst response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/network/status',
    {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({"network_identifier": {"blockchain": "cardano", "network": "mainnet"}, "metadata": {}})
    }
);
console.log(await response.json());
pythonimport requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/network/status',
    headers={'Content-Type': 'application/json'},
    json={"network_identifier": {"blockchain": "cardano", "network": "mainnet"}, "metadata": {}}
)

print(response.json())

Response

json{
    "current_block_identifier": {
        "index": 10453789,
        "hash": "6e9e89632bc5c72030d3a486647e889c48d63e4da0643191b13566ad816d2d57"
    },
    "current_block_timestamp": 1617180599000,
    "genesis_block_identifier": {
        "index": 0,
        "hash": "5f20df933584822601f9e3f8c024eb5eb252fe8cefb24d1317dc3d432e940ebb"
    },
    "peers": [
        {
            "peer_id": "relay.example:3001"
        }
    ]
}

Response Parameters

FieldTypeDescription
current_block_identifierobjectIndex and hash of the current tip block
current_block_timestampintegerTimestamp of the tip block in milliseconds
genesis_block_identifierobjectIndex and hash of the genesis block
peersarrayPeers the node is connected to

Use Cases

  • Tip Tracking: Read the current block index and hash
  • Sync Checks: Compare the tip against a local index
  • Timestamps: Read the tip block time for display
  • Health Monitoring: Inspect connected peers and chain progress

Error Handling

Error CodeMessageDescription
1Invalid requestThe request body is malformed or missing required fields
4Block not foundThe requested block does not exist on this node
5Internal errorThe node failed to answer the request