📦 Items & Economy API¶
This section covers spawning physical items, managing inventories, player designations, and trading with factions.
Thing Controller¶
The Thing Controller handles physical objects in the game world that are not humanoids (Pawns). In RimWorld code, almost everything is a "Thing."
Includes:
- Items: Weapons, Resources, Apparel.
- Buildings: Walls, Furniture, Workbenches.
- Plants: Crops, Trees.
GET
/api/v1/item/recipes
¶
/api/v1/item/recipes
¶
Retrieves crafting recipes associated with a specific item. This includes details on ingredients, work amount, required skills, and production stations.
Example:
curl --request GET \
--url "http://localhost:8765/api/v1/item/recipes?def_name=MealSimple"
Response:
{
"success": true,
"data": {
"item_def_name": "MealSimple",
"item_label": "simple meal",
"recipes": [
{
"recipe_def_name": "CookMealSimple",
"label": "cook simple meal",
"job_string": "Cooking simple meal.",
"work_amount": 300.0,
"work_time_seconds": 5.0,
"ingredients": [
{
"summary": "Raw food",
"count": 0.5,
"is_fixed_item": false,
"allowed_def_names": [
"RawPotatoes",
"RawRice",
"Meat_Chicken"
]
}
],
"produced_at": [
{
"def_name": "ElectricStove",
"label": "electric stove"
},
{
"def_name": "FueledStove",
"label": "fueled stove"
},
{
"def_name": "Campfire",
"label": "campfire"
}
],
"skill_requirements": [
{
"skill": "Cooking",
"min_level": 0
}
],
"research_prerequisite": null
}
]
},
"timestamp": "2025-12-11T19:46:05.7088803Z"
}
GET
/api/v1/item/sources
¶
/api/v1/item/sources
¶
Identifies the various methods by which a specific item can be obtained in the game. This includes flags for broad categories (Mining, Trading, Crafting) and specific details like the names of the ores or plants that produce the item.
Example:
curl --request GET \
--url "http://localhost:8765/api/v1/item/sources?def_name=Steel"
Response:
{
"success": true,
"data": {
"def_name": "Steel",
"label": "steel",
"thing_categories": [
"ResourcesRaw",
"Resources"
],
"can_craft": true,
"can_trade": true,
"can_harvest": false,
"can_mine": true,
"can_butcher": false,
"crafting_recipes": [
"SmeltWeapon",
"SmeltApparel",
"ExtractMetalFromSlag"
],
"harvested_from": [],
"mined_from": [
"MineableSteel"
],
"trade_tags": [
"BulkGoods",
"ExoticMisc"
]
},
"timestamp": "2025-12-11T19:46:05.7088803Z"
}
GET
/api/v1/resources/summary
¶
/api/v1/resources/summary
¶
Retrieves a comprehensive summary of all resources present on a specified map, including total item count, total market value, and categorized breakdowns of resources. It also highlights critical resources like food, medicine, and weapons.
Example:
curl --request GET \
--url 'http://localhost:8765/api/v1/resources/summary?map_id=0'
Response:
{
"success": true,
"data": {
"total_items": 1234,
"total_market_value": 5678.90,
"last_updated": "2025-12-12t10:00:00.0000000z",
"categories": [
{ "category": "foods", "count": 500, "market_value": 1200.00 },
{ "category": "manufactured", "count": 200, "market_value": 2500.00 }
],
"critical_resources": {
"food_summary": {
"food_total": 450,
"total_nutrition": 1500.0,
"meals_count": 300,
"raw_food_count": 150,
"rot_status_info": {
"nutrition_rotating_soon": 100.0,
"nutrition_not_rotating": 1400.0,
"percentage_rotating_soon": 6.67,
"soon_rotting_items": [
{
"thing_id": 1001,
"def_name": "MealSimple",
"label": "simple meal",
"stack_count": 5,
"nutrition": 4.5,
"days_until_rot": 0.5,
"hours_until_rot": 12.0
}
],
"total_soon_rotting_items": 1,
"total_soon_rotting_stacks": 1
}
},
"medicine_total": 20,
"weapon_count": 5,
"weapon_value": 1000.00
}
},
"errors": [],
"warnings": [],
"timestamp": "2025-12-12T10:00:00.0000000Z"
}
GET
/api/v1/resources/stored
¶
/api/v1/resources/stored
¶
Retrieves a detailed list of all items currently stored on a specified map. Optionally, results can be filtered by resource category. This endpoint provides granular information about each stored item, including its ID, definition name, label, and stack count.
Example:
# Get all stored resources
curl --request GET \
--url 'http://localhost:8765/api/v1/resources/stored?map_id=0'
# Get stored resources by category
curl --request GET \
--url 'http://localhost:8765/api/v1/resources/stored?map_id=0&category=Foods'
Response:
{
"success": true,
"data": {
"Foods": [
{
"thing_id": 4895,
"def_name": "MealSurvivalPack",
"label": "packaged survival meal x10",
"categories": ["FoodMeals"],
"position": { "x": 13, "y": 0, "z": 62 },
"stack_count": 10,
"market_value": 24.0,
"is_forbidden": false,
"quality": -1,
"hit_points": 50,
"max_hit_points": 50
},
{
"thing_id": 4896,
"def_name": "Pemmican",
"label": "pemmican x2",
"categories": ["FoodMeals"],
"position": { "x": 14, "y": 0, "z": 62 },
"stack_count": 50,
"market_value": 1.5,
"is_forbidden": false,
"quality": -1,
"hit_points": 50,
"max_hit_points": 50
}
],
"resources_raw": [
{
"thing_id": 2328,
"def_name": "ChunkGranite",
"label": "granite chunk",
"categories": ["StoneChunks"],
"position": { "x": 41, "y": 0, "z": 1 },
"stack_count": 1,
"market_value": 0.0,
"is_forbidden": false,
"quality": -1,
"hit_points": 300,
"max_hit_points": 300
}
]
},
"errors": [],
"warnings": [],
"timestamp": "2025-12-12T10:00:00.0000000Z"
}
GET
/api/v1/resources/storages/summary
¶
/api/v1/resources/storages/summary
¶
Provides a summary of all storage areas (stockpiles and dumping grounds) on a specified map, including the total number of stockpiles, total cells, used cells, and utilization percentage.
Example:
curl --request GET \
--url 'http://localhost:8765/api/v1/resources/storages/summary?map_id=0'
Response:
{
"success": true,
"data": {
"total_stockpiles": 5,
"total_cells": 200,
"used_cells": 120,
"utilization_percent": 60
},
"errors": [],
"warnings": [],
"timestamp": "2025-12-12T10:00:00.0000000Z"
}
POST
/api/v1/item/spawn
¶
/api/v1/item/spawn
¶
Spawn an item on the map at selected position.
Example:
curl --request POST \
--url http://localhost:8765/api/v1/item/spawn \
--header 'content-type: application/json' \
--data '{
"def_name": "BilliardsTable",
"stuff_def_name": "WoodLog",
"quality": "Legendary",
"amount": 1,
"x": 120,
"z": 106
}'
Request:
{
"def_name": "BilliardsTable",
"stuff_def_name": "WoodLog",
"quality": "Legendary",
"amount": 1,
"x": 120,
"z": 106
}
Response:
{
"success": true,
"errors": [],
"warnings": [],
"timestamp": "2025-12-10T19:53:16.733319Z"
}
POST
/api/v1/things/set-forbidden
¶
/api/v1/things/set-forbidden
¶
Toggle the forbidden status on one or more things by ID. Useful for unforbidding starting items in a new colony or managing item access for colonists.
Example:
curl --request POST \
--url http://localhost:8765/api/v1/things/set-forbidden \
--header 'content-type: application/json' \
--data '{
"thing_ids": [12345, 12346, 12347],
"map_id": 0,
"forbidden": false
}'
Request:
{
"thing_ids": [12345, 12346, 12347],
"map_id": 0,
"forbidden": false
}
Response (all updated):
{
"success": true,
"errors": [],
"warnings": [],
"timestamp": "2026-03-31T03:45:51.148Z"
}
Response (partial — some things not found):
{
"success": true,
"errors": [],
"warnings": ["Thing 99999 not found"],
"timestamp": "2026-03-31T03:45:51.148Z"
}
Trade Controller¶
Provides access to the game's economy and trading systems. This controller handles the definitions for various trader types (Orbital, Caravan, Visitor), allowing you to analyze their stock generation rules, item commonality, and buy/sell behaviors.
Capabilities:
- List all global Trader Kinds (Defs).
- Inspect stock generation logic (specific items, categories, or tags).
- Determine if a trader type is orbital or land-based.
GET
/api/v1/traders/defs
¶
/api/v1/traders/defs
¶
Returns a list of all trader definitions (TraderKindDefs). This includes orbital traders, caravans, and visitors, detailing their stock generation rules, commonality, and whether they buy specific categories of items.
Example:
curl --request GET \
--url http://localhost:8765/api/v1/traders/defs
Response:
{
"success": true,
"data": [
{
"def_name": "Orbital_BulkGoods",
"label": "bulk goods trader",
"orbital": true,
"visitor": false,
"commonality": 1.0,
"items": [
{
"name": "Steel",
"count": "500~800",
"price": "Normal"
},
{
"name": "ComponentIndustrial",
"count": "20~40"
}
],
"categories": [
{
"name": "Textiles",
"count": "300~600"
},
{
"name": "FoodRaw",
"count": "200~400"
}
],
"tags": [
{
"name": "Artifact",
"buys": false
}
]
},
{
"def_name": "Caravan_Outlander_CombatSupplier",
"label": "combat supplier",
"orbital": false,
"visitor": true,
"commonality": 1.0,
"items": [
{
"name": "MedicineIndustrial",
"count": "5~15"
}
],
"categories": [
{
"name": "WeaponsMelee",
"count": "3~6"
}
]
}
],
"timestamp": "2025-12-11T19:46:05.7088803Z"
}
Order Controller¶
The Order Controller is for issuing commands to pawns.
POST
/api/v1/order/designate/area
¶
/api/v1/order/designate/area
¶
Send command
Currently supported commands:
- remove-all: removes all commands
- mine
- deconstruct
- harvest
- hunt
Example:
curl --request POST \
--url 'http://localhost:8765/api/v1/order/designate/area'
Request:
{
"map_id": 0,
"type": "Mine",
"point_a": {"x": 0, "y": 0, "z": 0},
"point_b": {"x": 250, "y": 0, "z": 250}
}
Response:
{
"success": true,
"errors": [],
"warnings": [],
"timestamp": "2025-12-31T11:04:27.9729153Z"
}