A REST API built in C++ that provides real-time CS2 skin market data from the Steam Marketplace, including a budget optimization engine powered by a knapsack algorithm.
- Skin Search — Search CS2 skins by name with live Steam Market data
- Price Lookup — Get current market prices for any skin
- Budget Optimizer — Given a budget, finds the best combination of skins to buy using a knapsack algorithm
- C++17
- Crow — C++ HTTP framework
- libcurl — HTTP requests to Steam Market API
- nlohmann/json — JSON parsing
- CMake — Build system
Returns server status.
Search for CS2 skins by name.
Example:
GET /search?q=AK-47+Redline
Response:
{
"total_count": 8,
"results": [
{
"name": "AK-47 | Redline (Field-Tested)",
"sell_listings": 803,
"sell_price": 4823,
"sell_price_text": "$48.23"
}
]
}Get price overview for a specific skin.
Find the best combination of skins within a given budget using a knapsack algorithm.
Request Body:
{
"budget": 100.00,
"query": "AK-47 Redline"
}Response:
{
"budget": 100.00,
"total_spent": 88.17,
"remaining": 11.83,
"skins": [
{ "name": "AK-47 | Redline (Field-Tested)", "price": "$48.23", "listings": 803 },
{ "name": "AK-47 | Redline (Battle-Scarred)", "price": "$39.94", "listings": 64 }
]
}- CMake 3.20+
- GCC (via MSYS2 on Windows)
- libcurl
- nlohmann/json
mkdir build
cd build
cmake .. -G "MinGW Makefiles"
cmake --build .
.\cs-skin-api.exeServer runs on http://localhost:8080