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"
}'import axios from 'axios';
const data = JSON.stringify({
"jsonrpc": "2.0",
"method": "uptime",
"params": [],
"id": "getblock.io"
});
const config = {
method: 'post',
url: 'https://go.getblock.io/<ACCESS-TOKEN>/',
headers: {
'Content-Type': 'application/json'
},
data: data
};
axios(config)
.then(response => console.log(JSON.stringify(response.data)))
.catch(error => console.log(error));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?