← Back to Docs
REST API
REST API Reference
Build custom integrations with the OpenMM REST API.
🚧 Coming Soon
REST API is planned for a future release. Currently OpenMM works via CLI and MCP tools.
Base URL
When running locally:
http://localhost:3000Start the server with openmm init or npx @qbt-labs/openmm init
Authentication
Market data endpoints (ticker, orderbook, trades) are public and don't require authentication.
For authenticated endpoints (balance, orders), pass your exchange credentials via headers:
curl -H "X-Exchange-Key: $MEXC_API_KEY" \
-H "X-Exchange-Secret: $MEXC_SECRET" \
"http://localhost:3000/api/balance?exchange=mexc"Endpoints
GET
/api/tickerGet current price, bid/ask, spread, and 24h volume for a trading pair
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| exchange | string | Yes | Exchange id (mexc, gateio, kraken, bitget) |
| symbol | string | Yes | Trading pair (e.g., BTC/USDT) |
Example Request
curl "http://localhost:3000/api/ticker?exchange=mexc&symbol=BTC/USDT"Example Response
{
"symbol": "BTC/USDT",
"price": 97234.50,
"bid": 97230.00,
"ask": 97235.00,
"spread": 0.005,
"volume24h": 1234567.89
}GET
/api/orderbookGet the order book (bids and asks) for a trading pair
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| exchange | string | Yes | Exchange id |
| symbol | string | Yes | Trading pair |
| limit | number | No | Number of levels (default: 10) |
Example Request
curl "http://localhost:3000/api/orderbook?exchange=mexc&symbol=BTC/USDT&limit=5"Example Response
{
"bids": [
{ "price": 97230.00, "amount": 1.5 },
{ "price": 97225.00, "amount": 2.3 }
],
"asks": [
{ "price": 97235.00, "amount": 0.8 },
{ "price": 97240.00, "amount": 1.2 }
]
}GET
/api/balanceGet account balances for a supported exchange
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| exchange | string | Yes | Exchange id |
| asset | string | No | Filter by specific asset |
Example Request
curl -H "Authorization: Bearer $API_KEY" "http://localhost:3000/api/balance?exchange=mexc"Example Response
{
"balances": [
{ "asset": "BTC", "free": 1.5, "locked": 0.1 },
{ "asset": "USDT", "free": 10000.00, "locked": 500.00 }
]
}GET
/api/tradesGet recent trades for a trading pair with buy/sell breakdown
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| exchange | string | Yes | Exchange id |
| symbol | string | Yes | Trading pair |
| limit | number | No | Number of trades (default: 50) |
Example Request
curl "http://localhost:3000/api/trades?exchange=mexc&symbol=BTC/USDT&limit=10"Example Response
{
"trades": [
{ "id": "123", "price": 97234.50, "amount": 0.5, "side": "buy", "timestamp": 1709856000000 },
{ "id": "124", "price": 97230.00, "amount": 1.2, "side": "sell", "timestamp": 1709855990000 }
]
}GET
/api/cardano/priceGet Cardano token price from DEX aggregation (TOKEN/USDT via TOKEN/ADA × ADA/USDT)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Cardano token symbol (e.g., SNEK, INDY) |
Example Request
curl "http://localhost:3000/api/cardano/price?symbol=SNEK"Example Response
{
"symbol": "SNEK",
"priceAda": 0.00045,
"priceUsdt": 0.00032,
"adaUsdtRate": 0.71
}