面向程序、网站等的 JSON

text
https://api.gamemonitoring.cn/servers/3687501
json
{
  "response": {
    "steam_id": "85568392933527487",
    "domain": null,
    "id": 3687501,
    "ip": "90.187.15.37",
    "port": 27015,
    "query": 27016,
    "color": 0,
    "city": "Berlin",
    "description": "",
    "game": 227300,
    "owner": 61294,
    "boosts": 1,
    "last_offline": 1776196917,
    "score": null,
    "last_online": 1776800427,
    "icon": null,
    "name": "Irrenhaus 2.0",
    "connect": "90.187.15.37:27015",
    "request": "90.187.15.37:27016",
    "map": "europe",
    "gamemode": "Euro Truck Simulator 2",
    "version": null,
    "numplayers": 0,
    "maxplayers": 8,
    "bots": 0,
    "secured": false,
    "private": false,
    "country": "DE",
    "status": true,
    "votes": 0,
    "points": 60,
    "add_date": 1711992002,
    "last_update": 1776800427,
    "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": 44,
    "language": "de",
    "parked": false,
    "app": {
      "id": 1980,
      "steam_id": 227300,
      "name": "Euro Truck Simulator 2",
      "url": "euro-truck-simulator-2"
    },
    "server_owner": {
      "username": "tetriskillerh",
      "avatar": "f40569b4-e7a4-4d50-b685-3ca1e97d02c0.jpg",
      "last_online": 1712000841
    },
    "mods": [],
    "disabled_modules": []
  }
}

代码示例

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