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.
This Dart package is automatically generated by the OpenAPI Generator project:
- API version: 2.0.0
- Build package: org.openapitools.codegen.languages.DartClientCodegen
Dart 2.12 or later
If this Dart package is published to Github, add the following dependency to your pubspec.yaml
dependencies:
openapi:
git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
To use the package in your local drive, add the following dependency to your pubspec.yaml
dependencies:
openapi:
path: /path/to/openapi
TODO
Please follow the installation procedure and then run the following:
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: AgentToken
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('AgentToken').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('AgentToken').setAccessToken(yourTokenGeneratorFunction);
final api_instance = AgentsApi();
final agentSymbol = agentSymbol_example; // String | The agent symbol
try {
final result = api_instance.getAgent(agentSymbol);
print(result);
} catch (e) {
print('Exception when calling AgentsApi->getAgent: $e\n');
}
All URIs are relative to https://api.spacetraders.io/v2
Class | Method | HTTP request | Description |
---|---|---|---|
AgentsApi | getAgent | GET /agents/{agentSymbol} | Get Public Agent |
AgentsApi | getAgents | GET /agents | List Agents |
AgentsApi | getMyAgent | GET /my/agent | Get Agent |
ContractsApi | acceptContract | POST /my/contracts/{contractId}/accept | Accept Contract |
ContractsApi | deliverContract | POST /my/contracts/{contractId}/deliver | Deliver Cargo to Contract |
ContractsApi | fulfillContract | POST /my/contracts/{contractId}/fulfill | Fulfill Contract |
ContractsApi | getContract | GET /my/contracts/{contractId} | Get Contract |
ContractsApi | getContracts | GET /my/contracts | List Contracts |
DefaultApi | getStatus | GET / | Get Status |
DefaultApi | register | POST /register | Register New Agent |
FactionsApi | getFaction | GET /factions/{factionSymbol} | Get Faction |
FactionsApi | getFactions | GET /factions | List Factions |
FleetApi | createChart | POST /my/ships/{shipSymbol}/chart | Create Chart |
FleetApi | createShipShipScan | POST /my/ships/{shipSymbol}/scan/ships | Scan Ships |
FleetApi | createShipSystemScan | POST /my/ships/{shipSymbol}/scan/systems | Scan Systems |
FleetApi | createShipWaypointScan | POST /my/ships/{shipSymbol}/scan/waypoints | Scan Waypoints |
FleetApi | createSurvey | POST /my/ships/{shipSymbol}/survey | Create Survey |
FleetApi | dockShip | POST /my/ships/{shipSymbol}/dock | Dock Ship |
FleetApi | extractResources | POST /my/ships/{shipSymbol}/extract | Extract Resources |
FleetApi | extractResourcesWithSurvey | POST /my/ships/{shipSymbol}/extract/survey | Extract Resources with Survey |
FleetApi | getMounts | GET /my/ships/{shipSymbol}/mounts | Get Mounts |
FleetApi | getMyShip | GET /my/ships/{shipSymbol} | Get Ship |
FleetApi | getMyShipCargo | GET /my/ships/{shipSymbol}/cargo | Get Ship Cargo |
FleetApi | getMyShips | GET /my/ships | List Ships |
FleetApi | getRepairShip | GET /my/ships/{shipSymbol}/repair | Get Repair Ship |
FleetApi | getScrapShip | GET /my/ships/{shipSymbol}/scrap | Get Scrap Ship |
FleetApi | getShipCooldown | GET /my/ships/{shipSymbol}/cooldown | Get Ship Cooldown |
FleetApi | getShipNav | GET /my/ships/{shipSymbol}/nav | Get Ship Nav |
FleetApi | installMount | POST /my/ships/{shipSymbol}/mounts/install | Install Mount |
FleetApi | jettison | POST /my/ships/{shipSymbol}/jettison | Jettison Cargo |
FleetApi | jumpShip | POST /my/ships/{shipSymbol}/jump | Jump Ship |
FleetApi | navigateShip | POST /my/ships/{shipSymbol}/navigate | Navigate Ship |
FleetApi | negotiateContract | POST /my/ships/{shipSymbol}/negotiate/contract | Negotiate Contract |
FleetApi | orbitShip | POST /my/ships/{shipSymbol}/orbit | Orbit Ship |
FleetApi | patchShipNav | PATCH /my/ships/{shipSymbol}/nav | Patch Ship Nav |
FleetApi | purchaseCargo | POST /my/ships/{shipSymbol}/purchase | Purchase Cargo |
FleetApi | purchaseShip | POST /my/ships | Purchase Ship |
FleetApi | refuelShip | POST /my/ships/{shipSymbol}/refuel | Refuel Ship |
FleetApi | removeMount | POST /my/ships/{shipSymbol}/mounts/remove | Remove Mount |
FleetApi | repairShip | POST /my/ships/{shipSymbol}/repair | Repair Ship |
FleetApi | scrapShip | POST /my/ships/{shipSymbol}/scrap | Scrap Ship |
FleetApi | sellCargo | POST /my/ships/{shipSymbol}/sell | Sell Cargo |
FleetApi | shipRefine | POST /my/ships/{shipSymbol}/refine | Ship Refine |
FleetApi | siphonResources | POST /my/ships/{shipSymbol}/siphon | Siphon Resources |
FleetApi | transferCargo | POST /my/ships/{shipSymbol}/transfer | Transfer Cargo |
FleetApi | warpShip | POST /my/ships/{shipSymbol}/warp | Warp Ship |
SystemsApi | getConstruction | GET /systems/{systemSymbol}/waypoints/{waypointSymbol}/construction | Get Construction Site |
SystemsApi | getJumpGate | GET /systems/{systemSymbol}/waypoints/{waypointSymbol}/jump-gate | Get Jump Gate |
SystemsApi | getMarket | GET /systems/{systemSymbol}/waypoints/{waypointSymbol}/market | Get Market |
SystemsApi | getShipyard | GET /systems/{systemSymbol}/waypoints/{waypointSymbol}/shipyard | Get Shipyard |
SystemsApi | getSystem | GET /systems/{systemSymbol} | Get System |
SystemsApi | getSystemWaypoints | GET /systems/{systemSymbol}/waypoints | List Waypoints in System |
SystemsApi | getSystems | GET /systems | List Systems |
SystemsApi | getWaypoint | GET /systems/{systemSymbol}/waypoints/{waypointSymbol} | Get Waypoint |
SystemsApi | supplyConstruction | POST /systems/{systemSymbol}/waypoints/{waypointSymbol}/construction/supply | Supply Construction Site |
- AcceptContract200Response
- AcceptContract200ResponseData
- ActivityLevel
- Agent
- Chart
- Construction
- ConstructionMaterial
- Contract
- ContractDeliverGood
- ContractPayment
- ContractTerms
- Cooldown
- CreateChart201Response
- CreateChart201ResponseData
- CreateShipShipScan201Response
- CreateShipShipScan201ResponseData
- CreateShipSystemScan201Response
- CreateShipSystemScan201ResponseData
- CreateShipWaypointScan201Response
- CreateShipWaypointScan201ResponseData
- CreateSurvey201Response
- CreateSurvey201ResponseData
- DeliverContract200Response
- DeliverContract200ResponseData
- DeliverContractRequest
- DockShip200Response
- ExtractResources201Response
- ExtractResources201ResponseData
- ExtractResources201ResponseDataEventsInner
- ExtractResourcesRequest
- Extraction
- ExtractionYield
- Faction
- FactionSymbol
- FactionTrait
- FactionTraitSymbol
- FulfillContract200Response
- GetAgents200Response
- GetConstruction200Response
- GetContract200Response
- GetContracts200Response
- GetFaction200Response
- GetFactions200Response
- GetJumpGate200Response
- GetMarket200Response
- GetMounts200Response
- GetMyAgent200Response
- GetMyShip200Response
- GetMyShipCargo200Response
- GetMyShips200Response
- GetRepairShip200Response
- GetRepairShip200ResponseData
- GetScrapShip200Response
- GetScrapShip200ResponseData
- GetShipCooldown200Response
- GetShipNav200Response
- GetShipyard200Response
- GetStatus200Response
- GetStatus200ResponseAnnouncementsInner
- GetStatus200ResponseLeaderboards
- GetStatus200ResponseLeaderboardsMostCreditsInner
- GetStatus200ResponseLeaderboardsMostSubmittedChartsInner
- GetStatus200ResponseLinksInner
- GetStatus200ResponseServerResets
- GetStatus200ResponseStats
- GetSystem200Response
- GetSystemWaypoints200Response
- GetSystemWaypointsTraitsParameter
- GetSystems200Response
- GetWaypoint200Response
- InstallMount201Response
- InstallMount201ResponseData
- InstallMountRequest
- Jettison200Response
- Jettison200ResponseData
- JettisonRequest
- JumpGate
- JumpShip200Response
- JumpShip200ResponseData
- JumpShipRequest
- Market
- MarketTradeGood
- MarketTransaction
- Meta
- NavigateShip200Response
- NavigateShip200ResponseData
- NavigateShipRequest
- NegotiateContract200Response
- NegotiateContract200ResponseData
- OrbitShip200Response
- OrbitShip200ResponseData
- PatchShipNavRequest
- PurchaseCargo201Response
- PurchaseCargoRequest
- PurchaseShip201Response
- PurchaseShip201ResponseData
- PurchaseShipRequest
- RefuelShip200Response
- RefuelShip200ResponseData
- RefuelShipRequest
- Register201Response
- Register201ResponseData
- RegisterRequest
- RemoveMount201Response
- RemoveMount201ResponseData
- RemoveMountRequest
- RepairShip200Response
- RepairShip200ResponseData
- RepairTransaction
- ScannedShip
- ScannedShipEngine
- ScannedShipFrame
- ScannedShipMountsInner
- ScannedShipReactor
- ScannedSystem
- ScannedWaypoint
- ScrapShip200Response
- ScrapShip200ResponseData
- ScrapTransaction
- SellCargo201Response
- SellCargo201ResponseData
- SellCargoRequest
- Ship
- ShipCargo
- ShipCargoItem
- ShipConditionEvent
- ShipCrew
- ShipEngine
- ShipFrame
- ShipFuel
- ShipFuelConsumed
- ShipModificationTransaction
- ShipModule
- ShipMount
- ShipNav
- ShipNavFlightMode
- ShipNavRoute
- ShipNavRouteWaypoint
- ShipNavStatus
- ShipReactor
- ShipRefine201Response
- ShipRefine201ResponseData
- ShipRefine201ResponseDataProducedInner
- ShipRefineRequest
- ShipRegistration
- ShipRequirements
- ShipRole
- ShipType
- Shipyard
- ShipyardShip
- ShipyardShipCrew
- ShipyardShipTypesInner
- ShipyardTransaction
- Siphon
- SiphonResources201Response
- SiphonResources201ResponseData
- SiphonYield
- SupplyConstruction201Response
- SupplyConstruction201ResponseData
- SupplyConstructionRequest
- SupplyLevel
- Survey
- SurveyDeposit
- System
- SystemFaction
- SystemType
- SystemWaypoint
- TradeGood
- TradeSymbol
- TransferCargo200Response
- TransferCargoRequest
- WarpShip200Response
- WarpShip200ResponseData
- Waypoint
- WaypointFaction
- WaypointModifier
- WaypointModifierSymbol
- WaypointOrbital
- WaypointTrait
- WaypointTraitSymbol
- WaypointType
Authentication schemes defined for the API:
- Type: HTTP Bearer authentication