Leaderboard πŸ‘‘
Motivate your players to engage more on your platform by showing a gamified leaderboard on your website or mobile app
This endpoint allows you to retrieve the players' leaderboard for a given date range. It can also be used to get a specific player's rank among all players.
This endpoint is only available for our GURU customers only. πŸ‘‘

GET - Leaderboard

1
https://api.gameball.co/api/v3.0/integrations/leaderboard
Copied!
This API call is used to retrieve players' leaderboard within a date range or all time, ordered from the highest to the lowest rank.
The request also accepts the playerUniqueId as an optional parameter where if provided, the rank of the player (with the specified ID) in the leaderboard will be returned.

Request

Attribute
Type
Required
Description
APIKey
string
Yes
Client API key

Query Parameters

Attribute
Type
Required
Description
from
string
No
Leaderboard start datetime in the following format YYYY-MM-DD HH:MM (Example: 2021-02-13 00:00).
to
string
No
Leaderboard end datetime in the following format YYYY-MM-DD HH:MM
(Example: 2021-02-18 00:00).
limit
integer
No
The size of the returned players in the leaderboard.
Default size is 20 players. Max is 50
playerUniqueId
string
No
Unique identifier for a player at Gameball. This parameter is used in case you need to get a specific player's rank
challengeId
string
No
Challenge ID used in case you need to leaderboard of specific challenge

Response

Parameter
Type
Description
leaderboard
array
A list of players with their overall progress and rank based on the provided input parameters.
The leaderboard object is defined below.
playerRank
object
An object describing the rank of the player with the provided playerUniqueId relative to all your system players.
(This object is returned if the playerUniqueId is provided in the request as a query parameter)

leaderboard object

The leaderboard object defines the player rank and progress in the leaderboard based on the specified query parameters.
Parameter
Type
Description
displayName
string
Player's display name.
playerUniqueId
string
Unique identifier for a player at Gameball.
progress
integer
Player's progress (based on the specified query parameters).
rank
integer
Player's Rank (based on the specified query parameters).
levelName
string
Level Name.
Example: "Bronze"
levelIcon
string
Level's icon URL.

playerRank Object

Parameter
Type
Description
rank
integer
Player's rank in the leaderboard.
playersCount
integer
Total number of players in your system.

Sample Response

1
{
2
"leaderboard": [
3
{
4
"displayName": "Player 1",
5
"playerUniqueId": "5097238429738",
6
"progress": 1748,
7
"rank":1,
8
"levelName": "Bronze",
9
"levelIcon": "https://cdn.gameball.co/uploads/c007/[email protected]"
10
},
11
{
12
"displayName": "Player 2",
13
"playerUniqueId": "3172250157098",
14
"progress": 110,
15
"rank":2,
16
"levelName": "Basic",
17
"levelIcon": "https://cdn.gameball.co/uploads/c007/[email protected]"
18
}
19
],
20
"playerRank": {
21
"rank": 70,
22
"playersCount": 100
23
}
24
}
Copied!

Usage Example

cURL
1
curl -X GET
2
"https://api.gameball.co/api/v3.0/integrations/leaderboard?from=2021-02-13%2000%3A00&to=2021-02-18%2000%3A00"
3
-H "accept: application/json"
4
-H "APIKey: 807b041b7d35425988e354e1f6bce186"
Copied!
Last modified 1mo ago