githubEdit

uptime - Bitcoin

Example code for the uptime JSON-RPC method. Complete guide on how to use uptime JSON-RPC in GetBlock Web3 documentation.

This method returns the total uptime of the server in seconds.

Parameters

  • None

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
   "method": "uptime",
    "params": [],
    "id": "getblock.io"
}'

Response

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": 1234567
}

Response Parameters

Field
Type
Description

result

number

The server uptime in seconds.

Use Case

The uptime method is essential for:

  • Monitoring node stability

  • Building health check systems

  • SLA tracking and reporting

  • Node reliability metrics

  • Operational dashboards

  • Detecting node restarts

Error Handling

Status Code
Error Message
Cause

403

Forbidden

Missing or invalid ACCESS-TOKEN.

Integration With Web3

The uptime method helps developers:

  • Monitor node availability

  • Track service reliability

  • Build uptime monitoring tools

  • Create operational alerts

  • Support SLA compliance

Last updated

Was this helpful?