Server Status - LegionPE/API-Docs GitHub Wiki
Server
Status.php
is used for fetching data about server(s) in the network.
GET /api/Status.php
Using server ID as key
If you have a server ID (usually three/four digit integer), you can use it as the parameter.
Example:
GET /api/Status.php?sid=785&pretty
{
"status": true,
"error": null,
"data": {
"server": {
"onlinePlayers": 0,
"maxPlayers": 50,
"class": 1,
"lastOnline": 1440939636,
"serverId": 785,
"ip": "theta.legionpvp.eu",
"port": 19132,
"_meta_class": "ServerStatus"
}
}
}
You can also search a server using its IP and port.
GET /api/Status.php?ip=theta.legionpvp.eu&port=19132&pretty
{
"status": true,
"error": null,
"data": {
"server": {
"onlinePlayers": 0,
"maxPlayers": 50,
"class": 1,
"lastOnline": 1440939703,
"serverId": 785,
"ip": "theta.legionpvp.eu",
"port": 19132,
"_meta_class": "ServerStatus"
}
}
}
You can list the servers of a certain gametype using the class
parameter.
GET /api/Status.php?class=1&pretty
{
"status": true,
"error": null,
"data": {
"servers": {
"785": {
"onlinePlayers": 0,
"maxPlayers": 50,
"class": 1,
"lastOnline": 1440939888,
"serverId": 785,
"ip": "theta.legionpvp.eu",
"port": 19132,
"_meta_class": "ServerStatus"
},
"786": {
"onlinePlayers": 0,
"maxPlayers": 45,
"class": 1,
"lastOnline": 1440939887,
"serverId": 786,
"ip": "theta.legionpvp.eu",
"port": 19133,
"_meta_class": "ServerStatus"
}
}
}
}
Or you can simply list all servers directly:
GET /api/Status.php?pretty
{
"status": true,
"error": null,
"data": {
"servers": {
"785": {
"onlinePlayers": 0,
"maxPlayers": 50,
"class": 1,
"lastOnline": 1440918721,
"serverId": 785,
"ip": "theta.legionpvp.eu",
"port": 19132,
"_meta_class": "ServerStatus"
},
"786": {
"onlinePlayers": 0,
"maxPlayers": 45,
"class": 1,
"lastOnline": 1440918722,
"serverId": 786,
"ip": "theta.legionpvp.eu",
"port": 19133,
"_meta_class": "ServerStatus"
},
"801": {
"onlinePlayers": 0,
"maxPlayers": 40,
"class": 2,
"lastOnline": 1440918721,
"serverId": 801,
"ip": "176.31.252.118",
"port": 5002,
"_meta_class": "ServerStatus"
},
"865": {
"onlinePlayers": 2,
"maxPlayers": 35,
"class": 6,
"lastOnline": 1440918721,
"serverId": 865,
"ip": "theta.legionpvp.eu",
"port": 5005,
"_meta_class": "ServerStatus"
}
}
}
}