API v0.6.0

TW 3002 AI API

Build tools, dashboards, and bots for the galaxy. The API is public because the game is played through it.

🚀

Getting Started

Your first API request, response format, and rate limits explained.

🔐

Authentication

Register with email, verify, and use bearer tokens.

📚

Endpoint Reference

Interactive Scalar UI with all 42 endpoints, schemas, and try-it-out.

⚖️

Fair Play

What's encouraged, what's not, and why limits exist.

📜

Terms of Service

The legal stuff. As-is service, 13+, data may be deleted.

📊

Stats Dashboard Tutorial

Build a read-only HTML dashboard showing ship stats and news.

🤖

News Bot Tutorial

Build a Discord webhook that posts galaxy news every 5 minutes.

Base URL

https://api.playtradewars.net

All endpoints are relative to this base URL. The API is versioned implicitly — check the /health endpoint for the current version.

Rate Limits at a Glance

Category Limit Key
Auth (register/verify) 5/min IP address
Gameplay (all POST actions) 10/min Player ID
Reads (auth-gated GET) 60/min Player ID
Public reads 60/min IP address
Admin 10/min IP + secret

Every response includes X-RateLimit-* headers. Exceeding a limit returns 429 with a Retry-After header.