Get metrics
Retrieve historical metrics for a specified virtual machine.
Retrieve historical metrics for a specified virtual machine.
It includes the following metrics:
- CPU usage
- Memory usage
- Disk usage
- Network usage
- Uptime
Use this endpoint to monitor VPS performance and resource utilization over time.
Authorizations
AuthorizationstringRequired
API Token authentication
Path parameters
virtualMachineIdintegerRequiredExample:
Virtual Machine ID
1268054Query parameters
date_fromstring · date-timeRequiredDefault:
nullExample: 2025-05-01T00:00:00Zdate_tostring · date-timeRequiredDefault:
nullExample: 2025-06-01T00:00:00ZResponses
200
Success response
application/json
cpu_usageone of · nullableOptionalExample:
CPU usage in percentage, 0 - 100%
{"unit":"%","usage":{"1742269632":1.45}}ram_usageone of · nullableOptionalExample:
RAM usage in bytes
{"unit":"bytes","usage":{"1742269632":554176512}}disk_spaceone of · nullableOptionalExample:
Disk space usage in bytes
{"unit":"bytes","usage":{"1742269632":2620018688}}outgoing_trafficone of · nullableOptionalExample:
Outgoing traffic in bytes
{"unit":"bytes","usage":{"1742269632":784800}}incoming_trafficone of · nullableOptionalExample:
Incoming traffic in bytes
{"unit":"bytes","usage":{"1742269632":8978400}}uptimeone of · nullableOptionalExample:
Uptime in milliseconds
{"unit":"milliseconds","usage":{"1742269632":455248}}401
Unauthenticated response
application/json
422
Validation error response
application/json
500
Error response
application/json
get/api/vps/v1/virtual-machines/{virtualMachineId}/metrics
GET /api/vps/v1/virtual-machines/{virtualMachineId}/metrics?date_from=2025-05-01T00%3A00%3A00Z&date_to=2025-06-01T00%3A00%3A00Z HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"cpu_usage": {
"unit": "%",
"usage": {
"1742269632": 1.45
}
},
"ram_usage": {
"unit": "bytes",
"usage": {
"1742269632": 554176512
}
},
"disk_space": {
"unit": "bytes",
"usage": {
"1742269632": 2620018688
}
},
"outgoing_traffic": {
"unit": "bytes",
"usage": {
"1742269632": 784800
}
},
"incoming_traffic": {
"unit": "bytes",
"usage": {
"1742269632": 8978400
}
},
"uptime": {
"unit": "milliseconds",
"usage": {
"1742269632": 455248
}
}
}Last updated
Was this helpful?