<?php
$infos = file_get_content('https://minecraft-api.com/api/query/{ip}/{port}');
$json = file_get_content('https://minecraft-api.com/api/query/{ip}/{port}/json');
echo $infos;
echo $json;
?>
Plain text:
Array([HostName] => Asylyus [GameType] => SMP [GameName] => MINECRAFT [Version] => 1.8.x, 1.9.x, 1.10.x, 1.11.x, 1.12.x, 1.13.x, 1.14.x, 1.15.x [Plugins] => [Map] => World [Players] => 250 [MaxPlayers] => 500 [HostPort] => 25565 [HostIp] => 0.0.0.0 [Software] => Vanilla)
JSON:
{"HostName": "Asylyus" ...}
<?php
$hostname = file_get_content('https://minecraft-api.com/api/query/hostname/{ip}/{port}');
$json = file_get_content('https://minecraft-api.com/api/query/hostname/{ip}/{port}/json');
echo $hostname;
echo $json;
?>
Plain text:
Asylyus
JSON:
{"hostname": "Asylyus"}
<?php
$online = file_get_content('https://minecraft-api.com/api/query/online/{ip}/{port}');
$json = file_get_content('https://minecraft-api.com/api/query/online/{ip}/{port}/json');
echo $online;
echo $json;
?>
Plain text:
250
JSON:
{"online": "250"}
<?php
$maxplayers = file_get_content('https://minecraft-api.com/api/query/maxplayers/{ip}/{port}');
$json = file_get_content('https://minecraft-api.com/api/query/maxplayers/{ip}/{port}/json');
echo $maxplayers;
echo $json;
?>
Plain text:
500
JSON:
{"maxplayers": "500"}
<?php
$version = file_get_content('https://minecraft-api.com/api/query/version/{ip}/{port}');
$json = file_get_content('https://minecraft-api.com/api/query/version/{ip}/{port}/json');
echo $version;
echo $json;
?>
Plain text:
1.8.x, 1.9.x, 1.10.x, 1.11.x, 1.12.x, 1.13.x, 1.14.x, 1.15.x
JSON:
{"version": "1.8.x, 1.9.x, 1.10.x, 1.11.x, 1.12.x, 1.13.x, 1.14.x, 1.15.x"}