'Steam API: How to query a server to get server info (not using A2S)?
I would like to know how to use the Steamworks Web API to query a server to get information (server name, game, map, players, etc.). I know that using the A2S query (https://developer.valvesoftware.com/wiki/Server_queries) can give that information, but I would like to know if it is possible using the Steamworks Web API instead.
Thanks!
Solution 1:[1]
With IGameServersService/GetServerList. Here is an example:
https://api.steampowered.com/IGameServersService/GetServerList/v1/?key=API_KEY&filter=addr\185.254.99.6:27015
For example, to get the map of a Garry's mod server, you can try the following (code example is in PHP):
$url = "https://api.steampowered.com/IGameServersService/GetServerList/v1/?key=API_KEY&filter=addr\185.254.99.6:27015";
$json = file_get_contents($url);
$table2 = json_decode($json, true);
$table = $table2["response"]["servers"][0];
$mapname = $table['map'];
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Toa |