面向程序、网站等的 JSON

text
https://api.gamemonitoring.cn/servers/5560227
json
{
  "response": {
    "steam_id": "85568392928883245",
    "domain": null,
    "id": 5560227,
    "ip": "142.54.172.194",
    "port": 27100,
    "query": 27100,
    "color": 0,
    "city": "Kansas City",
    "description": null,
    "game": 304930,
    "owner": null,
    "boosts": 1,
    "last_offline": 1775910716,
    "score": 0,
    "last_online": 1776105626,
    "icon": "https://i.ibb.co/syBzP64/brown-no-background.png",
    "name": "DeadAlive Limestone PVE #9",
    "connect": "142.54.172.194:27100",
    "request": "142.54.172.194:27100",
    "map": "Limestone",
    "gamemode": "Kits|TPA|Home|Shop|AntiGrief|Garage",
    "version": "3.26.2.2",
    "numplayers": 1,
    "maxplayers": 35,
    "bots": 0,
    "secured": true,
    "private": false,
    "country": "US",
    "status": true,
    "votes": 0,
    "points": 32,
    "add_date": 1723304854,
    "last_update": 1776105626,
    "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": 87,
    "language": "en",
    "parked": false,
    "app": {
      "id": 48,
      "steam_id": 304930,
      "name": "Unturned",
      "url": "unturned"
    },
    "server_owner": null,
    "mods": [],
    "disabled_modules": []
  }
}

代码示例

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