Live Leaderboard API
curl --request GET \
--url https://api.gamezop.com/v2/tournaments/{tournament_id}/leaderboard \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.gamezop.com/v2/tournaments/{tournament_id}/leaderboard"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.gamezop.com/v2/tournaments/{tournament_id}/leaderboard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gamezop.com/v2/tournaments/{tournament_id}/leaderboard",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gamezop.com/v2/tournaments/{tournament_id}/leaderboard"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.gamezop.com/v2/tournaments/{tournament_id}/leaderboard")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gamezop.com/v2/tournaments/{tournament_id}/leaderboard")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"leaderboard": {
"leaderboard_id": "lb_B1MfIa4QCg_highscore",
"name": "High Score",
"description": "Top scores across all players for this tournament.",
"total_players": 19283
},
"top": [
{
"rank": 1,
"puid": "player_987",
"score": 98200
},
{
"rank": 2,
"puid": "player_456",
"score": 97100
}
],
"player": {
"entry": {
"rank": 42,
"puid": "player_123",
"score": 75400
},
"neighbours": {
"above": {
"rank": 41,
"puid": "player_777",
"score": 75800
},
"below": {
"rank": 43,
"puid": "player_555",
"score": 75100
}
}
}
}
}Tournaments
Live Leaderboard API
Returns the live leaderboard for a tournament in the live state: the leaderboard details, the top entries, and optionally a specific player’s rank with one entry above and one below. Rate limit: 1200 requests per minute, per tournament.
GET
/
v2
/
tournaments
/
{tournament_id}
/
leaderboard
Live Leaderboard API
curl --request GET \
--url https://api.gamezop.com/v2/tournaments/{tournament_id}/leaderboard \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.gamezop.com/v2/tournaments/{tournament_id}/leaderboard"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.gamezop.com/v2/tournaments/{tournament_id}/leaderboard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gamezop.com/v2/tournaments/{tournament_id}/leaderboard",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gamezop.com/v2/tournaments/{tournament_id}/leaderboard"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.gamezop.com/v2/tournaments/{tournament_id}/leaderboard")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gamezop.com/v2/tournaments/{tournament_id}/leaderboard")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"leaderboard": {
"leaderboard_id": "lb_B1MfIa4QCg_highscore",
"name": "High Score",
"description": "Top scores across all players for this tournament.",
"total_players": 19283
},
"top": [
{
"rank": 1,
"puid": "player_987",
"score": 98200
},
{
"rank": 2,
"puid": "player_456",
"score": 97100
}
],
"player": {
"entry": {
"rank": 42,
"puid": "player_123",
"score": 75400
},
"neighbours": {
"above": {
"rank": 41,
"puid": "player_777",
"score": 75800
},
"below": {
"rank": 43,
"puid": "player_555",
"score": 75100
}
}
}
}
}Tournaments module is only available with paid plans. Contact us to know more.
About this API
Returns the live leaderboard for a tournament in progress. This API is only available while the tournament is in thelive state.
Optionally pass a puid to get that player’s current rank alongside the top entries.
player object behaviour
| Condition | Behaviour |
|---|---|
puid not passed | player object is omitted entirely from the response |
puid passed, player not in leaderboard | entry is null, neighbours.above and neighbours.below are null |
| Player is at rank 1 | neighbours.above is null |
| Player is at last rank | neighbours.below is null |
The rate limit on this API (1200 requests per minute) is counted per tournament, not per token. If you fan out to many users, fetch the leaderboard once into your own backend or CDN and serve it from there. Do not proxy every end-user request straight through to this API.
API specification
Authorizations
You can find the Bearer token for this API under Settings & Admin > API Tokens within the Gamezop Business Dashboard.
Path Parameters
The tournament to fetch the live leaderboard for.
Query Parameters
The player's unique identifier — the same puid value you append to the game URL when sending that user to the tournament. If provided, the response includes that player's current rank with one entry above and one below.
Number of top entries to return. Defaults to 20. Maximum 100.
Required range:
x <= 100Was this page helpful?