monitor_id
in the path. This endpoint allows you to query server resource usage — such as CPU, memory, disk, or network — across a specified time window.type
(e.g., cpu, memory), start_date
, end_date
, interval
(e.g., on-demand, hourly), and limit
to control the resolution and size of the returned dataset.const axios = require('axios');
const url = 'https://statistic-query.api.pinghome.io/v1/server-resource/9bb4505f-6073-4a9b-abd3-cc698f695c7b/metrics?type=cpu-total-usage&start_date=2023-04-03T21:00:00Z&end_date=2023-04-03T22:04:00Z&interval=on-demand&limit=100';
axios.get(url, {
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});