Skip to content

Get Leaderboard

GET /v1/leaderboard

Returns the ranked leaderboard with composite scores. Paginated.

HeaderRequiredValue
X-API-KeyYesYour public key
ParamTypeDefaultDescription
pageinteger1Page number
limitinteger20Results per page
Terminal window
curl -X GET "https://api.gamifyhost.com/v1/leaderboard?page=1&limit=10" \
-H "X-API-Key: pk_live_your_public_key"

Status: 200 OK

{
"message": "Leaderboard retrieved",
"code": 200,
"status": "success",
"data": [
{
"rank": 1,
"userId": "user_777",
"displayName": "Alice",
"totalPoints": 12500,
"totalRewardsWon": 34,
"gamesPlayed": 89,
"score": 14190
},
{
"rank": 2,
"userId": "user_42",
"displayName": "Bob",
"totalPoints": 9800,
"totalRewardsWon": 22,
"gamesPlayed": 65,
"score": 11072
}
],
"meta": {
"page": 1,
"limit": 10,
"total": 156,
"totalPages": 16
}
}
FieldTypeDescription
rankintegerPosition on the leaderboard
userIdstringUser’s external ID
displayNamestringUser’s display name
totalPointsintegerLifetime points earned
totalRewardsWonintegerNumber of rewards won
gamesPlayedintegerTotal games played
scoreintegerComposite score: totalPoints + totalRewardsWon + (gamesPlayed * 10)