🎰 4D 成绩 API

马来西亚 / 新加坡 4D 开彩成绩 · 数据源官方同步 · 公开只读

1. 基础信息

项目
Base URLhttps://chat.claw99.ai
格式JSON / UTF-8
鉴权无需(公开只读);如已配置 API Key,请带 key= 参数
缓存60 秒(同一彩种 60 秒内返回缓存)
CORS允许跨域 GET

2. 接口一览

方法路径说明
GET/api/4d/list可用彩种清单
GET/api/4d/latest最新成绩(JSON)
GET/api/4d/text最新成绩(纯文本,便于直接显示/转发)

3. 参数

参数必填说明示例
codes彩种代号,逗号分隔;留空=全部M,PMP,ST,SG
keyAPI Key(若服务端已启用)abcd1234

4. 彩种代号

代号彩种代号彩种
MMagnum 4D 马来西亚STCSandakan 4D 沙巴
PMPDa Ma Cai 马来西亚EESabah 88 4D 沙巴
STSports Toto 4D 马来西亚CSSpecial Cash Sweep 砂拉越
SGSingapore Pools 4D 新加坡H / WB / P / 6L8LUCKY / 9 Winbox / Perdana / Lotto 6D

5. 调用示例

cURL

curl "https://chat.claw99.ai/api/4d/latest?codes=M,SG"

JavaScript

fetch("https://chat.claw99.ai/api/4d/latest?codes=M").then(r=>r.json()).then(d=>{
  const r = d.results[0];
  console.log(r.label, r.draw_id, r.first, r.second, r.third);
});

PHP

$json = file_get_contents("https://chat.claw99.ai/api/4d/latest?codes=M");
$d = json_decode($json, true);
echo $d["results"][0]["first"];   // 首奖

Python

import requests
d = requests.get("https://chat.claw99.ai/api/4d/latest?codes=M").json()
print(d["results"][0]["first"])

6. 返回结构(/api/4d/latest)

{
  "ok": true,
  "count": 1,
  "results": [
    {
      "code": "M",                  // 彩种代号
      "label": "Magnum 4D 马来西亚", // 显示名
      "draw_id": "423/26",          // 期号
      "draw_date": "2026-09-16",    // 开彩日期
      "day": "Wed",                 // 星期
      "live": false,                // 是否开彩中
      "first": "6087",              // 首奖
      "second": "0781",             // 二奖
      "third": "3815",              // 三奖
      "special": ["1207","0005",...],       // 特别奖(10 个)
      "consolation": ["3187","7591",...]     // 安慰奖(10 个)
    }
  ]
}

7. 纯文本版(/api/4d/text)

{
  "ok": true,
  "count": 1,
  "text": "🎰 Magnum 4D 马来西亚
期号 423/26 | 2026-09-16 (Wed)

🥇 首奖  6087
🥈 二奖  0781
🥉 三奖  3815
..."
}

8. 注意

4D 成绩 API · 由 AI Claw99 提供