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

# データベースメトリクスの取得

> ホストされているデータベースのメトリクスを取得します。

<ParamField header="Authorization" type="string" placeholder="API Key" required>
  アカウントの API キーです。これは[アカウント設定](https://squarecloud.app/ja/account/security)で確認できます。
</ParamField>

### パラメータ

<ParamField path="database_id" type="string" placeholder="Database ID" required>
  データベースの ID。
</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[]">
      使用された総ネットワーク量を表す配列。最初が入力、2 番目が出力。
    </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>
