M9A API

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

📊 活动数据 (Activity Data)

多语言活动数据 JSON 文件:

中文 (CN)

api/resource/data/activity/cn.json

English (EN)

api/resource/data/activity/en.json

日本語 (JP)

api/resource/data/activity/jp.json

繁體中文 (TW)

api/resource/data/activity/tw.json

📋 Activity Manifest

api/resource/data/activity/manifest.json

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

⚔️ 战斗数据 (Combat Data)

战斗物品

api/resource/data/combat/items.json

📋 Combat Manifest

api/resource/data/combat/manifest.json

🔇 SOS 数据 (Syndrome of Silence)

SOS 物品

api/resource/data/sos/items.json

SOS 节点

api/resource/data/sos/nodes.json

📋 SOS Manifest

api/resource/data/sos/manifest.json

🗂️ Manifest 层级结构

根 Manifest

api/manifest.json

包含 resource/ 子目录的信息

Resource Manifest

api/resource/manifest.json

Data Manifest

api/resource/data/manifest.json

💻 程序化访问示例

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

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

# 读取 activity manifest
manifest = requests.get(f'{base_url}/resource/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}/resource/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