BEDROCK

API - Bedrock Edition

Information: These routes use the RakNet protocol (UDP) specific to the Bedrock client (mobile, console, Windows 10/11) — different from the Java Edition protocol used by the PING and QUERY APIs. The default port of a Bedrock server is 19132 (not 25565).
Explanation of parameters
  • ip Bedrock server address: play.example.com
  • port Server port: 19132 by default
  • format=json Add this parameter to get a structured JSON response instead of plain text
Obligatory parameter Optional parameter
Getting the status
<?php
$statut = file_get_contents('https://minecraft-api.com/api/bedrock/status.php?ip={ip}&port={port}');
$json = file_get_contents('https://minecraft-api.com/api/bedrock/status.php?ip={ip}&port={port}&format=json');
echo $statut;
echo $json;
?>
Response from API
Plain text:

En ligne

JSON:

{"status": "En ligne", "edition": "MCPE", "motd_line1": "Serveur Bedrock", "protocol_version": 686, "version_name": "1.21.0", "players_online": 12, "players_max": 100, ...}

Getting the MOTD
<?php
$motd = file_get_contents('https://minecraft-api.com/api/bedrock/motd.php?ip={ip}&port={port}');
echo $motd;
?>
Response from API
Plain text:

Serveur Bedrock - Survie

JSON:

{"motd": "Serveur Bedrock - Survie"}

Getting the number of connected players
<?php
$online = file_get_contents('https://minecraft-api.com/api/bedrock/playeronline.php?ip={ip}&port={port}');
echo $online;
?>
Response from API
Plain text:

12

JSON:

{"online": "12"}

Getting the number of allowed players
<?php
$maxplayers = file_get_contents('https://minecraft-api.com/api/bedrock/maxplayer.php?ip={ip}&port={port}');
echo $maxplayers;
?>
Response from API
Plain text:

100

JSON:

{"maxplayers": "100"}

Getting the version
<?php
$version = file_get_contents('https://minecraft-api.com/api/bedrock/version.php?ip={ip}&port={port}');
echo $version;
?>
Response from API
Plain text:

1.21.0

JSON:

{"version": "1.21.0", "protocol": 686}