Quickstart
Purchase Ship
Shipyards allow you to purchase and repair ships, as well as swap out different modules and mounts. To purchase a ship, you will need to find a waypoint with a shipyard and then send a request to the my/ships
endpoint.
Find a shipyard
Look for a waypoint with the SHIPYARD
trait. You can use the following endpoint to find all waypoints in your current system. You will notice that there is an orbital station that has a shipyard, which you can use to purchase a mining drone.
curl 'https://api.spacetraders.io/v2/systems/:systemSymbol/waypoints' \
--header 'Authorization: Bearer INSERT_TOKEN_HERE'
View available ships
To view the ships available for purchase at a shipyard, send the following request. You will notice that there is a mining drone available for purchase. To see the exact prices of each ship, you will need to have another ship present at the location.
curl 'https://api.spacetraders.io/v2/systems/:systemSymbol/waypoints/:shipyardWaypointSymbol/shipyard' \
--header 'Authorization: Bearer INSERT_TOKEN_HERE'
Purchase a ship
You can purchase a ship at a shipyard by sending a POST request to the my/ships
endpoint. Sending this request will deduct the cost of the ship from your credits and add the ship to your fleet.
You will need to specify the type of ship you want to purchase, along with the waypoint you are purchasing from.
curl --request POST \
--url 'https://api.spacetraders.io/v2/my/ships' \
--header 'Authorization: Bearer INSERT_TOKEN_HERE' \
--header 'Content-Type: application/json' \
--data '{
"shipType": "SHIP_MINING_DRONE",
"waypointSymbol": ":shipyardWaypointSymbol"
}'