# relay.bitcraftsync.app > Community read-only mirror of the BitCraft MMORPG's SpacetimeDB game databases. It serves live game state two ways: a small JSON HTTP API for claims, players, inventories, Hexite deposits and storage logs, and raw SpacetimeDB WebSocket subscriptions for tools that need whole tables. Nothing here can change anything in the game. Not affiliated with Clockwork Labs or BitCraft Online; uptime and schema stability are best effort. No authentication. Be considerate: results are live, so cache what you fetch for at least a minute and do not poll in a loop. As a working budget, stay under 30 JSON API requests per minute per IP. WebSocket subscribe handshakes are enforced at 30 per minute per IP (short bursts of 10 allowed); beyond that the server answers 429 — open one long-lived connection rather than reconnecting. **If you can only make HTTP requests, use the JSON API below — it covers most questions about a claim or a player.** The WebSocket mirrors need a SpacetimeDB SDK client and are only worth it for bulk or streaming data. The home page's status tables and the data explorer are JavaScript-rendered; call `/health` instead of reading them. ## Machine-readable descriptions - [OpenAPI 3.1](https://relay.bitcraftsync.app/openapi.json): The JSON HTTP API — paths, parameters, error shape - [Protobuf schemas](https://relay.bitcraftsync.app/proto): JSON index of the `.proto` files that define every response field (`relay_cache.proto` for the API below) - [Fleet health](https://relay.bitcraftsync.app/health): JSON — mirrored databases, their ports and whether each is live - [Cache readiness](https://relay.bitcraftsync.app/cache-health): JSON — `ready` overall and per region; if false, API answers may be incomplete ## JSON HTTP API Ids are 64-bit integers sent as JSON strings; pass them back unchanged. Lookups are by name first, then by id. Errors are JSON `{"error": ""}` with a 4xx status, plus a stable `code` where one applies (an unknown id returns 404 with `"code": "not_found"`). `/claim` with no `name` returns 400. **Search by name** (case-insensitive substring; an empty result is `[]`): - `GET /claim?name=` → claims with `entity_id`, `name`, tier, owner, and `neutral` (true for game-owned locations such as caves and watchtowers, which have no members or storage). Use a specific name: a short common word can return hundreds of kilobytes. - `GET /player?name=` → players with `entity_id`, `username`, `region`, `signed_in`, `last_active_timestamp`. **Claim detail** (`` = a claim `entity_id`): - `GET /claim/` → supplies, upkeep, treasury, tier, researched techs, location - `GET /claim//inventory` → contents of the claim's shared storage buildings (Town Banks are not included) - `GET /claim//members` → roster with roles, skill levels, hexcoins, last login - `GET /claim//crafts` → crafts at the claim; optional `?completed=true|false` **Player detail** (`` = a player `entity_id`): - `GET /player/` → profile - `GET /player//inventory` → pockets, toolbelt, wallet, bank, wagon, cache, boat, recovery - `GET /player//housing` → the player's house and its storage (`status` is `ok` or `noHouse`) - `GET /player//skills` → experience and level per profession - `GET /player//crafts` → the player's crafts; optional `?completed=true|false` **Leaderboard** (every player, ranked; see the [OpenAPI](https://relay.bitcraftsync.app/openapi.json) for the fields): - `GET /leaderboard` → the board. Optional `profession=`, `region=`, `q=`, `sort=xp|level`, `limit=` (≤ 500, default 100), `offset=`. `level`/`xp` are the profession's, or the totals with no `profession`. `q` only narrows the rows: `rank` stays the full-board rank. A player's `region` is where they are now, or where they last logged out. - `GET /leaderboard/options` → the professions and regions to offer in the pickers Boards are reused for 5 s and the route is rate limited per IP (30 requests/minute): poll no faster than every 10 s. While regions are still loading the answer is 503 with `"code": "cache_syncing"` and a `Retry-After` header. **World:** - `GET /deposits` → Hexite deposits with coordinates; depleted ones carry `respawn_at`. Optional `?region=`. - `GET /storage-logs` → deposit/withdraw history for the last ~15 days. Exactly one mode per request: `storageId=`, or `playerId=`, or `itemId=` with `claimId=` or `playerId=`. Optional `itemType=Item|Cargo`, `region=`, `limit=` — always set `limit`. Inventories list items by numeric id. Item, cargo and building names are static files on the companion site — download once and look up locally: [item.json](https://bitcraftsync.app/item.json), [cargo.json](https://bitcraftsync.app/cargo.json), [building.json](https://bitcraftsync.app/building.json). ## Regions Nine regions hold player settlements: 7, 8, 9, 12, 13, 14, 17, 18, 19, plus a `global` database for reference data. `/health` lists the current set. ## Higher-level tools [bitcraftsync.app](https://bitcraftsync.app/llms.txt) builds on this API: crafting-progress calculation ("what is still missing to build X at claim Y"), settlement layout validation, and region maps. Prefer it for those questions. ## Raw SpacetimeDB mirrors (needs an SDK client) - Subscribe: `wss://relay.bitcraftsync.app:/v1/database//subscribe` — database `idc-global` on port 3000, region N is `idc-` on port 3000+N - Table schema as JSON: `https://relay.bitcraftsync.app:/v1/database//schema?version=9` - Read-only: reducer calls and one-off queries are rejected. Subscribe to tables and filter on your side. - [Tutorial](https://relay.bitcraftsync.app/tutorial/): Connecting, subscribing, reading the schema (plain HTML) ## Roads and terrain `/roads/*` serves protobuf only, and a region snapshot is about 280 MiB. Not suitable for conversational use; see the [roads tutorial](https://relay.bitcraftsync.app/tutorial/roads.html) if you are writing a program.