API 参考

oxb API 的所有端点:服务器、统计、封禁、玩家、日志、管理员和操作,含参数和示例。

此页面尚未翻译成你的语言:当前显示英文版本。


Base: https://api.oxbservices.com/v1. Every route carries x-api-key and x-api-secret (see API Keys) and answers JSON.

Read#

Method and routeParametersReturns
GET /server—State (ONLINE, OFFLINE, BANNED), name, IP, version, players and license expiry.
GET /server/statswindow: 24h (default), 7d, 30dStatistics of the server in that window.
GET /server/players—The players connected now (count and players).
GET /server/banslimit (max. 100), page, reason, playerNameActive bans, with player, identifiers and reason.
GET /server/bans-historylimit (max. 100), page, reason, playerNameHistory of bans, including the ones already removed.
GET /server/config—The current configuration of the server.
GET /server/admins—Administrators and their permissions.
GET /server/logslimit (max. 500), page, type (several separated by comma)Records of the activity of the server.
POST /server/lookupbody: identifierThe players that have that identifier (current or previous).

Actions#

Method and routeBody (JSON)What it does
POST /server/kickplayerId, reason?, by?Kicks a connected player.
POST /server/banplayerId, reason, duration? (seconds), evidence?, by?Bans a connected player.
POST /server/ban/offlineplayerLicense or identifiers[], reason, details?, evidenceUrl?, by?Bans a player even if not connected.
POST /server/unbanbanIdRemoves a ban.
POST /server/unban/lastcount? (max. 10), minutes?Removes the latest bans.
POST /server/unban/all—Removes all the bans of the server.
POST /server/screenshotplayerIdRequests a screenshot of the player.
POST /server/execcommand, by?Runs a command in the server console.
POST /server/admin/adddiscordId, permissions[]Adds an administrator with those permissions.
POST /server/admin/removediscordIdRemoves an administrator.

Examples#

Ban a connected player
curl -X POST https://api.oxbservices.com/v1/server/ban \
-H "x-api-key: $OXB_KEY" -H "x-api-secret: $OXB_SECRET" \
-H "Content-Type: application/json" \
-d '{ "playerId": 42, "reason": "Executor use", "duration": 86400, "by": "My bot" }'
Read the online players (Node.js)
const res = await fetch("https://api.oxbservices.com/v1/server/players", {
headers: {
"x-api-key": process.env.OXB_KEY,
"x-api-secret": process.env.OXB_SECRET,
},
});
if (!res.ok) throw new Error((await res.json()).code);
const { count, players } = await res.json();
console.log(`${count} players`, players.map((p) => p.name));
Ban without being connected
curl -X POST https://api.oxbservices.com/v1/server/ban/offline \
-H "x-api-key: $OXB_KEY" -H "x-api-secret: $OXB_SECRET" \
-H "Content-Type: application/json" \
-d '{ "playerLicense": "license:abc123…", "reason": "Alternate account of a banned player" }'

最后更新:2026年11月11日