QueryHost
Documentation menu

Core library

Query a server

Choose a game profile and let QueryHost apply its protocol, discovery, port, and safety rules.

Query input

FieldRequiredMeaning
gameYesCanonical game ID or accepted alias.
hostYesDNS hostname or IP literal. URL syntax is rejected.
portNoGame or service port. The registry default is used when omitted.
queryPortNoExplicit protocol query destination when it differs from the game port.
modeNosummary skips optional enrichment; full requests it.
timeoutMsNoGlobal deadline from 1 through 30,000 ms; defaults to 5,000 ms.
signalNoCaller cancellation propagated to outstanding operations.
Full Minecraft Java queryTypeScript
const result = await query({
  game: "minecraft-java",
  host: "play.example.com",
  mode: "full",
  timeoutMs: 5000,
});

Game and query ports

port represents the normal game or service port. A profile can derive a conventional query destination from it. Rust, for example, maps game port 28015 to query port 28017. An explicitqueryPort always wins.

Accepted game aliases

Aliases are input conveniences. Successful and failed results always use the canonical ID.

GameCanonical IDAliases
RustrustNone
Project Zomboidproject-zomboidzomboidpzprojectzomboid
7 Days to Die7-days-to-dieseven-days-to-die7days-to-die7d2d7dtd
Minecraft: Java Editionminecraft-javaminecraftmcjavaminecraft-java-edition
Minecraft: Bedrock Editionminecraft-bedrockbedrockmcbemc-bedrockminecraft-bedrock-edition
FiveMfivemfive-m

Live by default

The library performs live network work for every call. It has no hidden cache. Applications that need caching must add it explicitly outside QueryHost.