---
url: https://wiki.awmc.team/en/dev/status-api.md
---

# Status API (Uptime Kuma)

::: danger ⚠️ Deprecated
AWMC has **discontinued** this Status API. The endpoints under `status.awmc.cc` are no longer maintained and may return a redirect or become unavailable at any time.

This page is kept as a historical archive only. **Do not integrate it into new projects.** For maimai server status data we recommend the community project [mai.chongxi.us](https://mai.chongxi.us/): it has **no affiliation with AWMC** and is independently developed and maintained by the community, offering more monitoring dimensions and player self-reporting.
:::

AWMC TEAM uses [Uptime Kuma](https://status.awmc.cc) to monitor the operational status of all services. We provide public API endpoints for developers to access real-time service status data.

::: info No API Key Required
All APIs listed on this page are **public endpoints**. You do not need any API Key or authentication to make requests directly from a browser or script.
:::

## 1. Status Page Configuration & Structure

This endpoint retrieves the status page title, announcements (Incidents), maintenance schedules, and group structure.

* **Endpoint**: `GET /api/status-page/[slug]`
* **Full Example**: `https://status.awmc.cc/api/status-page/maimai`

### Announcements & Incidents

::: tip Important
You can parse the `incidents` array to get pinned announcements or incident reports on the current status page.
:::

```json
{
  "incidents": [
    {
      "id": 16,
      "style": "info", 
      "title": "Announcement Title",
      "content": "Announcement Markdown content",
      "pin": true, 
      "active": true,
      "createdDate": "2026-03-28 07:46:17"
    }
  ]
}
```

### Groups & Monitor List (Public Groups)

```json
{
  "publicGroupList": [
    {
      "id": 1,
      "name": "maimai Service Group",
      "monitorList": [
        {
          "id": 12,
          "name": "Maimai DX Proxy",
          "type": "http"
        }
      ]
    }
  ]
}
```

***

## 2. Real-time Status & Heartbeat Records

Since the base endpoint does not include real-time status, you need to call the dedicated heartbeat endpoint.

* **Endpoint**: `GET /api/status-page/heartbeat/[slug]`
* **Full Example**: `https://status.awmc.cc/api/status-page/heartbeat/maimai`

### Response Example (JSON)

```json
{
  "heartbeatList": {
    "12": [
      {
        "status": 1, 
        "time": "2026-03-29 15:28:18",
        "msg": "200 OK",
        "ping": 32
      }
    ]
  }
}
```

::: warning Status Code Reference
In `heartbeatList`, the `status` field represents the current health of the service:

* **`1`**: **Up** - Service is responding normally, all OK.
* **`0`**: **Down** - Service has crashed or is unreachable.
* **`2`**: **Pending/Warning** - Service is online but may be responding very slowly or returning unexpected results.
* **`3`**: **Maintenance** - Service is in a planned maintenance phase (notifications are usually skipped).
  :::

***

## 3. Scheduled Maintenance

When servers have planned downtime maintenance, you can retrieve it from `maintenanceList`.

::: details How to parse maintenance info?
If `maintenanceList` is not empty, you can get the following key information:

* `title`: Maintenance title.
* `description`: Detailed maintenance description.
* `start_date`: Maintenance start time.
* `end_date`: Expected maintenance end time.
  :::

```json
{
  "maintenanceList": [
    {
      "id": 5,
      "title": "Routine Database Maintenance",
      "active": true,
      "interval": 0
    }
  ]
}
```

***

## Smart Live Status Preview

Below is a real-time **maimai** status preview fetched using the above API endpoints:
::: info Smart Sorting Logic

1. **Business Priority**: Sorted by NET Server > Cabinet Server > Member Server > QR Code Server > ALL.NET Server.
2. **ISP Priority**: Automatically detects your **domestic ISP** (China Unicom/China Telecom/China Mobile) and places matching servers at the top.
   :::

***

### How Developers Can Implement "ISP Priority Sorting"

When developing a status page, you can refer to the following core logic. The key is **keyword matching** on server names.

```javascript
// 1. Get user ISP info (cross-origin compatible approach) 
async function getUserISP() {
  try {
    // Recommended: use myip.ipip.net with HTTPS (plain text format)
    const res = await fetch('https://myip.ipip.net/'); 
    const text = await res.text();
    if (text.includes('联通')) return 'China Unicom';
    if (text.includes('电信')) return 'China Telecom';
    if (text.includes('移动')) return 'China Mobile';
    return 'Domestic';
  } catch (e) {
    return 'Detection Failed';
  }
}

// 2. Define business type sort weights (higher = higher priority) 
const TYPE_WEIGHT = {
  "NET服务器": 500,
  "机台服务器": 400,
  "会员服务器": 300,
  "二维码服务器": 200,
  "ALL.NET服务器": 100
};

// 3. Execute smart sorting algorithm
const userISP = await getUserISP();

monitors.sort((a, b) => {
  let scoreA = 0;
  let scoreB = 0;

  // A. Add score based on business type
  Object.keys(TYPE_WEIGHT).forEach(key => {
    if (a.name.includes(key)) scoreA += TYPE_WEIGHT[key];
    if (b.name.includes(key)) scoreB += TYPE_WEIGHT[key];
  });

  // B. If name contains user's ISP, add large bonus (pin to top)
  if (a.name.includes(userISP)) scoreA += 1000; 
  if (b.name.includes(userISP)) scoreB += 1000;

  return scoreB - scoreA; // Higher score goes first
});
```

***

::: tip Integration Advice
If you want to implement a "service status light" feature in your own app:

1. **First fetch** `status-page/maimai` to get `publicGroupList` (determine which services exist).
2. **Then fetch** `status-page/heartbeat/maimai` to get the latest `status` (light up the corresponding indicator).
3. **Don't forget** to check the `incidents` array. If there's an `active: true` announcement, you can show a popup to alert users.
   :::
