For the complete documentation index, see llms.txt. This page is also available as Markdown.

Get metrics

Retrieve historical metrics for a specified virtual machine.

Get metrics

get

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
virtualMachineIdintegerRequired

Virtual Machine ID

Example: 1268054
Query parameters
date_fromstring · date-timeRequiredDefault: nullExample: 2025-05-01T00:00:00Z
date_tostring · date-timeRequiredDefault: nullExample: 2025-06-01T00:00:00Z
Responses
200

Success response

application/json
cpu_usageone of · nullableOptional

CPU usage in percentage, 0 - 100%

Example: {"unit":"%","usage":{"1742269632":1.45}}
ram_usageone of · nullableOptional

RAM usage in bytes

Example: {"unit":"bytes","usage":{"1742269632":554176512}}
disk_spaceone of · nullableOptional

Disk space usage in bytes

Example: {"unit":"bytes","usage":{"1742269632":2620018688}}
outgoing_trafficone of · nullableOptional

Outgoing traffic in bytes

Example: {"unit":"bytes","usage":{"1742269632":784800}}
incoming_trafficone of · nullableOptional

Incoming traffic in bytes

Example: {"unit":"bytes","usage":{"1742269632":8978400}}
uptimeone of · nullableOptional

Uptime in milliseconds

Example: {"unit":"milliseconds","usage":{"1742269632":455248}}
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?