- Blitz Rocket API DocumentationGetting StartedAPI ReferenceWebhooksReferral Tracking
Leaderboard
Retrieve ranked participant leaderboards
On this page
Leaderboard
Fetch a ranked leaderboard for any contest, showing top participants ordered by points.
Get Leaderboard
GET
/api/v1/contests/:contestId/leaderboard Public or Private API Key
Returns a ranked list of contest entries ordered by points (highest first). Only confirmed, non-disqualified entries are included.
Path Parameters
contestIdstring required The unique contest identifier
Query Parameters
limitnumberNumber of entries to return (1-100). Default: 25
Request
curl -X GET "https://blitzrocket.com/api/v1/contests/clx1abc123/leaderboard?limit=10" \
-H "x-api-key: your_api_key_here"
const contestId = "clx1abc123";
const response = await fetch(
`https://blitzrocket.com/api/v1/contests/${contestId}/leaderboard?limit=10`,
{
headers: { "x-api-key": "your_api_key_here" },
}
);
const { data } = await response.json();
data.forEach((entry) => {
console.log(`#${entry.rank} ${entry.name || entry.email}: ${entry.points} pts`);
});
import requests
contest_id = "clx1abc123"
response = requests.get(
f"https://blitzrocket.com/api/v1/contests/{contest_id}/leaderboard",
headers={"x-api-key": "your_api_key_here"},
params={"limit": 10}
)
data = response.json()["data"]
for entry in data:
name = entry.get("name") or entry["email"]
print(f"#{entry['rank']} {name}: {entry['points']} pts")
Response
{
"success": true,
"data": [
{
"rank": 1,
"id": "entry_abc123",
"email": "[email protected]",
"name": "Jane Doe",
"points": 350,
"referralCode": "REF-XYZ789",
"referralsCount": 12,
"joinedAt": "2025-06-01T10:00:00.000Z"
},
{
"rank": 2,
"id": "entry_def456",
"email": "[email protected]",
"name": "John Smith",
"points": 280,
"referralCode": "REF-ABC456",
"referralsCount": 8,
"joinedAt": "2025-06-02T14:30:00.000Z"
},
{
"rank": 3,
"id": "entry_ghi789",
"email": "[email protected]",
"name": null,
"points": 195,
"referralCode": "REF-DEF123",
"referralsCount": 3,
"joinedAt": "2025-06-03T09:15:00.000Z"
}
]
}
Response Fields
ranknumberPosition in the leaderboard (1-based)
idstringUnique entry identifier
emailstringParticipant email address
namestring | nullParticipant name
pointsnumberTotal points earned
referralCodestring | nullParticipant's referral code
referralsCountnumberNumber of successful referrals
joinedAtstringISO 8601 timestamp when the participant joined
Usage Notes
- Only returns entries where
emailConfirmedistrueanddisqualifiedisfalse - Results are always ordered by
pointsdescending - The
limitparameter accepts values between 1 and 100 - Use this endpoint with a public key to build client-side leaderboard widgets
Example: Leaderboard Widget
async function renderLeaderboard(contestId, container) {
const response = await fetch(
`https://blitzrocket.com/api/v1/contests/${contestId}/leaderboard?limit=10`,
{
headers: { "x-api-key": "your_public_key_here" },
}
);
const { data } = await response.json();
container.innerHTML = data
.map(
(entry) => `
<div class="leaderboard-entry">
<span class="rank">#${entry.rank}</span>
<span class="name">${entry.name || "Anonymous"}</span>
<span class="points">${entry.points} pts</span>
<span class="referrals">${entry.referralsCount} referrals</span>
</div>
`
)
.join("");
}
Error Responses
| Status | Error | Description |
|---|---|---|
400 | Missing contestId | The contestId path parameter is required |
401 | Invalid API key | API key is missing or invalid |
404 | Contest not found | No contest exists with the given ID |