Loading...
Loading...
BingX Agent (affiliate/broker) management — query invited users, daily commission details, agent user information, API transaction commission, and partner information. Use when the user asks about BingX agent invited users, affiliate commissions, referral relationships, partner data, or broker commission reports.
npx skill4agent add bingx-api/api-ai-skills bingx-agentreferences/base-urls.mdreferences/authentication.md| Endpoint | Method | Description | Auth |
|---|---|---|---|
| GET | Query invited users (paginated) | Yes |
| GET | Daily commission details (invitation relationship) | Yes |
| GET | Query agent user information for a UID | Yes |
| GET | API transaction commission (non-invitation relationship) | Yes |
| GET | Query partner information | Yes |
| GET | Query deposit details of invited users | Yes |
| GET | Query invitation code commission data | Yes |
| GET | Check if a user is a superior agent | Yes |
"20240101"81828182"YYYYMMDD"endTimestartTime8182recvWindowCONSTRAINT: You MUST copy thefunction below verbatim when generating code. Do NOT rewrite the signing, request, or JSON parsing logic. Only modify: (1)fetchSignedURL entries for custom environments, (2) business parameters passed toBASE. For the full client with URL-encoding and JSON body support, seefetchSigned.references/authentication.md
import * as crypto from "crypto";
import JSONBig from "json-bigint";
const JSONBigParse = JSONBig({ storeAsString: true });
// Full signing details & edge cases → references/authentication.md
// Domain priority: .com is mandatory primary; .pro is fallback for network/timeout errors ONLY.
const BASE = {
"prod-live": ["https://open-api.bingx.com", "https://open-api.bingx.pro"],
"prod-vst": ["https://open-api-vst.bingx.com", "https://open-api-vst.bingx.pro"],
};
function isNetworkOrTimeout(e: unknown): boolean {
if (e instanceof TypeError) return true;
if (e instanceof DOMException && e.name === "AbortError") return true;
if (e instanceof Error && e.name === "TimeoutError") return true;
return false;
}
async function fetchSigned(env: string, apiKey: string, secretKey: string,
method: "GET" | "POST" | "DELETE", path: string, params: Record<string, unknown> = {}
) {
const urls = BASE[env] ?? BASE["prod-live"];
const all = { ...params, timestamp: Date.now() };
const qs = Object.keys(all).sort().map(k => `${k}=${all[k]}`).join("&");
const sig = crypto.createHmac("sha256", secretKey).update(qs).digest("hex");
const signed = `${qs}&signature=${sig}`;
for (const base of urls) {
try {
const url = method === "POST" ? `${base}${path}` : `${base}${path}?${signed}`;
const res = await fetch(url, {
method,
headers: { "X-BX-APIKEY": apiKey, "X-SOURCE-KEY": "BX-AI-SKILL",
...(method === "POST" ? { "Content-Type": "application/x-www-form-urlencoded" } : {}) },
body: method === "POST" ? signed : undefined,
signal: AbortSignal.timeout(10000),
});
const json = JSONBigParse.parse(await res.text());
if (json.code !== 0) throw new Error(`BingX error ${json.code}: ${json.msg}`);
return json.data;
} catch (e) {
if (!isNetworkOrTimeout(e) || base === urls[urls.length - 1]) throw e;
}
}
}fetchSignedjson-bigintJSONBigParse.parseJSON.parseX-SOURCE-KEY: BX-AI-SKILLisNetworkOrTimeoutconst result = await fetchSigned("prod-live", API_KEY, SECRET, "GET",
"/openApi/agent/v1/account/inviteAccountList", {
pageIndex: 1,
pageSize: 100,
}
);
// result.list — array of invited users
// result.total — total count
// result.currentAgentUid — current agent UIDconst result = await fetchSigned("prod-live", API_KEY, SECRET, "GET",
"/openApi/agent/v1/account/inviteAccountList", {
pageIndex: 1,
pageSize: 100,
startTime: 1704067200000, // milliseconds
endTime: 1706745600000,
}
);const result = await fetchSigned("prod-live", API_KEY, SECRET, "GET",
"/openApi/agent/v2/reward/commissionDataList", {
startTime: "20240101",
endTime: "20240131",
pageIndex: 1,
pageSize: 100,
}
);
// result.list — array of CommissionData per user per day
// result.total — total recordsconst result = await fetchSigned("prod-live", API_KEY, SECRET, "GET",
"/openApi/agent/v1/account/inviteRelationCheck", {
uid: 123456789,
}
);
// result.uid, result.inviteResult, result.deposit, result.trade, etc.const result = await fetchSigned("prod-live", API_KEY, SECRET, "GET",
"/openApi/agent/v1/reward/third/commissionDataList", {
commissionBizType: 81, // 81=perpetual, 82=spot
startTime: "20240101",
endTime: "20240131",
pageIndex: 1,
pageSize: 100,
}
);const result = await fetchSigned("prod-live", API_KEY, SECRET, "GET",
"/openApi/agent/v1/asset/partnerData", {
startTime: 20240101, // days
endTime: 20240131,
pageIndex: 1,
pageSize: 200,
}
);CONFIRMWhat would you like to do?
- Query my invited/referred users list
- Query daily commission details (invitation relationship)
- Look up agent relationship info for a specific user UID
- Query API transaction commission (non-invitation relationship)
- Query partner information
Please specify a date range (max 30 days window):
- Start date (e.g., 20240101)
- End date (e.g., 20240131)
Please specify a time range (optional, max 30-day window):
- Start time (Unix ms) or leave blank for all-time