A reference for the public Battle Nations unit dataset. Per-unit JSON files at
data/units/<id>.json are canonical; the aggregate
data/units.json is generated from them.
Overview
This page sits on top of the public dataset and answers three questions: what is in the dataset, what shape it has, and how to query it without reading the application repo.
One HTML document, one stylesheet, one script. The browser below loads
./data/units.json directly — no API, no build step. Every URL shown here is a
working URL.
Quickstart
Fetch the aggregate
fetch("https://data.bn-db.com/data/units.json")
.then((response) => response.json())
.then((units) => console.log(units.length));
Fetch one unit
fetch("https://data.bn-db.com/data/units/1.json")
.then((response) => response.json())
.then((unit) => console.log(unit.name));
Schema
The dataset is JSON, but a TypeScript declaration ships alongside it. Drop
types/unit.d.ts
into a project and import the Unit type directly. The full file is below.
types/unit.d.ts
Loading types…
Field groups, in plain English:
- Identity & taxonomy
id,name,category,unitType,affiliation— the main browse keys.- Progression & economy
unlockLevel,building,buildingLevel,productionTime,cost— describe acquisition.- Stats by rank
stats.ranks[]holds survivability and core performance values at each rank.- Actions & attack data
actions[]contains attack metadata, patterns, cooldowns, damage ranges, and per-rank tuning.- Defenses & rules
resistances,immunities,blockingdescribe combat interactions easy to miss in basic summaries.- Canonical vs. generated
data/units/<id>.jsonis canonical.data/units.jsonis generated. App-only summaries belong elsewhere.
Explorer
Search by name, description, building, affiliation, category, or unit type. Selecting a unit reveals its public JSON shape and direct file path.
Loading unit data…
Rules
- Edit per-unit files (
data/units/<id>.json), not the generated aggregate. - Bring source evidence with every correction.
- Treat image URLs as references; not all are guaranteed hosted assets in this repo.
- Schema cleanup is a separate workstream — preserve canonical field semantics in data PRs.