# Thống kê cPanel

`GET /v1/service/cpanel2/@id/statistics` · quyền `services:read`

Dung lượng, băng thông và các chỉ số sử dụng khác của hosting cPanel, theo `id` của từng chỉ số.

## HTTP request

| Mục | Giá trị |
| --- | --- |
| URL | `https://api.tino.vn/v1/service/cpanel2/@id/statistics` |
| Method | `GET` |
| Quyền (scope) | `services:read` |
| Header | `Authorization: Bearer <token>` |
| Content-Type | — (không có body) |
| Token gọi được | token ứng dụng (`tinoat_`), token API cá nhân (`tinopat_`) |

## Tham số

| Tên | Vị trí | Kiểu | Bắt buộc | Mô tả |
| --- | --- | --- | --- | --- |
| `id` | đường dẫn | integer | có | ID dịch vụ hosting cPanel |

## Example request

```bash
curl "https://api.tino.vn/v1/service/cpanel2/12345/statistics" \
  -H "Authorization: Bearer $TINO_TOKEN"
```

`$TINO_TOKEN` là token có quyền `services:read`. Tham số đường dẫn trong ví dụ là giá trị mẫu.

SDK ([SDK & Ví dụ](/docs/sdk)): Python `client.cpanel.get_statistics(id)`, Node.js `await client.cpanel.getStatistics(id);`, PHP `$client->cpanel->getStatistics($id);`.

## Example response

```json
{
 "statistics": {
  "bandwidthusage": {
   "is_maxed": 0,
   "module": "Stats",
   "item": "Monthly Bandwidth Transfer",
   "role": "WebServer",
   "maxed_phrase": "You have transferred your maximum allotment of data ([format_bytes,_1]) for this month.",
   "percent5": 0,
   "phrase": "Monthly Bandwidth Transfer",
   "normalized": 1,
   "_max": "unlimited",
   "name": "bandwidthusage",
   "near_limit_phrase": "You have transferred [format_bytes,_1] of your [format_bytes,_2] data allotment for this month.",
   "max": "unlimited",
   "percent20": 0,
   "feature": "bandwidth",
   "id": "bandwidthusage",
   "percent": 0,
   "_maxed": 0,
   "_count": "0.00",
   "zeroisunlimited": 1,
   "count": "0 bytes",
   "…": "2 more key(s)"
  },
  "diskusage": {
   "near_limit_phrase": "You are using [format_bytes,_1] of the [format_bytes,_2] of storage available to you.",
   "max": "5 GB",
   "percent10": 0,
   "name": "diskusage",
   "_max": "5120",
   "normalized": 1,
   "phrase": "Disk Space Usage",
   "percent5": 0,
   "count": "0 bytes",
   "units": "MB",
   "_count": "0",
   "zeroisunlimited": 1,
   "item": "Disk Space Usage",
   "maxed_phrase": "You are using your maximum storage allotment, [format_bytes,_1].",
   "percent": 0,
   "_maxed": 0,
   "is_maxed": 0,
   "percent20": 0,
   "module": "Quota",
  … 196 more line(s)
```

Mẫu thật từ tài khoản thử, đã che dữ liệu cá nhân; mảng và chuỗi dài được rút gọn (`… N more item(s)`, `… N more line(s)`).
