跳到正文
Are you a product supplier? Contact us.
M Mall of Accs

API 文档

通过您自己的网站、机器人或面板自动购买 Mall of Accs 的商品。所有响应均为 JSON 格式。

1. 获取密钥

请先 免费注册, 然后在“我的账户 → API”页面创建密钥。 密钥仅显示一次,请妥善保存,切勿分享。

基础 URL

https://mallofaccs.com/api/v1

身份验证

X-API-Key: 您的密钥

请求示例

curl -X GET "https://mallofaccs.com/api/v1/products?in_stock=1" \
  -H "X-API-Key: ANAHTARINIZ"

购买

curl -X POST "https://mallofaccs.com/api/v1/buy" \
  -H "X-API-Key: ANAHTARINIZ" \
  -H "Content-Type: application/json" \
  -d '{"product_id": "gmail-7-gun", "quantity": 2}'

2. 接口

GET /profile 账户信息与余额

响应示例

{"success":true,"data":{"username":"bayi","email":"…","balance":125.4,"currency":"USD"}}
GET /balance 仅限余额

响应示例

{"success":true,"data":{"balance":125.4}}
GET /categories 分类列表

响应示例

{"success":true,"data":[{"id":1,"name":"Gmail 账号","slug":"gmail-hesaplari","products":12}]}
GET /products 商品列表(分页,每页 50 个)

参数

category (slug) · q (arama) · in_stock (1/0) · sort (cheap/expensive/new/popular) · page

响应示例

{"success":true,"data":{"products":[{"id":12,"slug":"gmail-7-gun","name":"Gmail 7 天","category":"Gmail 账号","price":0.2,"stock":80040,"format":"email|password","delivery_time":"即时","warranty_hours":24,"min":1,"max":100}],"pagination":{"page":1,"per_page":50,"total_page":1,"total":12}}}
GET /products/{slug} 单个商品信息(含描述和使用说明)

响应示例

{"success":true,"data":{"id":12,"name":"Gmail 7 天","price":0.2,"stock":80040,"description":"…","usage":"…"}}
POST /buy 购买——从余额扣款,商品即时交付

参数

product_id (id veya slug) · quantity

响应示例

{"success":true,"data":{"order_id":"AL2609A1B2C3","status":"completed","quantity":2,"total":0.4,"balance":125.0,"items":["[email protected]|password1","[email protected]|password2"],"usage":"…"}}
GET /orders 订单记录

参数

page

响应示例

{"success":true,"data":{"orders":[…],"pagination":{…}}}
GET /orders/{order_id} 单个订单 + 交付信息

响应示例

{"success":true,"data":{"order_id":"AL2609A1B2C3","status":"completed","items":["[email protected]|password1"]}}

Gmail Checker API

批量查询您发送的邮箱地址状态。价格与网站相同;若套餐“包含 API”,则从套餐每日额度扣除,否则每个地址从余额扣费。仅邮箱会发送到服务。

POST /gmail-check 批量查询邮箱状态

请求体(JSON)

emails: [ "[email protected]", … ] · request_id (可选,防重复)

响应示例

{"success":true,"data":{
  "checked":2,
  "results":[{"email":"[email protected]","status":"live"},{"email":"[email protected]","status":"notexists"}],
  "billing":{"free_used":0,"plan_used":2,"billable":0,"cost":0,"balance":10.5}
}}

请求示例

curl -X POST "https://mallofaccs.com/api/v1/gmail-check" \
  -H "X-API-Key: ANAHTARINIZ" \
  -H "Content-Type: application/json" \
  -d '{"emails": ["[email protected]", "[email protected]"]}'

每次请求最多 1000 个地址。状态:live、verified(需验证)、disabled、notexists、unknown。使用相同 request_id 再次发送会返回相同结果,不会重复扣费。

3. 订单状态

/buy 与 /orders 响应中的 status 字段。商品几乎都是即时发货;极少数情况下订单需要准备。

completed
已发货;商品信息在 items 字段中。
pending
正在准备。金额已从余额扣除,商品准备好后会加入同一订单 — 请几分钟后再次查询 /orders/{order_id}。请勿重复下单。
failed
无法发货;金额已自动退回余额。
refunded
订单已退款;金额在您的余额中。

4. 连接 Telegram 机器人

您的 Telegram 机器人是运行在您自己服务器上的程序,像其他软件一样使用本 API;无需单独的 API。

  • API 密钥只保存在机器人的服务器上(例如环境变量);切勿向机器人用户展示。
  • 如果机器人服务器的 IP 地址固定,请在“我的账户 → API”页面将密钥锁定到该 IP。
  • 只有在收到您自己客户的付款后才调用 /buy;金额从您的余额中扣除。
  • 如果订单返回 "pending",请不要重新下单;每隔几分钟查询一次 /orders/{order_id}。
  • 每隔几分钟获取一次商品列表,而不是每条消息都获取,这样就不会超出频率限制。
示例机器人(Python)
# pip install python-telegram-bot
import os
import httpx
from telegram import Update
from telegram.ext import Application, CommandHandler, ContextTypes

API = "https://mallofaccs.com/api/v1"
HEADERS = {"X-API-Key": os.environ["API_KEY"]}  # keep the key on the server only
OWNER_ID = int(os.environ["OWNER_ID"])          # your own Telegram user id


async def call(method, path, **kwargs):
    async with httpx.AsyncClient(headers=HEADERS, timeout=60) as client:
        return (await client.request(method, API + path, **kwargs)).json()


async def products(update: Update, context: ContextTypes.DEFAULT_TYPE):
    res = await call("GET", "/products", params={"in_stock": 1})
    rows = [f"{p['slug']} | {p['name']} | ${p['price']}" for p in res["data"]["products"][:20]]
    await update.message.reply_text("\n".join(rows) or "No products in stock")


async def buy(update: Update, context: ContextTypes.DEFAULT_TYPE):
    # Demo: only the owner can buy. In a real bot, call /buy after your customer has paid you.
    if update.effective_user.id != OWNER_ID or not context.args:
        return
    qty = int(context.args[1]) if len(context.args) > 1 else 1
    res = await call("POST", "/buy", json={"product_id": context.args[0], "quantity": qty})
    if not res["success"]:
        return await update.message.reply_text(res["message"])
    order = res["data"]
    if order["status"] == "pending":
        return await update.message.reply_text(f"Preparing - check later: /order {order['order_id']}")
    await update.message.reply_text("\n".join(order["items"]))


async def order(update: Update, context: ContextTypes.DEFAULT_TYPE):
    if update.effective_user.id != OWNER_ID or not context.args:
        return
    res = await call("GET", f"/orders/{context.args[0]}")
    data = res.get("data", {})
    await update.message.reply_text("\n".join(data.get("items", [])) or data.get("status", res.get("message", "")))


app = Application.builder().token(os.environ["BOT_TOKEN"]).build()
app.add_handler(CommandHandler("products", products))
app.add_handler(CommandHandler("buy", buy))
app.add_handler(CommandHandler("order", order))
app.run_polling()

运行前请设置环境变量 API_KEY、BOT_TOKEN(从 BotFather 获取)和 OWNER_ID。命令:/products、/buy <商品> <数量>、/order <订单号>。

频率限制

数据接口
120 次请求 / 分钟
购买
60 次请求 / 分钟

按密钥分别计算。您也可以将密钥限定在特定 IP 地址。

错误代码

200
成功
401
密钥缺失或无效
402
余额不足
403
IP 未授权 / 账号已暂停
404
未找到商品或订单
409
供应商无法交付;金额已退回
429
超出请求频率限制
备注: 购买金额从余额中扣除。如交付失败,订单将标记为失败,金额自动退回余额——您无需任何操作。 若订单返回 "pending",表示正在准备发货:请勿重复购买,用订单号查询状态。