---
title: "Get container stats based on resource usage"
method: GET
path: "/containers/{id}/stats"
tags: ["Container"]
---

# Get container stats based on resource usage

`GET /containers/{id}/stats`

This endpoint returns a live stream of a container’s resource usage
statistics.

The `precpu_stats` is the CPU statistic of last read, which is used
for calculating the CPU usage percentage. It is not the same as the
`cpu_stats` field.

If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is
nil then for compatibility with older daemons the length of the
corresponding `cpu_usage.percpu_usage` array should be used.

## Path parameters

- `id` string, required

## Query parameters

- `stream` boolean

## Response `200`

no error

- object

## Other responses

- `404` — no such container
- `500` — server error

---

[API](https://skmtc.net/docker/apis/engine.md) · [All operations](https://skmtc.net/docker/apis/engine/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/docker/engine/versions/400730735b03/schema)
