Lunarium Trade
Home  ·  Markets

Public Market Data API

Read-only endpoints for data aggregators (CoinGecko, CoinMarketCap, and others). Public market data only — pairs, tickers, order books and trades. No authentication required.

Base URL  →  https://lunariumtrade.io/api
Conventions. Pair identifiers use an underscore between base and quote, e.g. XLN_USDT. Prices and volumes are returned as strings. Timestamps are Unix time in milliseconds. All endpoints are GET and return application/json.
CoinGecko /cg/pairs /cg/tickers /cg/orderbook /cg/historical_trades CoinMarketCap /cmc/summary /cmc/assets /cmc/ticker /cmc/orderbook /cmc/trades Trading (private)

CoinGecko format

Pairs

GET/api/cg/pairs

List of all tradeable pairs.

[
  { "ticker_id": "XLN_USDT", "base": "XLN", "target": "USDT" },
  { "ticker_id": "ADA_XLN",  "base": "ADA", "target": "XLN"  }
]

Tickers

GET/api/cg/tickers

24h ticker data for every pair.

[
  {
    "ticker_id": "XLN_USDT",
    "base_currency": "XLN",
    "target_currency": "USDT",
    "last_price": "0.0025",
    "base_volume": "1250.5",
    "target_volume": "3.126",
    "bid": "0.00249",
    "ask": "0.00251",
    "high": "0.0031",
    "low": "0.0021"
  }
]

Order book

GET/api/cg/orderbook?ticker_id=XLN_USDT&depth=100
ParameterRequiredDescription
ticker_idyesPair, e.g. XLN_USDT
depthnoLevels per side (default 100, max 500)
{
  "ticker_id": "XLN_USDT",
  "timestamp": 1788300000000,
  "bids": [ ["0.00249", "1200.0"], ["0.00248", "500.0"] ],
  "asks": [ ["0.00251", "800.0"],  ["0.00252", "300.0"] ]
}

Historical trades

GET/api/cg/historical_trades?ticker_id=XLN_USDT&type=buy&limit=200
ParameterRequiredDescription
ticker_idyesPair, e.g. XLN_USDT
typenobuy or sell (omit for both)
limitnoMax trades (default 200, max 1000)
{
  "buy": [
    { "trade_id": "…", "price": "0.0025", "base_volume": "50", "target_volume": "0.125", "trade_timestamp": 1788299990000, "type": "buy" }
  ],
  "sell": [
    { "trade_id": "…", "price": "0.0024", "base_volume": "10", "target_volume": "0.024", "trade_timestamp": 1788299980000, "type": "sell" }
  ]
}

CoinMarketCap format

Summary

GET/api/cmc/summary

24h overview for every pair, keyed by pair.

{
  "XLN_USDT": {
    "trading_pairs": "XLN_USDT",
    "base_currency": "XLN",
    "quote_currency": "USDT",
    "last_price": "0.0025",
    "lowest_ask": "0.00251",
    "highest_bid": "0.00249",
    "base_volume": "1250.5",
    "quote_volume": "3.126",
    "price_change_percent_24h": "4.16",
    "highest_price_24h": "0.0031",
    "lowest_price_24h": "0.0021"
  }
}

Assets

GET/api/cmc/assets

Currencies and their deposit/withdraw status, keyed by symbol.

{
  "XLN": {
    "name": "Lunarium Coin",
    "can_withdraw": true,
    "can_deposit": true,
    "min_withdraw": "500",
    "withdrawal_fee": "0.1",
    "contract_address": null
  }
}

Ticker

GET/api/cmc/ticker
{
  "XLN_USDT": {
    "base_currency": "XLN",
    "quote_currency": "USDT",
    "last_price": "0.0025",
    "base_volume": "1250.5",
    "quote_volume": "3.126",
    "isFrozen": 0
  }
}

Order book

GET/api/cmc/orderbook/XLN_USDT?depth=100
{
  "timestamp": 1788300000000,
  "bids": [ ["0.00249", "1200.0"] ],
  "asks": [ ["0.00251", "800.0"] ]
}

Trades

GET/api/cmc/trades/XLN_USDT
[
  { "trade_id": "…", "price": "0.0025", "base_volume": "50", "quote_volume": "0.125", "timestamp": 1788299990000, "type": "buy" }
]

Trading API (private)

Authenticated endpoints for placing/managing orders and reading balances. Require an API Key (Account → Security). Use permissions read + tradenever grant withdraw to a bot.

Authentication. Send both headers on every private request (HTTPS only):
X-API-KEY: xln_...   X-API-SECRET: <secret>
The secret is shown once at creation. Missing/invalid → auth error. Missing permission → Permissão de API insuficiente. IP outside the key's whitelist (if set) → IP não autorizado.

Balances

GET/api/balances  · auth: read

Available and locked balance per currency.

[
  { "symbol": "XLN",  "available": "517.99", "locked": "1067.05" },
  { "symbol": "USDT", "available": "12.30",  "locked": "0.24" }
]

My orders

GET/api/orders?symbol=XLN/USDT&status=OPEN&limit=100  · auth: read

Your orders. Optional filters: symbol, status, limit.

Create order

POST/api/orders  · auth: trade
FieldRequiredNotes
symbolyesPair with slash, e.g. XLN/USDT
sideyesBUY or SELL
typeyesLIMIT or STOP_LIMIT. There is no MARKET type — see the market-style note below.
amountyesString, max 8 decimals, ≥ market minimum
pricefor LIMITString, max 8 decimals
timeInForcenoOnly GTC
stopPricefor STOP_LIMITString > 0
POST /api/orders
{ "symbol": "XLN/USDT", "side": "BUY", "type": "LIMIT", "price": "0.0025", "amount": "100", "timeInForce": "GTC" }

-> 201  { "id": "…", "status": "OPEN", ... }
Rate limit: ~120 orders / 60s per user (2/sec). Rejected if the market is inactive or trading is paused.
Market-style (immediate) orders. The exchange has no MARKET order type. To execute immediately against the book (like the site's "Market" tab), send a LIMIT order priced to cross: read the best price from /api/cg/orderbook?ticker_id=… and use the best ask for a BUY (e.g. ask × 1.005) or the best bid for a SELL (e.g. bid × 0.995). The small buffer ensures it crosses; it fills at the resting orders' prices. Any unfilled remainder rests in the book — cancel it if you want pure immediate execution.

Cancel order

POST/api/orders/{id}/cancel  · auth: trade

Cancel an open order by its id. No body.

Example (Python)

import requests
BASE = "https://lunariumtrade.io/api"
AUTH = {"X-API-KEY": "xln_...", "X-API-SECRET": "..."}

# balances
print(requests.get(BASE+"/balances", headers=AUTH).json())

# place a LIMIT buy
o = requests.post(BASE+"/orders",
      headers={**AUTH, "Content-Type": "application/json"},
      json={"symbol":"XLN/USDT","side":"BUY","type":"LIMIT",
            "price":"0.0025","amount":"100","timeInForce":"GTC"}).json()

# cancel
requests.post(BASE+"/orders/"+o["id"]+"/cancel", headers=AUTH)