Structures

When you've accumulated enough credits, you might start thinking about building your own structures such as a Mine or a Farm. Structures are a great way to take control of the economy and expand your industrial footprint across the universe.

A structure typically requires a cost in credits to construct. Each type of structure also has restrictions for the types of locations where it can be constructed.

Once a structure has been created, it will start consuming and producing goods on a regular interval. If the structure runs out of the required inputs, production will halt until more goods are deposited at the location. Goods can be deposited and picked up by your ships.

The following guide will show you how to view the types of structures available to build, how to build a new structure, and how to deposit and pick up goods with your ships.

View Available Structures

To view the structure types available to build, hit the following endpoint:

https GET api.spacetraders.io/types/structures token==$token
{
"structures": [
{
"allowedLocationTypes": ["PLANET"],
"consumes": ["EXPLOSIVES", "MACHINERY"],
"price": 5000000,
"name": "Farm",
"produces": ["FOOD"],
"symbol": "FARM"
},
{
"allowedLocationTypes": ["PLANET", "MOON", "ASTEROID"],
"consumes": ["EXPLOSIVES", "MACHINERY"],
"price": 5000000,
"name": "Mine",
"produces": ["METALS"],
"symbol": "MINE"
}
]
}

Find a Location

Once you've chosen the type of structure you want to build, you will then need to find a suitable location. Not all locations allow construction and some locations may limit the number of player structures allowed.

https GET api.spacetraders.io/systems/OE/locations token==$token \
type==MOON \
allowsConstruction==true
{
"locations": [
{
"allowsConstruction": true,
"name": "Ado",
"ships": [],
"symbol": "OE-UC-AD",
"type": "MOON",
"x": -82,
"y": 82
}
]
}

Create a New Structure

Looks like Ado is the best location for a Mine. Fly a ship there so that you can create a new structure.

https POST api.spacetraders.io/my/structures token==$token \
type==MINE \
location==OE-UC-AD
{
"structure": {
"id": "ckno69qb105191ds69utcsztz",
"type": "MINE",
"location": "OE-UC-AD",
"status": "Production halted. Required inventory is missing.",
"active": false,
"ownedBy": {
"username": "spacetrader"
},
"inventory": [
{
"good": "METALS",
"quantity": 0
},
{
"good": "EXPLOSIVES",
"quantity": 0
},
{
"good": "MACHINERY",
"quantity": 0
}
],
"consumes": ["EXPLOSIVES", "MACHINERY"],
"produces": ["METALS"]
}
}

Deposit Goods

Looks like you need to supply your Mine with Drones and Machinery to enable production. You can deposit goods from a ship using the following endpoint:

https POST api.spacetraders.io/my/structures/$structureId/deposit token==$token \
shipId==$shipId \
good==EXPLOSIVES \
quantity==100
{
"deposit": {
"good": "EXPLOSIVES",
"quantity": 100
},
"ship": {
"cargo": [
{
"good": "EXPLOSIVES",
"quantity": 0
}
]
},
"structure": {
"inventory": [
{
"good": "EXPLOSIVES",
"quantity": 100
}
]
}
}

View Structure Details

Once you have filled the required inventory for production, you can view the details of your structure to confirm production is running.

https GET api.spacetraders.io/my/structures/$structureId token==$token
{
"structure": {
"id": "ckno69qb105191ds69utcsztz",
"type": "MINE",
"location": "OE-UC-AD",
"status": "Production running. Required inventory is in stock.",
"active": true,
"ownedBy": {
"username": "spacetrader"
},
"inventory": [
{
"good": "METALS",
"quantity": 10
},
{
"good": "EXPLOSIVES",
"quantity": 500
},
{
"good": "MACHINERY",
"quantity": 500
}
],
"consumes": ["EXPLOSIVES", "MACHINERY"],
"produces": ["METALS"]
}
}

Transfer Goods

Once your structure has been producing for a while, you may want to start transferring goods to your fleet and send them off to the markets.

https POST api.spacetraders.io/my/structures/$structureId/transfer token==$token \
shipId==$shipId \
good==METALS \
quantity==10
{
"transfer": {
"good": "METALS",
"quantity": 10
},
"ship": {
"cargo": [
{
"good": "METALS",
"quantity": 10
}
]
},
"structure": {
"inventory": [
{
"good": "METALS",
"quantity": 0
}
]
}
}

Conclusion

Congratulations on building your first structure! You should keep your required inventory filled in order to keep production running. And don't forget to take your produced goods and sell them to a nearby market!