Get a server's metrics
Get the server's CPU, memory, disk space, disk reads and writes, and uptime.
The ID of the server.
The start of the range. Defaults to 24 hours before to. Sending from or to returns a series over time. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
The end of the range. Defaults to now. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
Bearer $TOKEN
{
"server_id": "123456789",
"server_name": "Example",
"sampled_at": "2026-07-01T12:00:00.000Z",
"uptime": {
"started_at": "2026-07-01T12:00:00.000Z",
"seconds": 1
},
"cpu": {
"usage_percent": 1.5,
"vcpus": 1
},
"memory": {
"used_bytes": 1,
"total_bytes": 1,
"usage_percent": 1.5
},
"disk": {
"space": {
"used_bytes": 1,
"total_bytes": 1,
"usage_percent": 1.5
},
"io": {
"read_bytes_per_second": 1,
"write_bytes_per_second": 1
}
},
"cpu_credits": {
"balance_vcpu_minutes": 1.5,
"cap_vcpu_minutes": 1.5,
"baseline_vcpus": 1.5,
"baseline_percent": 1,
"capped": false,
"cap_reason": "example",
"updated_at": "2026-07-01T12:00:00.000Z"
},
"from": "2026-07-01T12:00:00.000Z",
"to": "2026-07-01T12:00:00.000Z",
"resolution": "raw",
"data": [
{
"dt": "2026-07-01T12:00:00.000Z",
"cpu": {
"usage_percent": 1.5,
"vcpus": 1
},
"memory": {
"used_bytes": 1,
"total_bytes": 1,
"usage_percent": 1.5
},
"disk": {
"space": {
"used_bytes": 1,
"total_bytes": 1,
"usage_percent": 1.5
},
"io": {
"read_bytes_per_second": 1,
"write_bytes_per_second": 1
}
},
"uptime_seconds": 1,
"traffic": {
"bytes_in": 1,
"bytes_out": 1,
"bytes_in_intra_az": 1,
"bytes_out_intra_az": 1
}
}
]
}
{
"error": {
"message": "Malformed JSON body.",
"code": "bad_request"
}
}
{
"error": {
"message": "Missing or invalid token.",
"code": "unauthorized"
}
}
{
"error": {
"message": "We require at least one successful credit card transaction before allowing billable actions via the API. This significantly helps us to prevent fraud. Once your first transaction is processed, you will be able to use the API unrestricted. Please add credit to your account at https://betterstack.com/settings/billing/card/new?credits=10&activate_api=true. Need help? We're here for you at hello@betterstack.com.",
"code": "payment_required"
}
}
{
"error": {
"message": "Resource not found.",
"code": "not_found"
}
}
{
"error": {
"message": "The request could not be completed right now. Please try again in a few moments.",
"code": "internal_error"
}
}
Without from and to, you get a live reading, and the server must be running. Send from or to to get a series over time instead, which works in any status. A range longer than a day has one point per hour.
The body isn't valid JSON.
The API token is missing or invalid.
The organization hasn't made its first payment yet, and the request creates a resource we charge for. The code is payment_required. A request that creates a server, load balancer, object cache, database, reserved IP or volume can also return first_purchase. The url in first_purchase opens a page where you make the payment. The resource is created after the payment. The page works until expires_at, 24 hours after the response.
A rule of the resource forbids the request.
The resource doesn't exist, it's in another zone, or your token can't access it.
You asked for a live reading, but the server isn't running. The code is server_not_running.
The range can't be read, ends before it starts or is longer than 366 days. The code is invalid_range.
We've locked the resource, with the code locked. Every change to a locked resource is refused, and so is a change that involves one.
Too many requests, with the code rate_limited. We limit requests per client IP and per organization, and some costly endpoints have a stricter limit. Wait as long as the Retry-After header says.
An unexpected, temporary error on our side, with the code internal_error. Try again.
We couldn't read the metrics. The code is metrics_unavailable. Try again.
The server's ID, a UUID. Both a live reading and a series have it.
The server's name. Both a live reading and a series have it.
When we read the values. Only a live reading has it. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
How long the server has run since it last started. Only a live reading has it.
In ISO 8601 format, such as 2026-07-01T12:00:00Z.
The seconds.
CPU use as a percentage of all the server's vCPUs. Only a live reading has it, and each point of a series has its own.
The usage percent.
The vcpus.
The server's memory use. Only a live reading has it, and each point of a series has its own.
The used bytes.
The total bytes.
The usage percent.
The disk space used out of the root disk, and the disk read and write rates. Only a live reading has it, and each point of a series has its own.
The space.
The used bytes.
The total bytes.
The usage percent.
The io.
The read bytes per second.
The write bytes per second.
The CPU credit balance of a shared or spot server. Only a live reading has it. A dedicated server doesn't have it, and neither does a server in a zone without a CPU budget.
The balance vcpu minutes.
The cap vcpu minutes.
The baseline vcpus.
The baseline percent.
The capped.
The cap reason.
In ISO 8601 format, such as 2026-07-01T12:00:00Z.
The start of the range returned. Only a series has it. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
The end of the range returned. Only a series has it. In ISO 8601 format, such as 2026-07-01T12:00:00Z.
How far apart the points are. Only a series has it.
Valid values:raw: One point per minute, for a range of up to one day.hourly: One point per hour, for a longer range.
The points of the series, oldest first. Only a series has it. A minute or hour with no sample has no point. traffic counts the bytes sent and received in each point's interval. For hourly points, the bytes inside the zone, bytes_in_intra_az and bytes_out_intra_az, are null.
In ISO 8601 format, such as 2026-07-01T12:00:00Z.
The cpu.
The usage percent.
The vcpus.
The memory.
The used bytes.
The total bytes.
The usage percent.
The disk.
The space.
The used bytes.
The total bytes.
The usage percent.
The io.
The read bytes per second.
The write bytes per second.
The uptime seconds.
The traffic.
The bytes in.
The bytes out.
The bytes in intra az.
The bytes out intra az.