Leaderboards Metadata API
curl --request GET \
--url https://api.gamezop.com/v3/leaderboards-metadata \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.gamezop.com/v3/leaderboards-metadata"
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/v3/leaderboards-metadata', 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/v3/leaderboards-metadata",
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/v3/leaderboards-metadata"
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/v3/leaderboards-metadata")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gamezop.com/v3/leaderboards-metadata")
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{
"data": [
{
"leaderboard_id": "NkxfOJM-qg_default",
"name": "Score leaderboard",
"description": "Rankings of best scores made in Fidgety Frog",
"score_type": "number",
"sorting_order": "ascending"
}
],
"success": true
}Guides
Leaderboards Metadata API
Find out what each type of score in a game means. This API does not return scores or rankings.
GET
/
v3
/
leaderboards-metadata
Leaderboards Metadata API
curl --request GET \
--url https://api.gamezop.com/v3/leaderboards-metadata \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.gamezop.com/v3/leaderboards-metadata"
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/v3/leaderboards-metadata', 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/v3/leaderboards-metadata",
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/v3/leaderboards-metadata"
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/v3/leaderboards-metadata")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gamezop.com/v3/leaderboards-metadata")
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{
"data": [
{
"leaderboard_id": "NkxfOJM-qg_default",
"name": "Score leaderboard",
"description": "Rankings of best scores made in Fidgety Frog",
"score_type": "number",
"sorting_order": "ascending"
}
],
"success": true
}Licensed
Leaderboards are only available with the licensed model. Contact us to know more.
What is a Leaderboard?
Take an endless runner game with 2 modes: “easy” and “hard”. A score of 500 in easy mode can’t be fairly compared with a score of 500 in hard mode, so the game has 2 Leaderboards, one for each mode. Scores you receive through server-side webhooks and client-side callbacks include the ID of the Leaderboard they were recorded against. Use this API to look up what that Leaderboard is: in this example, whether the score came from easy or hard mode. If you want to show your users a ranked list of scores, you build it yourself from the scores you receive, keeping each Leaderboard separate.Most games have a single Leaderboard. You mainly need this API for games that have more than one.
What this API returns
For the game you ask about, the API returns a list of its Leaderboards. Each Leaderboard in the list contains:| Field | What it tells you |
|---|---|
leaderboard_id | The Leaderboard’s unique ID. This is the ID that comes with each score you receive. |
name | The Leaderboard’s name in English, such as “Score leaderboard”. You can show it to your users. |
description | A short English description of the Leaderboard. You can show it to your users. |
score_type | The kind of value recorded as a score: number or percent. |
sorting_order | Which scores are better, for when you build your own rankings: ascending means a higher score is better, and descending means a lower score is better. |
Where to get the scores themselves
This API does not return user scores or rankings. To get the scores themselves, use one of the pages below.
| To get | Use |
|---|---|
| Individual Games scores in your backend | Server-side webhooks |
| Individual Games scores in your app or website, as they happen | Client-side callbacks for Individual Games |
| Battles winners and match results in your backend | Track Battle match outcomes or the Get Match Result API |
| Battles scores and results in your app or website, as they happen | Client-side callbacks for Battles |
| Tournament rankings while a tournament is running | Live Leaderboard API |
| Tournament rankings after a tournament ends | Final Results API |
List a game’s Leaderboards
Pass the game’scode from the All Games API as the game-code query parameter. The request format and an example response are in the API reference on this page.
Authorizations
You can find the Bearer token for this API under Settings & Admin > API Tokens within the Gamezop Business Dashboard.
Query Parameters
The unique code of the Gamezop game for which you want to fetch Leaderboards' metadata. You can find the code for any game from the All Games API
Was this page helpful?