> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squarecloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Get application metrics

> Get an application's CPU, RAM and network history with GET /v2/apps/{app_id}/metrics: up to 288 points over the last 24 hours, one every 5 minutes.

<ParamField header="Authorization" type="string" placeholder="API Key" required>
  The API key for your account. You can find this in your [account settings](https://squarecloud.app/en/account/security).
</ParamField>

Requires an API key with the `apps:read` [scope](/en/api-reference/authentication#scopes).

This endpoint returns historical resource usage rather than the current snapshot: up to 288 data points covering the last 24 hours, sampled every 5 minutes, for CPU, RAM, and network. Points come newest first. Use it to render a usage chart or to spot trends over time; for the application's current live numbers, use [Get Application Status](/en/api-reference/endpoint/apps/status) or the `status` events on [Real-time Logs](/en/api-reference/endpoint/apps/realtime) instead.

Metrics collection requires at least **512 MB of RAM** allocated to the application; smaller applications return `METRICS_NOT_SUPPORTED`. Results are cached for 2.5 minutes per (owner, application), and the endpoint is rate limited to 10 requests every 5 seconds per user, with a short block once that cap is hit.

## Parameters

<ParamField path="app_id" type="string" placeholder="Application ID" required>
  The ID of the application. You can find this in the URL of your application's dashboard.
</ParamField>

## Response

<ResponseField name="status" type="string">
  Indicates whether the call was successful: `success` if it was, `error` if not.
</ResponseField>

<ResponseField name="response" type="array">
  The contents of the response.

  <Expandable title="Toggle object">
    <ResponseField name="date" type="string">
      The date in ISO format.
    </ResponseField>

    <ResponseField name="cpu" type="number">
      The CPU usage percentage at the given point in time.
    </ResponseField>

    <ResponseField name="ram" type="number">
      The RAM usage in MB at the given point in time.
    </ResponseField>

    <ResponseField name="net" type="int[]">
      An array representing total network used. First the input, second the output.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json theme={"system"}
  {
      "status": "success",
      "response": [
          {
              "date": "2025-08-13T12:55:01.348Z",
              "cpu": 0.45,
              "ram": 111.27,
              "net": [
                  16834,
                  126
              ]
          },
          {
              "date": "2025-08-13T12:50:01.349Z",
              "cpu": 0.45,
              "ram": 111.22,
              "net": [
                  16834,
                  126
              ]
          },
          {
              "date": "2025-08-13T12:45:01.350Z",
              "cpu": 0.58,
              "ram": 111.36,
              "net": [
                  16834,
                  126
              ]
          },
          {
              "date": "2025-08-13T12:40:01.348Z",
              "cpu": 0.43,
              "ram": 118.44,
              "net": [
                  16834,
                  126
              ]
          }
      ]
  }
  ```
</ResponseExample>

## Common errors

| Code | HTTP | Meaning |
| - | - | - |
| `METRICS_NOT_SUPPORTED` | 400 | The application has less than 512 MB of RAM allocated and does not collect metrics. |

## Related

* CLI: [`squarecloud app metrics`](/en/cli-reference/status-and-metrics#squarecloud-app-metrics)
* SDKs: [`api.apps.metrics()`](/en/sdks/js/managing_application) (JavaScript), [`client.apps.metrics()`](/en/sdks/py/managing_application) (Python), [`c.Apps.Metrics()`](/en/sdks/go/managing_application) (Go)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.