Documentation

Getting started

The Economics and War API is a versioned, read-only HTTP JSON API. Everything is served over HTTPS and returns UTF-8 JSON.

Base URLs
https://economicsandwar.com/api/v1        # canonical
https://economicsandwar.com/api/public/v1 # identical mirror for external callers

Use the mirror for Discord bots, cron pollers and any caller outside a browser session. Both surfaces behave identically and share rate limits per key.

Your first request
curl https://economicsandwar.com/api/v1/nations?limit=5

curl https://economicsandwar.com/api/v1/me/nation \
  -H "Authorization: Bearer eaw_live_xxxxxxxxxxxxxxxxx"
Pagination

List endpoints accept ?page= (from 1) and ?limit= (1–100, default 25).

{
  "data": [ ... ],
  "pagination": { "page": 1, "limit": 25, "total": 812, "pages": 33 }
}
Rate limits
  • Unauthenticated: 60 requests per minute per IP.
  • Authenticated key: 120 requests per minute per key (configurable for approved apps).
  • Every response carries x-ratelimit-limit, x-ratelimit-remaining and x-ratelimit-reset.
  • Exceeding a limit returns 429 Too Many Requests with retry-after. It is temporary and never an automatic ban.
Errors
{
  "error": {
    "code": "insufficient_scope",
    "message": "Missing required scope: military.read",
    "request_id": "1f0c1c8e-..."
  }
}

Quote the request_id (also returned as the x-request-id header) when reporting an issue.

Privacy and competitive integrity

Information is classified as public, player-private, alliance-private or admin-only. The API cannot be used to bypass espionage: exact enemy reserves, readiness, strategic stockpiles, hidden production queues, private alliance assignments and treasury detail are never returned for nations other than the key owner.

What third-party apps can never do
  • Launch nuclear or strategic weapons
  • Declare or resolve wars
  • Transfer Credits or resources
  • Withdraw from an alliance treasury
  • Perform espionage
  • Accept or sign treaties
  • Modify alliance permissions or ranks
  • Delete accounts or nations
  • Any irreversible strategic action