This page documents the available API endpoints for retrieving leaderboard data from SpawnBoard. All responses are in JSON format.
Returns the entirety of the leaderboard as JSON. This endpoint provides a complete list of all servers in the leaderboard.
import requests
url = "https://spawnboard.pages.dev/leaderboard/all"
response = requests.get(url)
if response.status_code == 200:
servers = response.json()
for server in servers:
print(f"Server: {server['server_name']}, Members: {server['member_count']}")
else:
print("Error:", response.status_code)
This example fetches the full leaderboard and cycles through each server to print its name and member count.
import requests
url = "https://spawnboard.pages.dev/leaderboard/all"
guild_id = "1395961465672040459" # Replace with the desired guild ID
response = requests.get(url)
if response.status_code == 200:
servers = response.json()
specific_server = next((server for server in servers if server['guild_id'] == guild_id), None)
if specific_server:
print(f"Server: {specific_server['server_name']}, Members: {specific_server['member_count']}")
else:
print("Guild not found")
else:
print("Error:", response.status_code)
This example fetches the full leaderboard and retrieves information for a server with a specific guild ID.
Returns the top {amount} servers from the leaderboard as JSON. Replace {amount} with the number of top servers you want to retrieve (e.g., /leaderboard/top/10).
import requests
amount = 10
url = f"https://spawnboard.pages.dev/leaderboard/top/{amount}"
response = requests.get(url)
if response.status_code == 200:
servers = response.json()
for server in servers:
print(f"Server: {server['server_name']}, Members: {server['member_count']}")
else:
print("Error:", response.status_code)
This example fetches the top servers and cycles through each to print its name and member count.
import requests
amount = 10
url = f"https://spawnboard.pages.dev/leaderboard/top/{amount}"
guild_id = "1395961465672040459" # Replace with the desired guild ID
response = requests.get(url)
if response.status_code == 200:
servers = response.json()
specific_server = next((server for server in servers if server['guild_id'] == guild_id), None)
if specific_server:
print(f"Server: {specific_server['server_name']}, Members: {specific_server['member_count']}")
else:
print("Guild not found in top {amount}")
else:
print("Error:", response.status_code)
This example fetches the top servers and retrieves information for a server with a specific guild ID if it is within the top results.
Returns the 'total' values of SpawnBoard such as number of servers and server members. And returns basic information of the largest and smallest server.