SpaceTraders OpenAPI (2.1.2)

Download OpenAPI specification:Download

A SpaceTraders.io API OpenAPI Spec from SpaceTraders Syndicate

Authentication

bearerAuth

Security Scheme Type HTTP
HTTP Authorization Scheme bearer
Bearer format "Bearer {token}"

flight plans

Create User Flight Plan

Authorizations:
Request Body schema: application/json
shipId
required
string
destination
required
string

Responses

Request samples

Content type
application/json
{
  • "shipId": "ckmtrlqpz0109zgopkeqs4m5s",
  • "destination": "OE-CR"
}

Response samples

Content type
application/json
{
  • "flightPlan": {
    }
}

Get a User Flight Plan

Authorizations:
path Parameters
flightPlanId
required
string
Example: ckmtrssae0402zgopsy39y9z7

Responses

Response samples

Content type
application/json
{
  • "flightPlan": {
    }
}

List Flight Plans

Authorizations:
path Parameters
symbol
required
string
Example: OE

Responses

Response samples

Content type
application/json
{
  • "flightPlans": [
    ]
}

game

Get Game Status

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "status": "spacetraders is currently online and available to play"
}

loans

Create a New Loan

Authorizations:
Request Body schema: application/json
type
required
string

Responses

Request samples

Content type
application/json
{
  • "type": "STARTUP"
}

Response samples

Content type
application/json
{
  • "credits": 200000,
  • "loan": {
    }
}

List User's Loans

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "loans": [
    ]
}

Payoff a Loan

Authorizations:
path Parameters
loanId
required
string
Example: cko0ejf4o103666215s6u4pxjvwg

Responses

Response samples

Content type
application/json
{
  • "user": {
    }
}

locations

Get Game Location

Authorizations:
path Parameters
symbol
required
string
Example: OE

Responses

Response samples

Content type
application/json
{
  • "location": {
    }
}

List Game Locations Ships

Authorizations:
path Parameters
symbol
required
string
Example: OE

Responses

Response samples

Content type
application/json
{
  • "ships": [
    ]
}

List System Locations

Authorizations:
path Parameters
symbol
required
string
Example: OE
query Parameters
type
string
Example: type=MOON

Filter locations fetched on location type

allowsConstruction
boolean
Example: allowsConstruction=true

Responses

Response samples

Content type
application/json
{
  • "locations": [
    ]
}

marketplace

Get Game Locations Marketplace

Authorizations:
path Parameters
symbol
required
string
Example: OE

Responses

Response samples

Content type
application/json
{
  • "marketplace": [
    ]
}

purchase orders

Create a New Purchase Order

Authorizations:
Request Body schema: application/json
shipId
required
string
good
required
string
quantity
required
number

Responses

Request samples

Content type
application/json
{
  • "shipId": "ckno92mhi0049iiopc2kmylkz",
  • "good": "FUEL",
  • "quantity": 50
}

Response samples

Content type
application/json
{
  • "credits": 74300,
  • "ship": {
    },
  • "order": {
    }
}

sell orders

Create a New Sell Order

Authorizations:
Request Body schema: application/json
shipId
required
string
good
required
string
quantity
required
number

Responses

Request samples

Content type
application/json
{
  • "shipId": "ckno92mhi0049iiopc2kmylkz",
  • "good": "FUEL",
  • "quantity": 50
}

Response samples

Content type
application/json
{
  • "credits": 74300,
  • "ship": {
    },
  • "order": {
    }
}

ships

Buy User Ship

Authorizations:
Request Body schema: application/json
type
required
string
location
required
string

Responses

Request samples

Content type
application/json
{
  • "type": "string",
  • "location": "string"
}

Response samples

Content type
application/json
{
  • "credits": 178875,
  • "ship": {
    }
}

List User's Ships

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "ships": [
    ]
}

Get User's Ship Info

Authorizations:
path Parameters
shipId
required
string
Example: ckno9324k0079iiop71j5nrob

Responses

Response samples

Content type
application/json
{
  • "ship": {
    }
}

Scrap User's Ship

Authorizations:
path Parameters
shipId
required
string
Example: ckno9324k0079iiop71j5nrob

Responses

Response samples

Content type
application/json
{
  • "success": "string"
}

Jettison Ship Cargo

Authorizations:
path Parameters
shipId
required
string
Example: ckno9324k0079iiop71j5nrob
Request Body schema: application/json
good
required
string
quantity
required
number

Responses

Request samples

Content type
application/json
{
  • "good": "FUEL",
  • "quantity": 50
}

Response samples

Content type
application/json
{
  • "good": "FUEL",
  • "quantityRemaining": 37,
  • "shipId": "cko1peqal178915s6t8rzdgki"
}

Transfer Ship Cargo

Authorizations:
path Parameters
fromShipId
required
string
Example: ckno9324k0079iiop71j5nrob
Request Body schema: application/json
toShipId
required
string
good
required
string
quantity
required
number

Responses

Request samples

Content type
application/json
{
  • "toShipId": "ckn85whu00091r5opkrb5qpzh",
  • "good": "FUEL",
  • "quantity": 50
}

Response samples

Content type
application/json
{
  • "fromShip": {
    },
  • "toShip": {
    }
}

List Game Ship Types

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "ships": [
    ]
}

List System Ships

Authorizations:
path Parameters
symbol
required
string
Example: OE

Responses

Response samples

Content type
application/json
{
  • "ships": [
    ]
}

List System Ship Listings

Authorizations:
path Parameters
symbol
required
string
Example: OE

Responses

Response samples

Content type
application/json
{
  • "shipListings": [
    ]
}

structures

Create User Structure

Authorizations:
Request Body schema: application/json
location
required
string
type
required
string

Responses

Request samples

Content type
application/json
{
  • "location": "OE",
  • "type": "FARM"
}

Response samples

Content type
application/json
{
  • "structure": {
    }
}

List User's Structures

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "structures": [
    ]
}

Get User's Structure Info

Authorizations:
path Parameters
structureId
required
string
Example: ckno69qb105191ds69utcsztz

Responses

Response samples

Content type
application/json
{
  • "structure": {
    }
}

Deposit Structure Inventory

Authorizations:
path Parameters
structureId
required
string
Example: ckno69qb105191ds69utcsztz
Request Body schema: application/json
shipId
required
string
good
required
string
quantity
required
number

Responses

Request samples

Content type
application/json
{
  • "shipId": "ckno69qb105191ds69utcsztz",
  • "good": "METAL",
  • "quantity": 40
}

Response samples

Content type
application/json
{
  • "transfer": {
    },
  • "ship": {
    },
  • "structure": {
    }
}

Transfer Structure Inventory

Authorizations:
path Parameters
structureId
required
string
Example: ckno69qb105191ds69utcsztz
Request Body schema: application/json
shipId
required
string
good
required
string
quantity
required
number

Responses

Request samples

Content type
application/json
{
  • "shipId": "ckno69qb105191ds69utcsztz",
  • "good": "METAL",
  • "quantity": 40
}

Response samples

Content type
application/json
{
  • "transfer": {
    },
  • "ship": {
    },
  • "structure": {
    }
}

List Game Structures

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "structures": [
    ]
}

List Structures

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "structures": [
    ]
}

systems

List Game Systems

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "systems": [
    ]
}

List System Locations

Authorizations:
path Parameters
symbol
required
string
Example: OE
query Parameters
type
string
Example: type=MOON

Filter locations fetched on location type

allowsConstruction
boolean
Example: allowsConstruction=true

Responses

Response samples

Content type
application/json
{
  • "locations": [
    ]
}

List Flight Plans

Authorizations:
path Parameters
symbol
required
string
Example: OE

Responses

Response samples

Content type
application/json
{
  • "flightPlans": [
    ]
}

List System Ships

Authorizations:
path Parameters
symbol
required
string
Example: OE

Responses

Response samples

Content type
application/json
{
  • "ships": [
    ]
}

List System Ship Listings

Authorizations:
path Parameters
symbol
required
string
Example: OE

Responses

Response samples

Content type
application/json
{
  • "shipListings": [
    ]
}

my

users

Claim Username and Get Token

Authorizations:
path Parameters
username
required
string
Example: MyUser

Responses

Response samples

Content type
application/json
{
  • "token": "096643df-72cc-40b5-95d3-514f47d3f9d9",
  • "user": {
    }
}

Get My Account

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "user": {
    }
}

types

List Game Structures

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "structures": [
    ]
}

List Game Loans

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "loans": [
    ]
}

List Game Ship Types

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "ships": [
    ]
}

List Good Types

Authorizations:

Responses

Response samples

Content type
application/json
{
  • "goods": [
    ]
}