API get server infos

Published on 2019-09-02

With this API, you can get your server informations like name of connected players, players count, numbers of votes...

The information depends on your server type. The information collected is the same as that of the widget visible in banners tab.

 Get server informations

You can get your server infos in JSON format by using this link. Replace XXXXXX with your server id. You will find your server id in the server edit form.


API response Definition

playerslist *

Get a list of all nickname connected on your server


Current players count and max players (if the server is offline, this variable = OFFLINE)


Get the host country code

Server category name

map *

Server map name

version *

Server version

resources *

Mods list installed on the server (string with seperator)


Number of votes on trackyserver


IP and server port

name *

Server name

 * if available
 Example with PHP cURL

// Replace XXXXXX by your server id on Trackyserver.com
$server_id = "XXXXXX";

// Execute curl and get server informations
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$result=json_decode(curl_exec($ch), true);

if ($result){
  // Example to print playerscount
  echo $result['playerscount'];	
  // Example to loop players list  
  foreach ($result['playerslist'] as $player){   
echo $player['name']; 
} // Use print_r($result); to print all informations array } else { echo "server not found"; }