The API runs on the API subdomain (example: https://api.serverranks.com). Use it to detect recently-cast votes and to mark (claim) unrewarded votes within a 12-hour window.
To protect the API from abuse we apply rate limits (implemented server‑side). Limits are applied per serverKey and fall back to client IP when no serverKey is provided.
/status — 120 requests per minute (per serverKey)
/claim — 10 requests per minute (per serverKey)
When a client exceeds the limit the API returns 429 Too Many Requests and a Retry-After header (seconds). Clients should back off and retry after the interval.
Recommendation: call /status first and only call /claim when reward_player: true; implement exponential backoff on 429 responses.
Endpoint | Purpose | Method |
|---|---|---|
| Quick path-style check — returns whether player voted recently (last 12 hours). | GET |
| Detailed vote status: whether rewardable/unclaimed, last vote date, IDs. | GET |
| Claim unrewarded votes (sets | GET |
serverkey / serverKey — string. This is located on the server owner dashboard under settings.
id — player identifier (supply either a SteamID or an EpicID):
Steam ID: numeric (integer > 2)
Epic ID: 32-character hexadecimal string (ctype_xdigit)
Note: vote records and responses may contain only steam_id or only epic_id. The API includes ID fields only when present.
Time window is 12 hours: only votes with created_at >= now() - 12 hours are considered claimable.
/status returns status: "unclaimed" and reward_player: true when an unrewarded vote exists in that window.
/claim marks unrewarded votes as claimed and returns the claimed info.
Responses include booleans and timestamps (Carbon/SQL formatted strings).
ID fields (steam_id, epic_id) are returned only when available — do not assume both will be present.
curl "https://api.serverranks.com/status?serverkey=YOUR_SERVER_KEY&id={SteamID|EpicID}"curl "https://api.serverranks.com/claim?serverkey=YOUR_SERVER_KEY&id={SteamID|EpicID}"Important: These examples show direct API calls for illustration only. In production, proxy the call server-side so the serverKey remains secret.
Recommended: call the API from your server so the serverKey is never exposed. Example code below shows how to request /status, decode the JSON and render safe HTML. Replace placeholders before use.
<?php
$serverKey = 'YOUR_SERVER_KEY';
$id = '{SteamID|EpicID}';
$url = 'https://api.serverranks.com/status?serverkey=' . urlencode($serverKey) . '&id=' . urlencode($id);
$json = @file_get_contents($url);
if ($json === false) {
echo '<div class="alert alert-danger">Request failed</div>';
return;
}
$data = json_decode($json, true);
// Example: render concise HTML summary
echo '<h3>Vote status for ' . htmlspecialchars($id) . '</h3>';
if (!empty($data['reward_player'])) {
echo '<div class="alert alert-success">Unclaimed vote — reward the player.</div>';
} else {
echo '<div class="alert alert-secondary">' . htmlspecialchars($data['error_reason'] ?? 'No unclaimed votes') . '</div>';
}
// IDs may be absent — check before printing
if (!empty($data['steam_id'])) {
echo '<p>Steam ID: ' . htmlspecialchars($data['steam_id']) . '</p>';
}
if (!empty($data['epic_id'])) {
echo '<p>Epic ID: ' . htmlspecialchars($data['epic_id']) . '</p>';
}
?><?php
$ch = curl_init('https://api.serverranks.com/status?serverkey=' . urlencode($serverKey) . '&id=' . urlencode($id));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$resp = curl_exec($ch);
if (curl_errno($ch)) {
echo '<div class="alert alert-danger">cURL error: ' . htmlspecialchars(curl_error($ch)) . '</div>';
} else {
$data = json_decode($resp, true);
echo '<h3>Vote details</h3>';
echo '<pre>' . htmlspecialchars(json_encode($data, JSON_PRETTY_PRINT)) . '</pre>';
}
curl_close($ch);
?>{
"voterewards_premium": false,
"user_banned": false,
"user_name": "DemoPlayer",
"reward_player": true,
"vote_date": "2026-02-17 12:34:56",
"epicserver_id": 42,
"reward_time": null,
"steam_id": "76561190000000000",
"status": "unclaimed"
}{
"user_name": "DemoPlayer",
"reward_player": true,
"vote_date": "2026-02-17 12:34:56",
"steam_id": "76561190000000000",
"status": "unclaimed"
}{
"status": "claimed",
"error_reason": "The player's vote is older than 12 hours and cannot be claimed.",
"steam_id": "76561190000000000",
"epicserver_id": 42
}{
"user_name": "DemoPlayer",
"reward_player": true,
"vote_date": "2026-02-17 12:34:56",
"epicserver_id": 42,
"claimed_time": "2026-02-17 12:35:01",
"steam_id": "76561190000000000"
}200 — success (inspect JSON fields).
400 — invalid input (missing/invalid serverKey or id).
404 — no votes found for the id.
Validate id before calling the API (numeric for Steam, 32-hex for Epic).
Always call /status first — call /claim only when reward_player: true.
Keep serverKey secret by proxying API calls from your server.
Make reward handling idempotent — the API may return "already claimed" responses.
If you get Invalid ServerKey or ID, confirm the serverKey and that id matches Steam/Epic format.
If the vote is older than 12 hours, the API returns status: "claimed" with an error_reason.
For local debugging prefer curl and inspect HTTP status + JSON body.