Public Exchange API
Base URL: https://api.g2.galactictycoons.com
For more accurate and updated API information, visit API Swagger.
Get Single Material Price
GET /public/exchange/mat-prices/{materialId}Returns price for a specific material.
Parameters:
materialId- Material ID
Response:
{
"matId": 35,
"matName": "Steel",
"currentPrice": 47500,
"avgPrice": 45200
}Fields:
matId- Material IDmatName- Material namecurrentPrice- Lowest price currently available in cents (-1if no orders)avgPrice- Average price from recent trades in cents (-1if no history)
Get All Materials Prices
GET /public/exchange/mat-pricesReturns current prices for all tradeable materials.
Response:
{
"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 (-1if no orders)avgPrice- Average price from recent trades in cents (-1if 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:
{
"matId": 35,
"matName": "Steel",
"currentPrice": 47500,
"avgPrice": 45200,
"totalQtyAvailable": 50000,
"orders": [
{ "cId": 123, "cName": "Company A", "unitPrice": 47500, "qty": 1000 }
],
"avgQtySoldDaily": 1250.5,
"priceHistory": [
{ "date": "2025-10-10", "avgPrice": 47500, "qtySold": 1200, "qtyRemaining": 50000, "qtyC": 0 }
]
}Fields:
matId- Material IDmatName- Material namecurrentPrice- Lowest price currently available in cents (-1if no orders)avgPrice- Average price from recent trades in cents (-1if no history)totalQtyAvailable- Total quantity for sale (excludes Federal Reserve)orders- Active sell offers sorted by price, cheapest first (includes Federal Reserve)id- Order ID (unique identifier)cId- Company ID (1 = Federal Reserve)cName- Company nameunitPrice- 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, current quantity for today (excludes Federal Reserve)qtyC- Quantity traded via contracts on this day
Get All Materials Market Details
GET /public/exchange/mat-detailsReturns detailed market information for all tradeable materials including orders, history (last 7 days), and statistics.
Response:
{
"materials": [ /* array of material details */ ]
}Fields:
materials- Array of material details (same structure as single material details endpoint, but with 7 days of history)
Get Material Market History
GET /public/exchange/mat-history/{materialId}Returns the full daily exchange history for the last 60 days: the same price history as the market details endpoint, plus how much of the material changed hands and for how much, how much of that was between players or bought from the Federal Reserve, and contract trades.
Parameters:
materialId- Material ID
Response:
{
"matId": 35,
"matName": "Steel",
"days": [
{ "date": "2025-10-10", "avgPrice": 51500, "qtySold": 4500, "qtyRemaining": 3500, "qtyTot": 5000, "valueTot": 250000000, "qtyPlayers": 3000, "valuePlayers": 150000000, "qtyFromFed": 1500, "qtyC": 100, "valueC": 5000000 }
]
}Fields:
matId- Material IDmatName- Material namedays- Last 60 days (index 0 = today, which is still accumulating)date- Date in YYYY-MM-DD formatavgPrice- Average trade price for the day in cents (excludes contracts)qtySold- Quantity sold this day (excludes Federal Reserve purchases from players)qtyRemaining- Quantity remaining at end of day, current quantity for today (excludes Federal Reserve)qtyTot- Total quantity traded on the exchange this day (players plus both Federal Reserve directions; excludes contracts)valueTot- Total value traded on the exchange this day in cents (excludes contracts)qtyPlayers/valuePlayers- Traded between playersqtyFromFed- Quantity players bought from the Federal ReserveqtyC- Quantity traded via contracts this dayvalueC- Value traded via contracts this day in cents (what buyers paid, including fees)
A company buying its own exchange order is not counted as a trade.
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 |
GET /public/exchange/mat-history/{materialId} | 5 |
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