面向程序、网站等的 JSON

text
https://api.gamemonitoring.cn/servers/11156070
json
{
  "response": {
    "steam_id": null,
    "domain": "hirayasmp.com",
    "id": 11156070,
    "ip": "185.207.166.113",
    "port": 19132,
    "query": 19132,
    "color": 0,
    "city": "Amsterdam",
    "description": null,
    "game": 9000034,
    "owner": null,
    "boosts": 1,
    "last_offline": 1775658134,
    "score": 0,
    "last_online": 1776821428,
    "icon": null,
    "name": "HIRAYA SMP",
    "connect": "hirayasmp.com:19132",
    "request": "185.207.166.113:19132",
    "map": "ꜱᴇᴀꜱᴏɴ ᴠ ʀᴇʟᴇᴀꜱᴇᴅ!",
    "gamemode": "Survival",
    "version": "26.10",
    "numplayers": 125,
    "maxplayers": 250,
    "bots": 0,
    "secured": null,
    "private": null,
    "country": "NL",
    "status": true,
    "votes": 0,
    "points": 50,
    "add_date": 1772227986,
    "last_update": 1776821428,
    "banned": false,
    "wipe": null,
    "official": null,
    "wipe_period": null,
    "next_wipe": null,
    "pve": null,
    "pvp": null,
    "list_hidden": false,
    "hide_address": false,
    "hide_query": false,
    "position_game": 162,
    "language": "nl",
    "parked": false,
    "app": {
      "id": 169,
      "steam_id": 9000034,
      "name": "Minecraft",
      "url": "minecraft"
    },
    "server_owner": null,
    "mods": [],
    "disabled_modules": []
  }
}

代码示例

php
<?php
$json = file_get_contents("https://api.gamemonitoring.cn/servers/11156070");
$data = json_decode($json, true);
var_dump($data);