📖 API 文档

域名: mail.nixi888.xin

🔑 认证方式:管理员密钥或用户密钥均可调用API
Header: X-API-Key: 密钥 或 URL: ?api_key=密钥
用户密钥需管理员审核通过后才能使用,每日有调用限额

👤 用户系统

POST/api/user/register
注册账号申请API密钥(无需认证)
curl -X POST https://mail.nixi888.xin/api/user/register \
  -H "Content-Type: application/json" \
  -d '{"username":"myname","password":"mypass123","email":"可选"}'
{"success":true,"message":"注册成功,请等待管理员审核","api_key":"xxx","status":"pending"}
POST/api/user/login
登录查看密钥状态(无需认证)
curl -X POST https://mail.nixi888.xin/api/user/login \
  -H "Content-Type: application/json" \
  -d '{"username":"myname","password":"mypass123"}'
{"success":true,"api_key":"xxx","status":"approved","daily_limit":100,"used_today":5}

📬 邮箱管理

POST/api/create
创建临时邮箱
参数类型说明
prefixstring前缀(可选)
countint数量(默认1,最多100)
expireint过期秒数(默认86400)
curl -X POST https://mail.nixi888.xin/api/create \
  -H "X-API-Key: 密钥" -H "Content-Type: application/json" \
  -d '{"prefix":"test"}'
POST/api/batch_create
批量创建(最多500)
{"count":10,"prefix":"reg","expire":1800}
DELETE/api/delete/{email}
删除邮箱(也支持GET)

📨 邮件读取

GET/api/inbox/{email}
收件箱(自动提取验证码)
GET/api/code/{email}?wait=30
⭐ 直接获取验证码(支持字母数字混合如c0ec31)
curl "https://mail.nixi888.xin/api/code/test@mail.nixi888.xin?wait=30&api_key=密钥"
{"success":true,"code":"c0ec31"}
GET/api/latest/{email}?wait=30
最新邮件(支持等待)
POST/api/batch_check
批量检查验证码
GET/api/stats
系统统计

🐍 Python 注册机示例

import requests, time

API = "http://mail.nixi888.xin"
KEY = "你的密钥"
H = {"X-API-Key": KEY, "Content-Type": "application/json"}

# 创建邮箱
r = requests.post(f"{API}/api/create", headers=H, json={"prefix":"test"})
email = r.json()["mailboxes"][0]["email"]

# 获取验证码(等30秒)
r = requests.get(f"{API}/api/code/{email}?wait=30", headers=H)
code = r.json()["code"]  # 支持字母数字混合如 c0ec31

# 删除
requests.delete(f"{API}/api/delete/{email}", headers=H)

📱 AutoJS Pro 示例

let API = "http://mail.nixi888.xin";
let KEY = "你的密钥";

function createEmail() {
    let res = http.postJson(API + "/api/create",
        {count:1}, {headers:{"X-API-Key":KEY}});
    return res.body.json().mailboxes[0].email;
}

function getCode(email, wait) {
    let res = http.get(API+"/api/code/"+email+"?wait="+(wait||30),
        {headers:{"X-API-Key":KEY}});
    return res.body.json().code;
}