GAVELTHORN MINECRAFT JAVA CATALOGUE — v2 API GUIDE https://api.gavelthorn.com/ These are recorded catalogue observations, NOT live pings or proof a server is online. Source-only and scanner-only addresses coexist. Response metadata may be unknown. This guide describes the canonical /v2/count and /v2/servers adapter currently routed on the public host; other /v2 endpoints can have different implementations. QUICK START GET /v2/servers?limit=8&sort=lastSeen&descending=true GET /v2/servers?country=JP&minPlayers=1&maxPlayers=10&limit=8 GET /v2/servers?version=%251.21%25&skip=8&limit=8 GET /v2/count?whitelisted=true GET /v2/credits POST /v2/servers with Content-Type: application/json and body {"country":"JP","minPlayers":1,"limit":8}. POST /v2/count with JSON object {"seenAfter":1790000000}. JSON body keys override same-named URL parameters; other URL parameters remain. Maximum body size is 64 KiB. Use URLSearchParams or an equivalent encoder: literal % in a URL parameter is encoded as %25. FILTERS (case-sensitive parameter names; combine distinct keys with AND) version: SQL LIKE pattern against recorded version name, not a semantic-version comparator. % matches any sequence; _ matches one character. Example version=%251.21%25 means contains 1.21. Explorer wraps entered text in %; entered % or _ remain wildcards. Case-sensitive according to database collation. minPlayers / maxPlayers: inclusive lower / upper bound on players.online, an observed online count, not capacity. playerCount: exact online count; playerLimit: exact advertised capacity. Integers only. No inferred value for unknown counts. country: exact country code (e.g. JP), not a country name; org: SQL LIKE text pattern. Location can be unknown. cracked / whitelisted: true, false, or null (the latter tests unknown with IS NULL). These are nullable booleans. Omitting the key means no restriction. Do not equate null with false. seenAfter / seenBefore: integer Unix epoch seconds, strictly greater / strictly less than recorded lastSeen. Recency is not liveness. protocol: integer protocol version in source schema; CURRENT LIVE LIMITATION: representative protocol=774 and protocol=767 both returned HTTP 500 Query failed on the active public adapter (2026-10-05). Do not rely on this filter until repaired and independently verified. Explorer deliberately does not offer it. Other source-defined parameters include ip (unsigned IPv4 integer), port, minIp/maxIp, description (LIKE), descriptionVector, full, hasFavicon, hasPlayerSample, hasPlayerHistory, enforcesSecureChat, vanilla, forge, onlinePlayer, onlineUuid, playerHistory, uuidHistory. Their operational characteristics are not all verified here; do not assume bot-only features are healthy on the public route. An individual filter may be expensive or fail even though it is accepted. Arrays and repeated keys can express alternatives (OR within a key); combinations of keys are AND. Each parameter accepts at most 100 values. Unknown keys are rejected. A JSON object with data and optional caseInsensitive is recognized for supported player-name history lookups; this is not a general fuzzy search. PAGINATION AND SORT /v2/servers defaults to limit=20, skip=0; limit is capped at 1000; skip must be a nonnegative safe integer. A limit of 0 yields an empty page with no database page query. skip is a row offset, NOT a page index. Sort accepts ONLY lastSeen or discovered; descending=true or false requires sort. Without sort, ordering is hostname then port; with sort, ascending unless descending=true, nulls last and hostname/port as tie breakers. Pages are not a snapshot: concurrent catalogue changes may shift offsets. Sorted filtered pages can take seconds; reduce filter complexity if the API times out. includePlayers=true adds playerHistory (potentially large); default false omits it. /v2/count accepts the same filter conditions but returns an exact matching count, not a page. Pagination and sort do not change that count. Filtered exact counts can exceed the read budget and return a timeout/failure; a successful first page is not a guarantee its count will finish. Bounded live checks on 2026-10-05 saw some filtered counts exceed 5 seconds (country=JP, minPlayers=1, maxPlayers=2, cracked=null, combined minPlayers=1&country=JP); whitelisted=true took 4.3 and 5.6 seconds in separate runs, and seenAfter=1790000000 took 3.8 seconds. Avoid polling costly filtered counts. BOUNDED LIVE EXPLORER FILTER GATE (2026-10-05, public host, read-only) Each representative page used limit=1; each count used the same predicate, with a 4-second client budget. One row returned is not a full distribution measurement, nor proof every value works. Page results: version=%1.21% (matched version 1.21.1, 0.101s), minPlayers=1 (online=1, 0.104s), maxPlayers=2 (online=1, 0.089s), country=JP (country=JP, 0.118s), cracked=null (null, 0.090s), whitelisted=true (true, 0.128s), seenAfter=1790000000 (lastSeen=1791206021, 0.070s), combined minPlayers=1&country=JP (online=1, country=JP, 0.150s): all HTTP 200, one matching row. Earlier whitelisted=true GET/POST page equivalence returned the same row. These are observations of selected values, not a promise for all combinations or sorts. The Explorer offers these as page filters only; its overview count is unfiltered. Corresponding exact counts: version, minPlayers, maxPlayers, country, cracked, seenAfter, and combined each hit the 4-second client deadline without a response (HTTP code unavailable, NOT zero). whitelisted=true returned HTTP 200 in 3.466s (prior runs ranged 4.3–5.6s). No filtered-count performance guarantee: do not build an interactive count-on-every-keystroke UI, and use a client deadline/backoff instead of repeated expensive queries. Protocol is a separate hard NO-GO (HTTP 500 on the active release) and has no Explorer control. This gate did not run a full distribution scan or change the live service. RESPONSES AND TYPES Successful /v2/servers: {"data":[server,...],"credits":number}; /v2/count: {"data":number,"credits":number}; /v2/credits: {"credits":number,"max":number}. Errors use {"error":string} without data. Treat each server field as an observed record, not a guaranteed currently valid property. server.ip: unsigned uint32 integer in network byte order, not dotted string. Convert with four octets (ip >>> 24, ip >>> 16 & 255, ip >>> 8 & 255, ip & 255). server.port: integer. server.discovered, server.lastSeen: decimal Unix-seconds strings or null depending on source; bigint database values are serialized as strings. Do not parse into a 32-bit integer or assume milliseconds. server.version: {name:string|null,protocol:number|null}; server.description, rawDescription: string|null (rawDescription may contain serialized JSON text); server.players: {max:number|null,online:number|null,hasPlayerSample:boolean|null}. max is advertised data and may be negative; it is NOT a validated positive capacity. server.hasFavicon, hasForgeData, enforcesSecureChat: boolean|null. server.org: string|null; server.geo: {country:string|null,city:string|null,lat:number|null,lon:number|null}. server.cracked, whitelisted: boolean|null. When requested, playerHistory is an array of {name, id, lastSession}; lastSession can be a decimal timestamp string. Render all server-controlled strings as text, never HTML. CREDITS, ERRORS, AND RATE LIMITS Active canonical adapter defaults to a per-client-address, in-memory budget of 20000 credits resetting on UTC hour boundaries (the server computes floor(Date.now()/3600000)); /v2/credits reports remaining and max without decrementing. Successful count costs 100 credits, even if the result is zero. A positive-limit page reserves/charges max(10, min(requested limit, remaining credits)) regardless of rows returned; limit=0 charges zero. A request arriving with used >= max returns HTTP 429 {"error":"Too many requests"}; a count costing 100 can bring remaining to zero. These semantics describe the canonical adapter and are not a promise about upstream proxy/CDN throttles. Do not rely on identity spoofing headers; the proxy supplies client identity. Errors, failed queries, and invalid requests do not charge credits in the adapter. Invalid parameters/body/pagination generally return HTTP 400; unsupported method HTTP 405; unknown path HTTP 404; exhausted credits HTTP 429. SQL statement timeout can return HTTP 503 {"error":"Query timeout"}; other database failures return HTTP 500 {"error":"Query failed"}. Some client-side query timeouts may also surface as 500; do not interpret a 500 as zero matches. CORS response header is Access-Control-Allow-Origin: * on this adapter, but this is not an access-policy guarantee for other routes. GET and POST JSON are supported for the documented catalogue endpoints; malformed JSON gets a 400 response. Treat errors and absent fields defensively and apply backoff rather than repeated broad scans. VERIFICATION NOTE The filter and timeout observations above were checked against the active adapter on 2026-10-05. Behaviour and catalogue contents can change; verify important requests again before integrating a mod.