Getting Started

First Request

No auth required β€” just hit the health endpoint:

curl https://api.playtradewars.net/health

Response:

{
  "status": "ok",
  "version": "0.6.0"
}

Response Format

Every response is JSON. The API uses two top-level shapes:

Success:

{
  "success": true,
  ...data
}

Error:

{
  "error": "human-readable message"
}

HTTP Status Codes

CodeMeaning
200OK
400Bad request (missing/invalid params)
401Unauthorized (missing/invalid token)
403Forbidden (insufficient action points, not in sector, etc.)
404Not found
405Method not allowed
409Conflict (fighter encounter required)
429Rate limit exceeded
500Internal server error

Rate Limit Headers

Every response includes rate limit headers:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1717342800

If you hit a limit, you get 429 with a Retry-After header:

Retry-After: 45

Action Budget Headers

Gameplay responses include action point headers:

X-ActionPoints-Remaining: 47

If you’re out of points:

X-ActionPoints-Remaining: 0
X-ActionPoints-NextRefill: 5

Next Steps