Data Endpoints
This page provides information about GameCMS data endpoints that can be used to integrate with your website or application.
CS2 Leaderboards Search
GET
/leaderboards/cs2-search?query={search_term}
Returns CS2 leaderboard data for players matching the search term.
Request
Parameter | Type | Required | Description |
---|---|---|---|
query | string | ✅ Yes | The Steam ID or player name to search for. Must be at least 2 characters long. |
Response
{
"399": {
"plugin_name": "zenith-leaderboards",
"display_name": "HH-GAMING",
"url_path": "hh-gaming",
"data": [
{
"name": "Wohaho",
"kills": 0,
"firstblood": 0,
"deaths": 0,
"assists": 0,
"shoots": 0,
"points": 0,
"profile": "/leaderboards/hh-gaming/profile/76561198999172665",
"steam": {
"profileurl": "https://steamcommunity.com/id/wohaho/",
"avatar": "https://avatars.steamstatic.com/3ea877b033f0d375eed8023770a6e3bfed386315.jpg",
"realname": "Aleksandar",
"personaname": "Wohaho"
},
"faceit": {
"faceit_elo": 1000,
"skill_level": 4,
"region": "EU",
"country": "bg",
"steam_id": "76561198999172665",
"steam_nickname": "Wohaho"
}
}
]
}
}
Usage Example
fetch('/leaderboards/cs2-search?query=Wohaho')
.then(response => response.json())
.then(data => {
const serverKey = Object.keys(data)[0]; // e.g., "399"
const playerData = data[serverKey].data[0];
console.log(`Player: ${playerData.name}, Kills: ${playerData.kills}`);
});
General Usage Notes
All API endpoints return JSON responses. Use standard HTTP fetch methods to retrieve data:
// Basic pattern for fetching data
fetch('/endpoint/path')
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.then(data => {
// Process the data here
console.log(data);
})
.catch(error => {
console.error('Error fetching data:', error);
});