SpaceTradersAPI API

Games & Comics / OAuth Advanced HTTPS CORS
Varies by plan (check documentation)

Overview

SpaceTraders is a programmable MMORPG where you control a fleet of spaceships through a REST API, trading goods and exploring the galaxy. You register an agent to receive an access token and then issue commands to navigate, mine resources, and negotiate trade routes. It is a uniquely engaging way to learn API programming through an actual game.

💡

Beginner Tip

Start by registering a new agent with a POST to /v2/register to get your bearer token. Keep this token safe — losing it means starting a new agent with a different name.

Available Data

stock price and symbol
open/close/high/low values
trading volume
market cap
historical price data
space mission data

Example Response

JSON Response
{
  "title": "Astronomy Picture of the Day",
  "date": "2025-01-15",
  "explanation": "A stunning nebula captured by the James Webb Telescope...",
  "url": "https://apod.nasa.gov/apod/image/...",
  "media_type": "image"
}

Field Reference

token Bearer authentication token returned on registration, required for all subsequent requests
agent.symbol Your unique agent call sign in the game world
agent.credits Current in-game currency balance of your agent
agent.headquarters Waypoint symbol of your agent starting location
ship.nav.status Current navigation status: IN_TRANSIT, IN_ORBIT, or DOCKED

Implementation Example

const url = "https://spacetraders.io/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "Authorization": "Bearer YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

401 Unauthorized Missing or incorrect Bearer token in the Authorization header
Include -H "Authorization: Bearer YOUR_TOKEN" in every authenticated request after registration
409 Conflict on registration Agent symbol (name) is already taken by another player
Choose a unique agent symbol; names are globally unique across all active players
422 Unprocessable Entity Invalid game action such as navigating to an unreachable waypoint
Check the ship current system and only navigate to waypoints within the same system or via a jump gate

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 5/20
🔒 Security 15/15
🛠 Developer XP 8/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth OAuth
HTTPS REQUIRED
CORS YES
Category Games & Comics
Difficulty Advanced
Verified: 2026-04-04

Similar APIs

View All →