gamestate
v0.5.0
Published
Universal game server status and player query tool
Maintainers
Readme
🎮 gamestate — Universal Game Server Status Query Tool
gamestate is a modern game server querying CLI & API for 40+ game types:
- Minecraft — Java (with SRV record support) & Bedrock
- Source engine (A2S) — CS2, CS:GO, CS:S, TF2, Garry's Mod, Left 4 Dead 2, Rust, ARK, Valheim, Squad, 7 Days to Die, Unturned, Project Zomboid, DayZ, Arma 3, Conan Exiles, Palworld, Insurgency, Mordhau, …
- FiveM / RedM — GTA V multiplayer (HTTP)
- Quake3
getstatus— Call of Duty (2/4/MW), Quake 3, Quake Live, OpenArena, Xonotic, Warsow, ET: Legacy - Multi Theft Auto: San Andreas (MTA:SA)
Run gamestate --list for the full list of aliases.
Works everywhere — even if UDP ports are blocked ✔
Automatic SRV resolution for Minecraft Java ✔
Reliable Steam API fallback for CS2 ✔
Clean and compact server info ✔
📦 Install
Global CLI:
npm install -g gamestatenpm install gamestate🖥️ CLI Usage
gamestate <game_type> <ip[:port]>Examples:
gamestate minecraft mc.hypixel.net
gamestate bedrock play.nethergames.org
gamestate cs2 51.210.246.171:27015
gamestate rust 1.2.3.4:28015
gamestate fivem 1.2.3.4:30120
gamestate cod4 1.2.3.4:28960
gamestate mta 91.200.42.46:22003
gamestate --list # show every supported game typeIf you omit the port, a sensible default is used per game (e.g. 27015 for
CS2, 28015 for Rust, 30120 for FiveM, 25565 for Minecraft). Minecraft
Java also resolves _minecraft._tcp SRV records automatically.
🧩 Node.js API Usage
import { query, supportedGames } from "gamestate";
const status = await query({
type: "minecraft",
host: "mc.hypixel.net"
// port is optional
});
console.log(status);
console.log(supportedGames()); // -> ["7dtd", "ark", "arma3", ...]🔑 Optional: Steam API Key (CS2 fallback)
CS2 servers are queried natively over UDP (A2S). When UDP is blocked or the
server does not answer, gamestate can fall back to the Steam Web API if you
provide a key. Copy .env.example to .env and set your key:
STEAM_API_KEY=your_key_hereGet a free key at https://steamcommunity.com/dev/apikey. Without a key, CS2 queries still work over UDP; only the blocked-UDP fallback is disabled.
📊 Returned Data Fields by Game Type
| Field | Minecraft Java | Minecraft Bedrock | CS2 | MTA:SA | Notes |
|------|:---:|:---:|:---:|:---:|------|
| name | ✔ | ✔ | ✔ | ✔ | Server name |
| numplayers | ✔ | ✔ | ✔ | ✔ | Active players |
| maxplayers | ✔ | ✔ | ✔ | ✔ | CS2 via A2S; Steam API used only if UDP is blocked |
| version | ✔ | ✔ | ✔ | ✔ | Game version |
| map | ❌ | ❌ | ✔ | ❌ | Only CS2 (A2S) reports the map |
| ping | ✔ | ✔ | ✔* | ❌ | *N/A when the Steam API fallback is used |
| gamemode | ❌ | ✔ | ❌ | ❌ | Bedrock only |
| players[] list | ✔ | ❌ | ❌ | ❌ | Minecraft Java sample (subset the server exposes) |
| protocol | ✔ | ✔ | ✔ | ✔ | Source of query |
| raw | ✔ | ✔ | ✔ | ✔ | Full response data |
