MENU navbar-image
php javascript python bash

Introduction

This is an open source application to monitor the health status of a masternode server.

Main requirement was to keep everything 100% anonymous for the users to protect their privacy.

This application has two parts:

The server offers an API key (like 3a833079-9f2e-4336-a053-7a28808165a4) - that's all you need for the usage.

This API The following endpoints are used for setup an API key and to fetch the information for it. You need to use the server script installed as cron on your server - you'll find it on https://github.com/defichain-api/masternode-health-server.

This documentation aims to provide all the information you need to work with this API.

Base URL

https://api.defichain-masternode-health.com

Authenticating requests

This API is authenticated by sending a x-api-key header with the value "YOUR_API_KEY".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

For "how to create this credential" take a look at the Setup section of this documentation.

Setup

Ping

Test the availability of this API.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.defichain-masternode-health.com/ping',
    [
        'headers' => [
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.defichain-masternode-health.com/ping"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.defichain-masternode-health.com/ping'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()
curl --request GET \
    --get "https://api.defichain-masternode-health.com/ping" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
 

{
    "message": "pong",
    "server_time": "2021-09-23T07:55:30.211384Z"
}
 

Request   

GET ping

Get an API Key

create a new API key.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.defichain-masternode-health.com/setup/api_key',
    [
        'headers' => [
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.defichain-masternode-health.com/setup/api_key"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.defichain-masternode-health.com/setup/api_key'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()
curl --request GET \
    --get "https://api.defichain-masternode-health.com/setup/api_key" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200, Success):


{
    "message": "API key generated",
    "api_key": "c7654335-3e00-41ee-a879-3011c5399d89"
}
 

Request   

GET setup/api_key

API Health Check

To check the availability of the API, you can setup a ping to this endpoint. It throws a HTTP 500 if a system is not running well - otherwise it's a HTTP 200.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.defichain-masternode-health.com/health',
    [
        'headers' => [
            'Accept' => 'application/json',
        ],
        'query' => [
            'period'=> '30',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.defichain-masternode-health.com/health"
);

const params = {
    "period": "30",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.defichain-masternode-health.com/health'
params = {
  'period': '30',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
curl --request GET \
    --get "https://api.defichain-masternode-health.com/health?period=30" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200, Success):


{
    "redis_connection": true,
    "database_connection": true,
    "new_data_in_period": true,
    "server_time": "2021-09-06T15:46:24.731762Z"
}
 

Example response (500, Error):


{
    "redis_connection": false,
    "database_connection": true,
    "new_data_in_period": true,
    "server_time": "2021-09-06T15:46:24.731762Z"
}
 

Request   

GET health

Query Parameters

period  integer optional  

Check the new data in the given period in minutes (min: 10). Default: 30

Response

Response Fields

redis_connection  boolean  

Check if the redis system is available.

database_connection  boolean  

Check if the database is available.

new_data_in_period  boolean  

Check if new data was pushed to the API in the last 30min.

server_time  string  

Current server time

Pull Information

Fullnode Info

requires authentication

Pull the latest fullnode info posted to the health API by your server.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.defichain-masternode-health.com/v1/node-info',
    [
        'headers' => [
            'x-api-key' => 'YOUR_API_KEY',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.defichain-masternode-health.com/v1/node-info"
);

const headers = {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.defichain-masternode-health.com/v1/node-info'
headers = {
  'x-api-key': 'YOUR_API_KEY',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()
curl --request GET \
    --get "https://api.defichain-masternode-health.com/v1/node-info" \
    --header "x-api-key: YOUR_API_KEY" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200, Success):


{
    "data": [
        {
            "type": "config_checksum",
            "value": "a3cca2b2aa1e3b5b3b5aad99a8529074"
        },
        {
            "type": "defid_running",
            "value": true
        },
        {
            "type": "operator_status",
            "value": [
                {
                    "id": "8cb09568143d7bae6822a7a78f91cb907c23fd12dcf986d4d2c8de89457edf87",
                    "online": true
                },
                {
                    "id": "2ceb7c9c3bea0bd0e5e4199eca5d0b797d79a0077a9108951faecf715e1e1a57",
                    "online": true
                }
            ]
        },
        {
            "type": "node_uptime",
            "value": 261124
        },
        {
            "type": "local_hash",
            "value": "0d82efc6638c91279e5f493053075226619080515d2f9b583f8cfc42a4f08885"
        },
        {
            "type": "block_height_local",
            "value": 1132261
        },
        {
            "type": "connection_count",
            "value": 91
        },
        {
            "type": "logsize",
            "value": 13.21
        },
        {
            "type": "node_version",
            "value": "1.6.3"
        }
    ],
    "latest_update": "2021-08-31T14:14:12.000000Z"
}
 

Request   

GET v1/node-info

Response

Response Fields

block_height_local  integer  

Local Block height

operator_status  object  

Lists the masternode id and it's online status

node_uptime  integer  

Uptime of the node in seconds

node_version  string  

Current version of the node

config_checksum  string  

MD5 hash of the defi.conf file

local_hash  string  

block hash of the current block

connection_count  integer  

Number of current connections to the node

logsize    

numeric Size of the debug.log in MB

defid_running  boolean  

Flag if the DEFID is running. Example: true

Server Stats

requires authentication

Pull the latest server stats posted to the health API by your server. All data (except load_avg) are in GB.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.defichain-masternode-health.com/v1/server-stats',
    [
        'headers' => [
            'x-api-key' => 'YOUR_API_KEY',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.defichain-masternode-health.com/v1/server-stats"
);

const headers = {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.defichain-masternode-health.com/v1/server-stats'
headers = {
  'x-api-key': 'YOUR_API_KEY',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()
curl --request GET \
    --get "https://api.defichain-masternode-health.com/v1/server-stats" \
    --header "x-api-key: YOUR_API_KEY" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200, Success):


{
    "data": [
        {
            "type": "hdd_total",
            "value": 933.22
        },
        {
            "type": "server_script_version",
            "value": "1.0.1"
        },
        {
            "type": "num_cores",
            "value": 8
        },
        {
            "type": "hdd_used",
            "value": 53.22
        },
        {
            "type": "ram_total",
            "value": 125.22
        },
        {
            "type": "load_avg",
            "value": 0.22
        },
        {
            "type": "ram_used",
            "value": 2.22
        }
    ],
    "latest_update": "2021-08-31T14:14:15.000000Z"
}
 

Request   

GET v1/server-stats

Response

Response Fields

ram_total  number  

Available RAM in GB

ram_used  number  

Used RAM in GB

hdd_used  number  

Available hdd memory in GB

hdd_total  number  

Used hdd memory in GB

load_avg  number  

Current load avg over the last 5min

num_cores  integer  

Number of cpu cores

server_script_version  string  

Current Version of the server script. Example: 1.0.1

Data Status

requires authentication

You can check the latest state of your stored data. For more details check the output.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.defichain-masternode-health.com/v1/data-status',
    [
        'headers' => [
            'x-api-key' => 'YOUR_API_KEY',
            'Accept' => 'application/json',
        ],
        'query' => [
            'period'=> '10',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.defichain-masternode-health.com/v1/data-status"
);

const params = {
    "period": "10",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.defichain-masternode-health.com/v1/data-status'
params = {
  'period': '10',
}
headers = {
  'x-api-key': 'YOUR_API_KEY',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
curl --request GET \
    --get "https://api.defichain-masternode-health.com/v1/data-status?period=10" \
    --header "x-api-key: YOUR_API_KEY" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200, Success):


{
    "new_data_in_period": 6,
    "latest_data_sent_at": "2021-09-06T22:16:40.000000Z",
    "latest_data_diff_minutes": 4,
    "possible_problem_detected": false,
    "server_time": "2021-09-06T22:20:54.430225Z"
}
 

Example response (200, Error):


{"new_data_in_period":null,"latest_data_sent_at":"2021-09-06T07:20:54
.430225Z",
"latest_data_diff_minutes":932,"possible_problem_detected":true,"server_time":"2021-09-06T22:20:54.430225Z"}
 

Request   

GET v1/data-status

Query Parameters

period  integer optional  

Check the data in the given period in minutes (min: 5). Default: 10

Response

Response Fields

new_data_in_period  integer  

Count of new data in the given period

latest_data_sent_at  string  

Timestamp of the latest data.

latest_data_diff_minutes  integer  

Diff in minutes of the latest data.

possible_problem_detected  boolean  

To check the response quickly, this flag indicates if a possible problem was found.

server_time  string  

Current server time

Server-Script

Server Stats

requires authentication

This endpoint collects (hardware) information from your server.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.defichain-masternode-health.com/v1/server-stats',
    [
        'headers' => [
            'x-api-key' => 'YOUR_API_KEY',
            'Accept' => 'application/json',
        ],
        'json' => [
            'load_avg' => 0.23,
            'num_cores' => 8,
            'hdd_used' => 152.0,
            'hdd_total' => 508.76,
            'ram_used' => 1.5,
            'ram_total' => 16.23,
            'server_script_version' => '1.0.1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.defichain-masternode-health.com/v1/server-stats"
);

const headers = {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "load_avg": 0.23,
    "num_cores": 8,
    "hdd_used": 152,
    "hdd_total": 508.76,
    "ram_used": 1.5,
    "ram_total": 16.23,
    "server_script_version": "1.0.1"
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json

url = 'https://api.defichain-masternode-health.com/v1/server-stats'
payload = {
    "load_avg": 0.23,
    "num_cores": 8,
    "hdd_used": 152,
    "hdd_total": 508.76,
    "ram_used": 1.5,
    "ram_total": 16.23,
    "server_script_version": "1.0.1"
}
headers = {
  'x-api-key': 'YOUR_API_KEY',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
curl --request POST \
    "https://api.defichain-masternode-health.com/v1/server-stats" \
    --header "x-api-key: YOUR_API_KEY" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"load_avg\": 0.23,
    \"num_cores\": 8,
    \"hdd_used\": 152,
    \"hdd_total\": 508.76,
    \"ram_used\": 1.5,
    \"ram_total\": 16.23,
    \"server_script_version\": \"1.0.1\"
}"

Example response (200, Success):


{
    "message": "ok"
}
 

Request   

POST v1/server-stats

Body Parameters

load_avg  number optional  

Current average load in GB as float.

num_cores  integer optional  

Number of cores of the system.

hdd_used  number optional  

Used HDD memory in GB as float.

hdd_total  number optional  

Total available HDD in GB memory as float.

ram_used  number optional  

Used RAM in GB as float.

ram_total  number optional  

Total available RAM in GB as float.

server_script_version  string optional  

The current version of the python server script.

Fullnode Info

requires authentication

This endpoint collects information from your running fullnode.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.defichain-masternode-health.com/v1/node-info',
    [
        'headers' => [
            'x-api-key' => 'YOUR_API_KEY',
            'Accept' => 'application/json',
        ],
        'json' => [
            'block_height_local' => 1131998,
            'local_hash' => 'cefe56ff49a94787a8e8c65da5c4ead6e748838ece6721a06624de15875395a3',
            'node_uptime' => 1343121,
            'connection_count' => 91,
            'logsize' => 13.21,
            'config_checksum' => 'a3cca2b2aa1e3b5b3b5aad99a8529074',
            'node_version' => '1.6.3',
            'operator_status' => [
                [
                    'id' => '8cb09568143d7bae6822a7a78f91cb907c23fd12dcf986d4d2c8de89457edf87',
                    'online' => false,
                ],
            ],
            'defid_running' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.defichain-masternode-health.com/v1/node-info"
);

const headers = {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "block_height_local": 1131998,
    "local_hash": "cefe56ff49a94787a8e8c65da5c4ead6e748838ece6721a06624de15875395a3",
    "node_uptime": 1343121,
    "connection_count": 91,
    "logsize": 13.21,
    "config_checksum": "a3cca2b2aa1e3b5b3b5aad99a8529074",
    "node_version": "1.6.3",
    "operator_status": [
        {
            "id": "8cb09568143d7bae6822a7a78f91cb907c23fd12dcf986d4d2c8de89457edf87",
            "online": false
        }
    ],
    "defid_running": true
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json

url = 'https://api.defichain-masternode-health.com/v1/node-info'
payload = {
    "block_height_local": 1131998,
    "local_hash": "cefe56ff49a94787a8e8c65da5c4ead6e748838ece6721a06624de15875395a3",
    "node_uptime": 1343121,
    "connection_count": 91,
    "logsize": 13.21,
    "config_checksum": "a3cca2b2aa1e3b5b3b5aad99a8529074",
    "node_version": "1.6.3",
    "operator_status": [
        {
            "id": "8cb09568143d7bae6822a7a78f91cb907c23fd12dcf986d4d2c8de89457edf87",
            "online": false
        }
    ],
    "defid_running": true
}
headers = {
  'x-api-key': 'YOUR_API_KEY',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
curl --request POST \
    "https://api.defichain-masternode-health.com/v1/node-info" \
    --header "x-api-key: YOUR_API_KEY" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"block_height_local\": 1131998,
    \"local_hash\": \"cefe56ff49a94787a8e8c65da5c4ead6e748838ece6721a06624de15875395a3\",
    \"node_uptime\": 1343121,
    \"connection_count\": 91,
    \"logsize\": 13.21,
    \"config_checksum\": \"a3cca2b2aa1e3b5b3b5aad99a8529074\",
    \"node_version\": \"1.6.3\",
    \"operator_status\": [
        {
            \"id\": \"8cb09568143d7bae6822a7a78f91cb907c23fd12dcf986d4d2c8de89457edf87\",
            \"online\": false
        }
    ],
    \"defid_running\": true
}"

Example response (200, Success):


{
    "message": "ok"
}
 

Request   

POST v1/node-info

Body Parameters

block_height_local  integer optional  

The number of the current block.

local_hash  string optional  

Hash for the current block. Required length of 64 chars.

node_uptime  integer optional  

Uptime of the fullnode in seconds.

connection_count  integer optional  

Count of the current fullnode connections.

logsize  number optional  

Size of the debug.log file in MB.

config_checksum  string optional  

MD5 Hash of the defi.conf file.

node_version  string optional  

DeFiChain Node Version.

operator_status  object[] optional  

Online/Offline information for all masternodes registered on the fullnode.

operator_status[].id  string optional  

Masternode ID

operator_status[].online  boolean optional  

defid_running  boolean optional  

Check if the DEFID on the server is running

Webhooks

Create Webhook

requires authentication

Get informed by webhooks with the current data of your server. You'll receive webhooks only every 5 minutes.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.defichain-masternode-health.com/v1/webhook',
    [
        'headers' => [
            'x-api-key' => 'YOUR_API_KEY',
            'Accept' => 'application/json',
        ],
        'json' => [
            'url' => 'https://your-domain.com/defichain-masternode-health/webhook',
            'max_tries' => 3,
            'timeout_in_seconds' => 3,
            'reference' => 'eum',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.defichain-masternode-health.com/v1/webhook"
);

const headers = {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "url": "https:\/\/your-domain.com\/defichain-masternode-health\/webhook",
    "max_tries": 3,
    "timeout_in_seconds": 3,
    "reference": "eum"
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
import requests
import json

url = 'https://api.defichain-masternode-health.com/v1/webhook'
payload = {
    "url": "https:\/\/your-domain.com\/defichain-masternode-health\/webhook",
    "max_tries": 3,
    "timeout_in_seconds": 3,
    "reference": "eum"
}
headers = {
  'x-api-key': 'YOUR_API_KEY',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
curl --request POST \
    "https://api.defichain-masternode-health.com/v1/webhook" \
    --header "x-api-key: YOUR_API_KEY" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"url\": \"https:\\/\\/your-domain.com\\/defichain-masternode-health\\/webhook\",
    \"max_tries\": 3,
    \"timeout_in_seconds\": 3,
    \"reference\": \"eum\"
}"

Request   

POST v1/webhook

Body Parameters

url  string  

URL receiving the webhooks. Has to be public reachable.

max_tries  integer optional  

The max tries to send the webhook to your url. (between 1..10). Default: 3

timeout_in_seconds  integer optional  

The timeout in seconds (between 1..5) Default: 3

reference  string optional  

To assign a webhook to a specific API key, you can set an optional reference.

Delete Webhook

requires authentication

To delete your already setup webhook just call this DELETE endpoint.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->delete(
    'https://api.defichain-masternode-health.com/v1/webhook',
    [
        'headers' => [
            'x-api-key' => 'YOUR_API_KEY',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.defichain-masternode-health.com/v1/webhook"
);

const headers = {
    "x-api-key": "YOUR_API_KEY",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.defichain-masternode-health.com/v1/webhook'
headers = {
  'x-api-key': 'YOUR_API_KEY',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('DELETE', url, headers=headers)
response.json()
curl --request DELETE \
    "https://api.defichain-masternode-health.com/v1/webhook" \
    --header "x-api-key: YOUR_API_KEY" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Request   

DELETE v1/webhook

Statistic

Statistics last week

Get usage statistics of Masternode Health of the last week.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.defichain-masternode-health.com/statistic/last_week',
    [
        'headers' => [
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.defichain-masternode-health.com/statistic/last_week"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.defichain-masternode-health.com/statistic/last_week'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()
curl --request GET \
    --get "https://api.defichain-masternode-health.com/statistic/last_week" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200, Success):


{
    "data": [
        {
            "date": "2021-09-14",
            "api_key_count": 1,
            "webhook_sent_count": 0,
            "request_received_count": 0
        },
        {
            "date": "2021-09-13",
            "api_key_count": 1,
            "webhook_sent_count": 0,
            "request_received_count": 0
        },
        {
            "date": "2021-09-12",
            "api_key_count": 1,
            "webhook_sent_count": 0,
            "request_received_count": 0
        },
        {
            "date": "2021-09-11",
            "api_key_count": 1,
            "webhook_sent_count": 0,
            "request_received_count": 0
        },
        {
            "date": "2021-09-10",
            "api_key_count": 1,
            "webhook_sent_count": 0,
            "request_received_count": 0
        },
        {
            "date": "2021-09-09",
            "api_key_count": 1,
            "webhook_sent_count": 0,
            "request_received_count": 0
        },
        {
            "date": "2021-09-08",
            "api_key_count": 1,
            "webhook_sent_count": 0,
            "request_received_count": 0
        }
    ]
}
 

Request   

GET statistic/last_week

Statistics all time

Get usage statistics of Masternode Health. The data is paginated with max 25 elements per page. Switch the page with the param ?page=PAGENUMMER.

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.defichain-masternode-health.com/statistic/all',
    [
        'headers' => [
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
    "https://api.defichain-masternode-health.com/statistic/all"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
import requests
import json

url = 'https://api.defichain-masternode-health.com/statistic/all'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()
curl --request GET \
    --get "https://api.defichain-masternode-health.com/statistic/all" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"

Example response (200, Success):


{
    "data": {
        "data": [
            {
                "date": "2021-09-14",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-09-13",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-09-12",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-09-11",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-09-10",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-09-09",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-09-08",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-09-07",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-09-06",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-09-05",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-09-04",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-09-03",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-09-02",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-09-01",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-08-31",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-08-30",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-08-29",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-08-28",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-08-27",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-08-26",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-08-25",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-08-24",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-08-23",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-08-22",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            },
            {
                "date": "2021-08-21",
                "api_key_count": 1,
                "webhook_sent_count": 0,
                "request_received_count": 0
            }
        ]
    },
    "links": {
        "first": "https://api.defichain-masternode-health.com/statistic/all?page=1",
        "last": "https://api.defichain-masternode-health.com/statistic/all?page=2",
        "prev": null,
        "next": "https://api.defichain-masternode-health.com/statistic/all?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 2,
        "path": "https://api.defichain-masternode-health.com/statistic/all",
        "per_page": 25,
        "to": 25,
        "total": 30
    }
}
 

Request   

GET statistic/all