M9A API

API Base URL: https://api.1999.fan/api

📊 活动数据 (Activity Data)

多语言活动数据 JSON 文件:

中文 (CN)

api/data/activity/cn.json

English (EN)

api/data/activity/en.json

日本語 (JP)

api/data/activity/jp.json

繁體中文 (TW)

api/data/activity/tw.json

📦 Activity Manifest

api/data/activity/manifest.json

文件列表及元数据(文件名、路径、大小、更新时间、SHA256 哈希)。

⚔️ 战斗数据 (Combat Data)

战斗物品

api/data/combat/items.json

📦 Combat Manifest

api/data/combat/manifest.json

🎭 SOS 数据 (Syndrome of Silence)

SOS 物品

api/data/sos/items.json

SOS 节点

api/data/sos/nodes.json

📦 SOS Manifest

api/data/sos/manifest.json

⬇️ 版本信息 (Latest Release)

由 M9A 仓库最新 Release 聚合而来,文档站用它渲染首页的下载入口,避免直连 GitHub API(限流且国内常不可达)。

最新稳定版

api/version/stable.json
{
  "version": "v4.11.0",
  "name": "v4.11.0",
  "published_at": "2026-09-26T07:44:43Z",
  "html_url": "https://github.com/MAA1999/M9A/releases/tag/v4.11.0",
  "assets": [
    {
      "name": "M9A-win-x86_64-v4.11.0-MFAA.zip",
      "size": 186730000,
      "url": "https://github.com/.../M9A-win-x86_64-v4.11.0-MFAA.zip",
      "mirrors": []
    }
  ],
  "updated": 1790479438698
}

mirrors 为镜像/加速直链预留(Mirror酱 需要 CDK,无法在此生成直链,目前恒为空数组)。 由 tools/generate_version.py 生成,工作流见 .github/workflows/sync-release.yml。

🗂️ Manifest 层级结构

根 Manifest

api/manifest.json

包含 data/ 和 version/ 子目录的信息。

Data Manifest

api/data/manifest.json

🔧 程序化访问示例

🐍 Python:批量下载所有活动数据
import requests

base_url = 'https://api.1999.fan/api'

# 读取 activity manifest
manifest = requests.get(f'{base_url}/data/activity/manifest.json').json()

# 下载所有文件
for file in manifest['files']:
    url = f"{base_url}/{file['path']}"
    response = requests.get(url)

    # 验证文件完整性
    import hashlib
    downloaded_hash = hashlib.sha256(response.content).hexdigest()
    if downloaded_hash == file['hash']:
        with open(file['name'], 'wb') as f:
            f.write(response.content)
        print(f"✅ {file['name']} ({file['size']} bytes)")
    else:
        print(f"❌ {file['name']} hash mismatch!")

print(f"\nTotal: {len(manifest['files'])} files")
🟨 JavaScript:批量下载所有活动数据
const baseUrl = 'https://api.1999.fan/api';

// 读取 activity manifest
const manifest = await fetch(`${baseUrl}/data/activity/manifest.json`).then(r => r.json());

// 下载所有文件并验证完整性
for (const file of manifest.files) {
    const response = await fetch(`${baseUrl}/${file.path}`);
    const buffer = await response.arrayBuffer();
    const hashBuffer = await crypto.subtle.digest('SHA-256', buffer);
    const hashHex = [...new Uint8Array(hashBuffer)]
        .map(b => b.toString(16).padStart(2, '0'))
        .join('');
    if (hashHex === file.hash) {
        console.log(`✅ ${file.name} (${file.size} bytes)`);
    } else {
        console.log(`❌ ${file.name} hash mismatch!`);
    }
}

console.log(`Total: ${manifest.files.length} files`);

数据源: MAA1999/M9A | API 仓库: MAA1999/M9A-API