A开发者 API

开发者 API

通过 API 自动化对接账号市场、代理 IP、社媒推广与验证码接收,使用钱包余额下单并实时获取交付结果。

基础地址 https://myapicazi.zh.pro/api/v1 认证 X-API-Key 版本 v1 格式 JSON

身份认证

所有接口通过 X-API-Key 请求头认证。在上方输入你的密钥即可在线测试。

X-API-Key: pxk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

密钥格式

密钥以 pxk_ 为前缀,后接 40 位随机字符。完整密钥仅在创建时显示一次,服务端仅存储 SHA-256 哈希值。

权限范围

权限说明
products:read浏览分类和商品
orders:read查看订单和发货状态
orders:write创建新订单
wallet:read查看钱包余额和交易记录
webhooks:read查看已注册的 Webhook
webhooks:write注册/删除/测试 Webhook
market:read浏览账号市场分类/商品,查看代购订单
market:write购买账号,取码/邮件/理赔等账号操作
proxy:read查询代理资源、询价、查看订单
proxy:write购买/支付/续费/管理代理
smm:read浏览推广服务目录、询价、查看订单
smm:write创建推广订单、批量下单、补量、取消
otp:read浏览接码/租号/eSIM 行情、询价、查看订单
otp:write购买号码/租号/eSIM,取消、重发等操作

频率限制

默认 60 次/分钟(可自定义 10~120)。每次响应包含:

请求头说明
X-RateLimit-Limit最大请求数
X-RateLimit-Remaining剩余请求数
X-RateLimit-Reset窗口重置时间戳
Retry-After重试等待秒数(仅 429)

错误处理

{ "error": { "code": "错误码", "message": "描述" } }
状态码错误码说明
401INVALID_API_KEY密钥无效/过期/已删除
402INSUFFICIENT_BALANCE余额不足
403INSUFFICIENT_PERMISSIONS缺少权限
404NOT_FOUND资源不存在
422VALIDATION_ERROR参数校验失败
429RATE_LIMIT_EXCEEDED请求过于频繁
统一读取 error.code:所有错误响应都保证带 error.codeerror.message。账号市场 / 代理 / 社媒 / 验证码接收四个业务模块的错误额外保留顶层 message(中文描述)及部分 error_code(如 PRICE_CHANGEDPRICE_DRIFTEDOUT_OF_STOCKINVALID_COUNTRY);参数校验失败额外带 errors 字段列出逐项原因。

密钥管理

密钥管理使用登录态(Sanctum)认证。您可以在网站「个人中心 → API 密钥」页面管理。

创建密钥

POST /api/v1/auth/keys auth:sanctum

密钥列表

GET /api/v1/auth/keys auth:sanctum

删除密钥

DELETE /api/v1/auth/keys/{id} auth:sanctum

钱包

查询余额

GET /api/v1/wallet/balance wallet:read
无需额外参数

返回示例:

{ "available_currency": 128.50, "available_points": 12850, "point_rate": 100 }

交易记录

GET /api/v1/wallet/transactions wallet:read

分类

分类列表

GET /api/v1/categories products:read

分类详情

GET /api/v1/categories/{id} products:read

商品

商品列表

GET /api/v1/products products:read

商品详情

GET /api/v1/products/{id} products:read

批量库存查询

GET /api/v1/products/stock?ids=1,2,3 products:read

订单

创建订单

POST /api/v1/orders orders:write
原子操作:验证库存 → 扣除钱包余额 → 自动发货。仅支持钱包支付。会实际扣款,请谨慎操作!
注意:此操作会真实扣款和发货!

订单列表

GET /api/v1/orders orders:read

订单详情

GET /api/v1/orders/{tracking_number} orders:read

发货

发货状态

GET /api/v1/orders/{tracking}/delivery orders:read

提取卡密

GET /api/v1/orders/{tracking}/items/{item_id}/codes orders:read

Webhooks(回调通知)

注册 Webhook

POST /api/v1/webhooks webhooks:write

支持的事件

事件说明
order.completed订单发货完成
order.delivering部分商品待发货
order.failed订单失败
*所有事件

Webhook 列表

GET /api/v1/webhooks webhooks:read

删除 Webhook

DELETE /api/v1/webhooks/{id} webhooks:write

发送测试事件

POST /api/v1/webhooks/{id}/test webhooks:write

签名验证

每次回调包含 X-Pixer-Signature 请求头:

X-Pixer-Signature: sha256=<HMAC-SHA256(请求体, secret)>
// PHP
$expected = 'sha256=' . hash_hmac('sha256', $payload, $secret);
if (!hash_equals($expected, $signature)) abort(403);

# Python
import hmac, hashlib
expected = 'sha256=' + hmac.new(secret.encode(), body, hashlib.sha256).hexdigest()
assert hmac.compare_digest(expected, header)

账号市场(发现)

浏览并代购各平台成品账号(游戏 / 社交 / 邮箱等 20+ 分类),购买成功即时交付账号凭据,并提供取码、收邮件、质保理赔等售后操作。

购买接口实时扣除钱包余额;购买失败会自动全额退回。商品为一次性库存,下单前建议先调用预检接口确认在售。

浏览商品

接口说明权限
GET /market/status市场开放状态market:read
GET /market/categories分类列表(含 slug,用于取商品)market:read
GET /market/category/{slug}/items分类下商品列表。支持 pagepmin/pmax(价格区间)、order_by 及该分类的筛选参数(见 params 接口);Riot 分类支持 sub=valorant|league-of-legendsmarket:read
GET /market/category/{slug}/params该分类支持的筛选参数 schemamarket:read
GET /market/items/{item_id}商品详情(含统计、徽章、卖家好评率)market:read

购买

POST /api/v1/market/items/{item_id}/preflight market:read

下单前预检:确认商品在售、返回当前售价与余额是否充足。

POST /api/v1/market/items/{item_id}/buy market:write

购买单个商品。无请求体。成功返回订单与交付数据(账号凭据)。真实扣款!同一商品 180 秒内重复提交会被幂等锁拒绝(429)。

POST /api/v1/market/batch-buy market:write

批量购买(异步)。请求体 {"item_ids":[1001,1002]}(最多 200 个),返回 batch_id 后用下列接口轮询进度:

接口说明权限
GET /market/batch-buy/latest最近一次批量任务market:read
GET /market/batch-buy/{batch_id}/progress批量任务进度与逐项结果market:read

订单与账号操作

接口说明权限
GET /market/my-orders我的代购订单列表(支持 pagemarket:read
GET /market/my-orders/{id}订单详情(含交付的账号凭据)market:read
POST /market/my-orders/{id}/refresh刷新交付数据market:write
POST /market/my-orders/{id}/check-account检查账号当前状态market:write
POST /market/my-orders/{id}/email-code获取邮箱验证码market:write
POST /market/my-orders/{id}/email-password获取邮箱密码market:write
GET /market/my-orders/{id}/email-letters读取账号邮箱原始邮件market:write
GET /market/my-orders/{id}/email-history取码历史market:read
POST /market/my-orders/{id}/telegram-code获取 Telegram 登录验证码market:write
POST /market/my-orders/{id}/telegram-reset-auth重置 Telegram 其他授权market:write
GET /market/my-orders/{id}/tg-session下载 Telegram session 文件market:write
POST /market/my-orders/{id}/steam-guard-code获取 Steam Guard 验证码market:write
GET /market/my-orders/{id}/mafile下载 .maFile(DELETE 同路径为删除)market:write
POST /market/my-orders/{id}/confirm-sda确认 SDA 操作market:write
GET /market/my-orders/{id}/steam-inventorySteam 库存估值market:write
POST /market/my-orders/{id}/check-guarantee检查质保状态market:write
GET /market/my-orders/{id}/claim查看理赔状态market:read
POST /market/my-orders/{id}/claim提交理赔,请求体 {"message":"问题描述(5~2000 字)"}market:write

代理 IP

购买独享 / 共享代理(HTTP + SOCKS5)以及 Telegram 专用代理,按国家、周期、数量下单,支持指定具体 IP 与续费。

下单为两步:先 POST /proxy/orders 创建订单拿到跟踪号,再 POST /proxy/orders/{tracking}/pay 用钱包支付。支付时会重新询价,价格波动超阈值返回 409 PRICE_DRIFTED,需重新下单。

资源查询

接口说明权限
GET /proxy/config支持的类型、周期、价格倍率等配置proxy:read
GET /proxy/countries支持的国家(含城市)proxy:read
GET /proxy/availability各国家/类型可用数量概览proxy:read
GET /proxy/ips-count某组合可用 IP 数。参数:type(dedicated/shared) ip_version(4/6) country(2 位国家码) city(可选)proxy:read
GET /proxy/ips某组合的具体可用 IP 列表(同上参数)proxy:read
POST /proxy/price-estimate询价。请求体:type ip_version country quantity period(天) coupon(可选)proxy:read

下单与支付

POST /api/v1/proxy/orders proxy:write

创建订单(不扣款)。请求体:

{
  "type": "dedicated",      // dedicated / shared / mtproxy
  "ip_version": 4,           // 4 或 6;mtproxy 可省略
  "country": "us",           // 2 位国家码
  "city": 12345,             // 可选,城市 ID
  "quantity": 2,             // 与 ip_ids 二选一
  "ip_ids": [101, 102],      // 可选,指定具体 IP(覆盖 quantity)
  "period": 30,              // 周期(天)
  "coupon": "XXXX"           // 可选
}
POST /api/v1/proxy/orders/{tracking_number}/pay proxy:write

用钱包支付并异步开通。真实扣款!随后轮询状态接口直到 completed/failed/refunded

接口说明权限
GET /proxy/orders/{tracking_number}/status订单开通进度(轮询用)proxy:read
POST /proxy/orders/{tracking_number}/cancel取消未支付订单proxy:write
GET /proxy/orders我的订单列表proxy:read
GET /proxy/orders/{tracking_number}订单详情proxy:read
GET /proxy/orders/{tracking_number}/export导出该订单代理(JSON)proxy:read

我的代理与续费

接口说明权限
GET /proxy/my-proxies我的全部代理(含到期时间、标签、白名单)proxy:read
GET /proxy/export导出全部代理(JSON)proxy:read
GET /proxy/tags标签列表proxy:read
POST /proxy/my-proxies/tags管理代理标签。请求体:proxy_ids[] action(add/set/remove) tag_ids[]proxy:write
POST /proxy/renew/estimate续费询价。请求体:proxy_ids[] period(天)proxy:read
POST /proxy/renew续费(真实扣款)。请求体:proxy_ids[] period;5 分钟内相同参数幂等去重proxy:write

社媒推广

为各社交平台链接购买互动量(粉丝 / 点赞 / 播放 / 评论等),系统自动向服务商下单并跟踪进度,支持分批发货、自动服务、补量与取消。

下单实时扣除钱包余额,失败自动退回。下单前用 estimate 获取价格;下单时可带 expected_price/expected_total 做价格守卫(价格变动返回 PRICE_CHANGED)。

服务目录

接口说明权限
GET /smm/catalog服务目录(含服务 ID、类型、单价、最小/最大数量、是否支持补量/分批)。参数 translate_to 可选语言smm:read
POST /smm/estimate询价。请求体:service(服务 ID) quantitysmm:read

下单

POST /api/v1/smm/orders smm:write

创建单笔订单。请求体(字段随服务类型不同):

{
  "service": 1234,           // 服务 ID(必填)
  "link": "https://...",     // 目标链接
  "quantity": 1000,          // 数量
  "expected_price": 12.06,   // 可选,价格守卫
  // 分批发货(dripfeed,服务支持时):
  "runs": 5, "interval": 60,
  // 自动服务(subscription,服务支持时):
  "username": "...", "min": 100, "max": 500, "posts": 10, "delay": 0,
  // 评论类:
  "comments": "多行评论,每行一条"
}
POST /api/v1/smm/mass-orders smm:write

批量下单(最多 50 行)。请求体:{"lines":"服务ID | 链接 | 数量\n...", "expected_total": 99.9}。先用 POST /smm/mass-orders/preview(权限 smm:read)预览逐行计价,不扣款;有错行整批拒绝。

订单管理

接口说明权限
GET /smm/orders我的订单列表(含进度、补量状态)smm:read
GET /smm/orders/{tracking}/status单个订单状态(轮询用)smm:read
POST /smm/orders/{tracking}/refill申请补量(服务支持且已完成/部分完成)smm:write
POST /smm/orders/{tracking}/cancel取消订单(服务支持且未开始,成功退款)smm:write

验证码接收

提供一次性接码、临时号码预订、长期租号、eSIM 四类能力,用于各平台注册/登录收码。

所有购买接口实时扣费;接码/预订超时未收到验证码会自动退回。下单前用对应 estimate 询价,下单时带 expected_price 做价格守卫(不一致返回 409 PRICE_CHANGED)。国家 / 服务均为整数 ID,先从 services/countries/offers 获取。

接码(一次性号码)

接口说明权限
GET /otp/config模块开关与基础配置otp:read
GET /otp/services可接码的平台服务列表otp:read
GET /otp/countries国家列表otp:read
GET /otp/offers?service={id}某服务在各国家的行情(价格/成功率/库存,已排序)otp:read
GET /otp/pools?country={id}&service={id}可选线路(含各线路价格/成功率/库存)otp:read
GET /otp/areacodes?country=&service=&pool=指定线路可选区号otp:read
POST /otp/estimate询价。请求体:country serviceotp:read
POST /otp/orders下单接码。请求体:country service quantity(1~10) expected_price pool(可选线路) areacode(可选区号)otp:write
GET /otp/orders我的接码订单otp:read
GET /otp/orders/{tracking}/status收码状态(轮询用)otp:read
POST /otp/orders/{tracking}/cancel取消(下单数分钟内不可取消)otp:write
GET /otp/orders/{tracking}/resend-info是否可重发验证码otp:read
POST /otp/orders/{tracking}/resend重发验证码(可能收费,带 expected_priceotp:write

预订

接口说明权限
POST /otp/preorders/estimate预订询价。请求体:country serviceotp:read
POST /otp/preorders创建预订。请求体:country service expected_priceotp:write
GET /otp/preorders我的预订otp:read
POST /otp/preorders/{tracking}/cancel取消预订otp:write

租用号码

接口说明权限
GET /otp/rental/offers可租号类型列表otp:read
GET /otp/rental/offers/{id}/pricing某租型各时长价格与库存otp:read
POST /otp/rentals租号。请求体:id(租型) days(1~365) service_id(可选) expected_priceotp:write
GET /otp/rentals我的租号otp:read
GET /otp/rentals/{tracking}租号详情与收件箱otp:read
POST /otp/rentals/{tracking}/extend续租。请求体:days expected_priceotp:write
POST /otp/rentals/{tracking}/reset重置号码(免费)otp:write
POST /otp/rentals/{tracking}/refund退租otp:write

eSIM

接口说明权限
GET /otp/esim/countrieseSIM 覆盖国家otp:read
GET /otp/esim/plans?country={ISO}某国套餐列表otp:read
POST /otp/esims购买 eSIM。请求体:plan country(ISO) expected_priceotp:write
GET /otp/esims我的 eSIM(含 LPA 激活串)otp:read
GET /otp/esims/{tracking}eSIM 详情otp:read
GET /otp/esims/{tracking}/topup-plans可充值套餐otp:read
POST /otp/esims/{tracking}/topup充值。请求体:plan expected_priceotp:write
DELETE /otp/esims/{tracking}归档 eSIM(不退款)otp:write
eSIM 为真实成本商品,购买后不可退款,请确认套餐后再下单。

cURL

# 查询余额
curl -H "X-API-Key: pxk_你的密钥" \
  https://myapicazi.zh.pro/api/v1/wallet/balance

# 浏览商品
curl -H "X-API-Key: pxk_你的密钥" \
  "https://myapicazi.zh.pro/api/v1/products?per_page=10&sort=price"

# 创建订单
curl -X POST \
  -H "X-API-Key: pxk_你的密钥" \
  -H "Content-Type: application/json" \
  -d '{"items":[{"product_id":123,"quantity":1}]}' \
  https://myapicazi.zh.pro/api/v1/orders

Python

import requests

API_KEY = "pxk_你的密钥"
BASE = "https://myapicazi.zh.pro/api/v1"
H = {"X-API-Key": API_KEY}

# 查询余额
r = requests.get(f"{BASE}/wallet/balance", headers=H)
print(f"余额: ¥{r.json()['available_currency']}")

# 商品列表
r = requests.get(f"{BASE}/products", headers=H, params={"per_page": 5})
for p in r.json()["data"]:
    print(f"{p['id']}: {p['name']} - ¥{p['price']}")

# 下单
r = requests.post(f"{BASE}/orders", headers=H, json={
    "items": [{"product_id": 123, "quantity": 1}]
})
if r.status_code == 201:
    order = r.json()["order"]
    print(f"订单: {order['tracking_number']}")
    for item in order["items"]:
        print(f"  卡密: {item.get('codes', [])}")

PHP

<?php
$apiKey = 'pxk_你的密钥';
$base = 'https://myapicazi.zh.pro/api/v1';

function api($method, $url, $data = null) {
    global $apiKey;
    $ch = curl_init($url);
    curl_setopt_array($ch, [
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => ["X-API-Key: $apiKey", 'Content-Type: application/json'],
    ]);
    if ($method === 'POST') {
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
    }
    $res = curl_exec($ch);
    $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    return ['code' => $code, 'body' => json_decode($res, true)];
}

// 查询余额
$r = api('GET', "$base/wallet/balance");
echo "¥" . $r['body']['available_currency'] . "\n";

// 下单
$r = api('POST', "$base/orders", ['items' => [['product_id' => 123, 'quantity' => 1]]]);
if ($r['code'] === 201) {
    echo "订单: " . $r['body']['order']['tracking_number'] . "\n";
}
Zh.pro|全球账户&卡密即买即发 开发者 API v1 · 如有疑问请联系管理员