Public Exchange API
Base URL: https://api.g2.galactictycoons.com
Get Single Material Price
GET /public/exchange/mat-prices/{materialId}
Returns price for a specific material.
Parameters:
materialId
- Material ID
Response:
json
{
"matId": 35,
"matName": "Steel",
"currentPrice": 47500,
"avgPrice": 45200
}
Fields:
matId
- Material IDmatName
- Material namecurrentPrice
- Lowest price currently available in cents (-1
if no orders)avgPrice
- Average price from recent trades in cents (-1
if no history)
Get All Materials Prices
GET /public/exchange/mat-prices
Returns current prices for all tradeable materials.
Response:
json
{
"prices": [
{
"matId": 1,
"matName": "Iron Ore",
"currentPrice": 4500,
"avgPrice": -1
},
{
"matId": 12,
"matName": "Rations",
"currentPrice": 4400,
"avgPrice": 2700
}
]
}
Fields:
matId
- Material IDmatName
- Material namecurrentPrice
- Lowest price currently available in cents (-1
if no orders)avgPrice
- Average price from recent trades in cents (-1
if no history)
Get Material Market Details
GET /public/exchange/mat-details/{materialId}
Returns detailed market information including orders, history, and statistics.
Parameters:
materialId
- Material ID
Response:
json
{
"matId": 35,
"matName": "Steel",
"currentPrice": 47500,
"avgPrice": 45200,
"totalQtyAvailable": 50000,
"orders": [
{ "cId": 123, "unitPrice": 47500, "qty": 1000 }
],
"avgQtySoldDaily": 1250.5,
"priceHistory": [
{ "date": "2025-10-10", "avgPrice": 47500, "qtySold": 1200, "qtyRemaining": 50000 }
]
}
Fields:
matId
- Material IDmatName
- Material namecurrentPrice
- Lowest price currently available in cents (-1
if no orders)avgPrice
- Average price from recent trades in cents (-1
if no history)totalQtyAvailable
- Total quantity for sale (excludes Federal Reserve)orders
- Active sell offers sorted by price, cheapest first (includes Federal Reserve)cId
- Company ID (1 = Federal Reserve)unitPrice
- Price per unit in centsqty
- Quantity available
avgQtySoldDaily
- Average quantity sold per day (excluding Fed purchases from players)priceHistory
- Last 30 days (index 0 = today)date
- Date in YYYY-MM-DD formatavgPrice
- Average trade price for the day in centsqtySold
- Quantity sold this day (excludes Federal Reserve purchases from players)qtyRemaining
- Quantity remaining at end of day (excludes Federal Reserve)
Get All Materials Market Details
GET /public/exchange/mat-details
Returns detailed market information for all tradeable materials including orders, history (last 7 days), and statistics.
Response:
json
{
"materials": [ /* array of material details */ ]
}
Fields:
materials
- Array of material details (same structure as single material details endpoint, but with 7 days of history)
Rate Limiting
100 cost units per 5 minutes per IP address
Endpoint | Cost |
---|---|
GET /public/exchange/mat-prices/{materialId} | 2 |
GET /public/exchange/mat-prices | 5 |
GET /public/exchange/mat-details/{materialId} | 5 |
GET /public/exchange/mat-details | 60 |
Error Responses
Code | Description | Body |
---|---|---|
400 | Bad Request | { "error": "Invalid material ID" } |
429 | Rate limit exceeded | None |
503 | Service Unavailable | None |
500 | Internal Server Error | None |
Notes
- All prices are in cents (e.g., 4500 = 45.00$)
- No authentication required