Get Game Leaderboard
curl --request POST \
--url https://api.basement.fun/scores \
--header 'Content-Type: application/json' \
--header 'X-Service-Method: <x-service-method>' \
--data '
{
"gameId": "<string>",
"limit": 50,
"skip": 0
}
'import requests
url = "https://api.basement.fun/scores"
payload = {
"gameId": "<string>",
"limit": 50,
"skip": 0
}
headers = {
"X-Service-Method": "<x-service-method>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Service-Method': '<x-service-method>', 'Content-Type': 'application/json'},
body: JSON.stringify({gameId: '<string>', limit: 50, skip: 0})
};
fetch('https://api.basement.fun/scores', 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.basement.fun/scores",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'gameId' => '<string>',
'limit' => 50,
'skip' => 0
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Service-Method: <x-service-method>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.basement.fun/scores"
payload := strings.NewReader("{\n \"gameId\": \"<string>\",\n \"limit\": 50,\n \"skip\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Service-Method", "<x-service-method>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.basement.fun/scores")
.header("X-Service-Method", "<x-service-method>")
.header("Content-Type", "application/json")
.body("{\n \"gameId\": \"<string>\",\n \"limit\": 50,\n \"skip\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.basement.fun/scores")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Service-Method"] = '<x-service-method>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"gameId\": \"<string>\",\n \"limit\": 50,\n \"skip\": 0\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"leaderboard": [
{
"_id": "<string>",
"nonce": "<string>",
"gameId": "<string>",
"normalizedAddress": "<string>",
"score": 123,
"updatedAt": 123,
"username": "<string>",
"avatar": "<string>"
}
]
}API Reference
Get Game Leaderboard
Retrieves data from the game leaderboard, providing you with information on player rankings and scores. It helps you monitor and display competitive standings within the game.
POST
/
scores
Get Game Leaderboard
curl --request POST \
--url https://api.basement.fun/scores \
--header 'Content-Type: application/json' \
--header 'X-Service-Method: <x-service-method>' \
--data '
{
"gameId": "<string>",
"limit": 50,
"skip": 0
}
'import requests
url = "https://api.basement.fun/scores"
payload = {
"gameId": "<string>",
"limit": 50,
"skip": 0
}
headers = {
"X-Service-Method": "<x-service-method>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Service-Method': '<x-service-method>', 'Content-Type': 'application/json'},
body: JSON.stringify({gameId: '<string>', limit: 50, skip: 0})
};
fetch('https://api.basement.fun/scores', 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.basement.fun/scores",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'gameId' => '<string>',
'limit' => 50,
'skip' => 0
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Service-Method: <x-service-method>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.basement.fun/scores"
payload := strings.NewReader("{\n \"gameId\": \"<string>\",\n \"limit\": 50,\n \"skip\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Service-Method", "<x-service-method>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.basement.fun/scores")
.header("X-Service-Method", "<x-service-method>")
.header("Content-Type", "application/json")
.body("{\n \"gameId\": \"<string>\",\n \"limit\": 50,\n \"skip\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.basement.fun/scores")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Service-Method"] = '<x-service-method>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"gameId\": \"<string>\",\n \"limit\": 50,\n \"skip\": 0\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"leaderboard": [
{
"_id": "<string>",
"nonce": "<string>",
"gameId": "<string>",
"normalizedAddress": "<string>",
"score": 123,
"updatedAt": 123,
"username": "<string>",
"avatar": "<string>"
}
]
}
HypeDuel