面向程序、网站等的 JSON

text
https://api.gamemonitoring.cn/servers/10454546
json
{
  "response": {
    "channels": {
      "onlinecount": 1,
      "items": [
        {
          "clients": 1,
          "id": 169788,
          "items": [],
          "name": "Default Channel",
          "order": 0,
          "parent_id": 0,
          "topic": "Default Channel has no topic"
        }
      ]
    },
    "external_id": "f9AtaJ650GUUIEbFp1Mx423edLY=",
    "platform": "Linux",
    "created": 1580494756,
    "uptime": 9492373,
    "steam_id": null,
    "domain": null,
    "id": 10454546,
    "ip": "51.254.61.101",
    "port": 9987,
    "query": 10011,
    "color": 0,
    "city": "Saarbrücken",
    "description": "**Die Adresse ist nicht vollständig!**\\r\nBitte überprüfen Sie die Adresse und versuchen Sie es erneut.",
    "game": 9000043,
    "owner": null,
    "boosts": 1,
    "last_offline": 1768641226,
    "score": 0,
    "last_online": 1776052814,
    "icon": null,
    "name": "TS3index.com",
    "connect": "51.254.61.101:9987",
    "request": "51.254.61.101:10011",
    "map": null,
    "gamemode": null,
    "version": "3.13.6 Build: 1623234157",
    "numplayers": 1,
    "maxplayers": 0,
    "bots": 0,
    "secured": null,
    "private": false,
    "country": "DE",
    "status": true,
    "votes": 0,
    "points": 60,
    "add_date": 1760048183,
    "last_update": 1776052814,
    "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": 152,
    "language": "de",
    "parked": false,
    "app": {
      "id": 1629110,
      "steam_id": 9000043,
      "name": "Teamspeak 3",
      "url": "teamspeak-3"
    },
    "server_owner": null,
    "mods": [],
    "disabled_modules": []
  }
}

代码示例

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