> ## 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.

# 获取应用指标

> 获取你托管的应用的指标。

返回最多 288 个数据点（24 小时内每 5 分钟采样一次）的 CPU、RAM 和网络使用情况。仅适用于至少拥有 512 MB RAM 的应用。结果按（所有者、应用）缓存 2.5 分钟。

<ParamField header="Authorization" type="string" placeholder="API Key" required>
  你账户的 API 密钥。你可以在[账户设置](https://squarecloud.app/zh/account/security)中找到它。
</ParamField>

### 参数

<ParamField path="app_id" type="string" placeholder="Application ID" required>
  应用的 ID。你可以在应用控制面板的 URL 中找到它。
</ParamField>

### 响应

<ResponseField name="status" type="string">
  指示调用是否成功。成功时为 `success`，否则为 `error`。
</ResponseField>

<ResponseField name="response" type="array">
  响应的内容。

  <Expandable title="展开对象">
    <ResponseField name="date" type="string">
      ISO 格式的日期。
    </ResponseField>

    <ResponseField name="cpu" type="number">
      该时间点的 CPU 使用率百分比。
    </ResponseField>

    <ResponseField name="ram" type="number">
      该时间点的 RAM 使用量（单位 MB）。
    </ResponseField>

    <ResponseField name="net" type="int[]">
      表示所用网络总量的数组。第一个为入站，第二个为出站。
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json theme={null}
  {
      "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>
