NationZero public API
The game's public record as data, for your own tools: a map viewer, an election tracker, a war dashboard. Read-only and free. No sign-up needed to look around; an API key gives you more.
- Read onlyOnly GET works. Nothing here can change the game or act as a player: it answers as a stranger, always.
- An API key (optional)Make one in the game under YOU, Account, API key and send it in a header: you get instead of the public limit, and batch requests. A key that is not valid gets
401. - Be kindWithout a key at most . Ask no more often than the data changes: answers are kept for as long as that endpoint's data stays valid. Over the limit you get
429. - JSONAnswers are JSON. Times are UTC (ISO 8601). Money is in hundredths of RX. Ids differ per server: take one from a list endpoint.
Leave it empty to use the public limit. With a key, the buttons below send it as a header, to this address only. Make or replace your key in the game: YOU, Account, API key. Keep it to yourself: it is yours, and every call with it is counted.
Quick start
curl /v1/season
With your key, for the higher limit:
curl -H "Authorization: Bearer YOUR_API_KEY" /v1/season
Every endpoint lives under /v1. A path is written like /v1/war/wars/{id}: replace {id} with a real id. Arguments after a ? are optional unless it says required, and one that is not listed is refused with 400 unknown_parameter. The same list as data: /v1/spec.json.