Spacetraders

SpaceTradersAPI

SpaceTraders is an open-universe game and learning platform that offers a set of HTTP endpoints to control a fleet of ships and explore a multiplayer…

Media & content#games--comics

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

SpaceTraders is an open-universe game and learning platform that offers a set of HTTP endpoints to control a fleet of ships and explore a multiplayer universe.

The API is documented using OpenAPI. You can send your first request right here in your browser to check the status of the game server.

{
  "method": "GET",
  "url": "https://api.spacetraders.io/v2",
}

Unlike a traditional game, SpaceTraders does not have a first-party client or app to play the game. Instead, you can use the API to build your own client, write a script to automate your ships, or try an app built by the community.

We have a Discord channel where you can share your projects, ask questions, and get help from other players.

Endpoints 59

Agents

  • GETGet Agent/my/agentFetch your agent's details.
  • GETList Agents/agentsFetch agents details.
  • GETGet Public Agent/agents/:agentSymbolFetch agent details.

Contracts

  • GETList Contracts/my/contractsReturn a paginated list of all your contracts.
  • GETGet Contract/my/contracts/:contractIdGet the details of a contract by ID.
  • POSTAccept Contract/my/contracts/:contractId/acceptAccept a contract by ID. You can only accept contracts that were offered to you, were not accepted yet, and whose deadlines has not passed yet.
  • POSTDeliver Cargo to Contract/my/contracts/:contractId/deliverDeliver cargo to a contract. In order to use this API, a ship must be at the delivery location (denoted in the delivery terms as destinationSymbol of a…
  • POSTFulfill Contract/my/contracts/:contractId/fulfillFulfill a contract. Can only be used on contracts that have all of their delivery terms fulfilled.

Factions

  • GETList Factions/factionsReturn a paginated list of all the factions in the game.
  • GETGet Faction/factions/:factionSymbolView the details of a faction.

Fleet

  • GETList Ships/my/shipsReturn a paginated list of all of ships under your agent's ownership.
  • POSTPurchase Ship/my/shipsPurchase a ship from a Shipyard. In order to use this function, a ship under your agent's ownership must be in a waypoint that has the Shipyard trait, and the…
  • GETGet Ship/my/ships/:shipSymbolRetrieve the details of a ship under your agent's ownership.
  • GETGet Ship Cargo/my/ships/:shipSymbol/cargoRetrieve the cargo of a ship under your agent's ownership.
  • POSTOrbit Ship/my/ships/:shipSymbol/orbitAttempt to move your ship into orbit at its current location. The request will only succeed if your ship is capable of moving into orbit at the time of the…
  • POSTShip Refine/my/ships/:shipSymbol/refineAttempt to refine the raw materials on your ship. The request will only succeed if your ship is capable of refining at the time of the request. In order to be…
  • POSTCreate Chart/my/ships/:shipSymbol/chartCommand a ship to chart the waypoint at its current location. Most waypoints in the universe are uncharted by default. These waypoints have their traits…
  • GETGet Ship Cooldown/my/ships/:shipSymbol/cooldownRetrieve the details of your ship's reactor cooldown. Some actions such as activating your jump drive, scanning, or extracting resources taxes your reactor…
  • POSTDock Ship/my/ships/:shipSymbol/dockAttempt to dock your ship at its current location. Docking will only succeed if your ship is capable of docking at the time of the request. Docked ships can…
  • POSTCreate Survey/my/ships/:shipSymbol/surveyCreate surveys on a waypoint that can be extracted such as asteroid fields. A survey focuses on specific types of deposits from the extracted location. When…
  • POSTExtract Resources/my/ships/:shipSymbol/extractExtract resources from a waypoint that can be extracted, such as asteroid fields, into your ship. Send an optional survey as the payload to target specific…
  • POSTSiphon Resources/my/ships/:shipSymbol/siphonSiphon gases or other resources from gas giants. The ship must be in orbit to be able to siphon and must have siphon mounts and a gas processor installed.
  • POSTExtract Resources with Survey/my/ships/:shipSymbol/extract/surveyUse a survey when extracting resources from a waypoint. This endpoint requires a survey as the payload, which allows your ship to extract specific yields.…
  • POSTJettison Cargo/my/ships/:shipSymbol/jettisonJettison cargo from your ship's cargo hold.
  • POSTJump Ship/my/ships/:shipSymbol/jumpJump your ship instantly to a target connected waypoint. The ship must be in orbit to execute a jump. A unit of antimatter is purchased and consumed from the…
  • POSTNavigate Ship/my/ships/:shipSymbol/navigateNavigate to a target destination. The ship must be in orbit to use this function. The destination waypoint must be within the same system as the ship's…
  • GETGet Ship Nav/my/ships/:shipSymbol/navGet the current nav status of a ship.
  • PATCHPatch Ship Nav/my/ships/:shipSymbol/navUpdate the nav configuration of a ship. Currently only supports configuring the Flight Mode of the ship, which affects its speed and fuel consumption.
  • POSTWarp Ship/my/ships/:shipSymbol/warpWarp your ship to a target destination in another system. The ship must be in orbit to use this function and must have the Warp Drive module installed.…
  • POSTSell Cargo/my/ships/:shipSymbol/sellSell cargo in your ship to a market that trades this cargo. The ship must be docked in a waypoint that has the Marketplace trait in order to use this function.
  • POSTScan Systems/my/ships/:shipSymbol/scan/systemsScan for nearby systems, retrieving information on the systems' distance from the ship and their waypoints. Requires a ship to have the Sensor Array mount…
  • POSTScan Waypoints/my/ships/:shipSymbol/scan/waypointsScan for nearby waypoints, retrieving detailed information on each waypoint in range. Scanning uncharted waypoints will allow you to ignore their uncharted…
  • POSTScan Ships/my/ships/:shipSymbol/scan/shipsScan for nearby ships, retrieving information for all ships in range. Requires a ship to have the Sensor Array mount installed to use. The ship will enter a…
  • POSTRefuel Ship/my/ships/:shipSymbol/refuelRefuel your ship by buying fuel from the local market. Requires the ship to be docked in a waypoint that has the Marketplace trait, and the market must be…
  • POSTPurchase Cargo/my/ships/:shipSymbol/purchasePurchase cargo from a market. The ship must be docked in a waypoint that has Marketplace trait, and the market must be selling a good to be able to purchase…
  • POSTTransfer Cargo/my/ships/:shipSymbol/transferTransfer cargo between ships. The receiving ship must be in the same waypoint as the transferring ship, and it must able to hold the additional cargo after…
  • POSTNegotiate Contract/my/ships/:shipSymbol/negotiate/contractNegotiate a new contract with the HQ. In order to negotiate a new contract, an agent must not have ongoing or offered contracts over the allowed maximum…
  • GETGet Mounts/my/ships/:shipSymbol/mountsGet the mounts installed on a ship.
  • POSTInstall Mount/my/ships/:shipSymbol/mounts/installInstall a mount on a ship. In order to install a mount, the ship must be docked and located in a waypoint that has a Shipyard trait. The ship also must have…
  • POSTRemove Mount/my/ships/:shipSymbol/mounts/removeRemove a mount from a ship. The ship must be docked in a waypoint that has the Shipyard trait, and must have the desired mount that it wish to remove…
  • GETGet Scrap Ship/my/ships/:shipSymbol/scrapGet the amount of value that will be returned when scrapping a ship.
  • POSTScrap Ship/my/ships/:shipSymbol/scrapScrap a ship, removing it from the game and returning a portion of the ship's value to the agent. The ship must be docked in a waypoint that has the Shipyard…
  • GETGet Repair Ship/my/ships/:shipSymbol/repairGet the cost of repairing a ship.
  • POSTRepair Ship/my/ships/:shipSymbol/repairRepair a ship, restoring the ship to maximum condition. The ship must be docked at a waypoint that has the Shipyard trait in order to use this function. To…
  • GETGet Ship Modules/my/ships/:shipSymbol/modulesGet the modules installed on a ship.
  • POSTInstall Ship Module/my/ships/:shipSymbol/modules/installInstall a module on a ship. The module must be in your cargo.
  • POSTRemove Ship Module/my/ships/:shipSymbol/modules/removeRemove a module from a ship. The module will be placed in cargo.

Systems

  • GETList Systems/systemsReturn a paginated list of all systems.
  • GETGet System/systems/:systemSymbolGet the details of a system.
  • GETList Waypoints in System/systems/:systemSymbol/waypointsReturn a paginated list of all of the waypoints for a given system. If a waypoint is uncharted, it will return the Uncharted trait instead of its actual traits.
  • GETGet Waypoint/systems/:systemSymbol/waypoints/:waypointSymbolView the details of a waypoint. If the waypoint is uncharted, it will return the 'Uncharted' trait instead of its actual traits.
  • GETGet Market/systems/:systemSymbol/waypoints/:waypointSymbol/marketRetrieve imports, exports and exchange data from a marketplace. Requires a waypoint that has the Marketplace trait to use. Send a ship to the waypoint to…
  • GETGet Shipyard/systems/:systemSymbol/waypoints/:waypointSymbol/shipyardGet the shipyard for a waypoint. Requires a waypoint that has the Shipyard trait to use. Send a ship to the waypoint to access data on ships that are…
  • GETGet Jump Gate/systems/:systemSymbol/waypoints/:waypointSymbol/jump-gateGet jump gate details for a waypoint. Requires a waypoint of type JUMP_GATE to use. Waypoints connected to this jump gate can be
  • GETGet Construction Site/systems/:systemSymbol/waypoints/:waypointSymbol/constructionGet construction details for a waypoint. Requires a waypoint with a property of isUnderConstruction to be true.
  • POSTSupply Construction Site/systems/:systemSymbol/waypoints/:waypointSymbol/construction/supplySupply a construction site with the specified good. Requires a waypoint with a property of isUnderConstruction to be true. The good must be in your ship's…

Data

  • GETGet Supply Chain/market/supply-chainDescribes which import and exports map to each other.

Global

  • GETGet Status/Return the status of the game server. This also includes a few global elements, such as announcements, server reset dates and leaderboards.
  • POSTRegister New Agent/registerCreates a new agent and ties it to an account. The agent symbol must consist of a 3-14 character string, and will be used to represent your agent. This symbol…

API details

Base URL
https://api.spacetraders.io/v2
Authentication
A bearer token in the Authorization header
A bearer token in the Authorization header
Operations
59 operations on 55 pathsPOST 32GET 26PATCH 1
Main resources
Fleet 37Systems 9Contracts 5Agents 3Factions 2Global 2Data 1
Response formats
application/json
Description format
OpenAPI 3.0.1, API version 2.3.0

How to test the SpaceTradersAPI in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the SpaceTradersAPI collection, without the publisher's secrets.
  3. Add your credentialsThis API uses A bearer token in the Authorization header. Add yours in the collection's variables or an environment; the requests already reference it.
  4. Send a requestPick an endpoint, for example “Get Agent” (GET /my/agent), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the SpaceTradersAPI?

SpaceTraders is an open-universe game and learning platform that offers a set of HTTP endpoints to control a fleet of ships and explore a multiplayer… It is listed under Media & content and has 59 endpoints.

Who publishes the SpaceTradersAPI?

It is listed from Spacetraders's public API description (an OpenAPI document), not published by Spacetraders on Swastik Codes. Anyone who controls spacetraders.io can claim the profile by adding a DNS TXT record.

What is the base URL of the SpaceTradersAPI?

Requests go to https://api.spacetraders.io/v2. Endpoint paths are added to this base URL.

How do I authenticate with the SpaceTradersAPI?

It accepts 2 methods: A bearer token in the Authorization header; A bearer token in the Authorization header.

How many endpoints does the SpaceTradersAPI have?

59 operations on 55 paths (32 POST, 26 GET, 1 PATCH). The largest groups are Fleet, Systems, Contracts, Agents.

Is forking the SpaceTradersAPI free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.