Lunarium Trade
Home  ·  Markets  ·  Announcements  ·  Fees

Lunarium Trade API

Public market data for aggregators and apps (no authentication) plus a private API for trading bots and account tools (API key). All responses are JSON.

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. Public 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 Market data NEW /announcements API keys NEW Trading (private) /trades/mine /portfolio/history /notifications Limits What's new

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" }
]

Market data (native format)

The same data the exchange website uses. No authentication. {symbol} is the pair with a slash, URL-encoded, e.g. XLN%2FUSDT.

Markets

GET/api/markets

All markets (pairs) with their configuration and base/quote symbols.

Tickers

GET/api/markets/tickers

24h stats per pair. quoteVolume24 is what decides the “hot” pair shown on the site.

[
  { "symbol": "XLN/USDT", "base": "XLN", "quote": "USDT",
    "last": "0.000185", "change24": 5.26,
    "baseVolume24": "5310.2", "quoteVolume24": "983",
    "high24": "0.0001887", "low24": "0.00017945" }
]

Currencies

GET/api/markets/currencies

Listed coins and tokens: logo, type (native / BEP-20), deposit/withdraw status, withdrawal fee and minimum, contract address (tokens), USD price.

24h volume (USDT)

GET/api/markets/volume
{ "volume_24h_usdt": 983.0 }

Order book

GET/api/markets/{symbol}/orderbook?depth=50
{ "bids": [ ["0.000185", "620.00", ...] ], "asks": [ ["0.0001869", "500.00", ...] ] }

Recent trades

GET/api/markets/{symbol}/trades?limit=50

Each trade has price, amount, taker_side (BUY = buyer was the aggressor, shown as ↑ on the site; SELL = ↓) and a timestamp.

Candles

GET/api/markets/{symbol}/candles?interval=1d&limit=200
ParameterDefaultDescription
interval1m1m 5m 15m 1h 4h 1d
limit200Number of candles

Featured assets

GET/api/featured

Active “Featured Assets” slots (paid in XLN). /api/featured/config returns the number of slots.

Status

GET/api/health
{ "ok": true }
GET/api/presence/count
{ "online": 2 }
GET/api/fee-waiver/status

Whether a global fee waiver (promotion) is active.

Announcements NEW

Official listings, updates, promotions, maintenance and notices. Public, read-only. Rate limit: 120 requests / 60 s per IP.

List

GET/api/announcements?limit=12&offset=0&type=LISTING
ParameterDefaultDescription
limit12Page size
offset0Items to skip
typeallLISTING UPDATE PROMO MAINTENANCE NOTICE
{
  "items": [
    { "id": "6f1c…", "type": "LISTING", "symbol": "CHESS",
      "title": "…", "summary": "…", "title_en": "…", "summary_en": "…",
      "image_url": null, "link_url": null, "link_label": null,
      "pinned": 1, "published_ts": 1793000000, "trade_opens_ts": 1793007200 }
  ],
  "total": 5, "has_more": false, "now": 1793000500
}

Pinned items come first, then newest. now is the server time (Unix seconds) — use it for the “trading opens in…” countdown. Titles and summaries have English variants (*_en).

Detail

GET/api/announcements/{id}

Same fields plus the full body and body_en. Each announcement also has a shareable page at https://lunariumtrade.io/announcements/{id} with English social-preview metadata.

API keys & permissions NEW

Keys are created in Account → Security or through the endpoints below (logged-in session). Each key has a public part (xln_ + 32 hex) and a secret (64 hex) that is shown only once and stored hashed — it cannot be recovered, only revoked and replaced.

PermissionAllows
readBalances, deposits, withdrawals history, orders, trades, portfolio, notifications, addresses, favorites, referrals, support tickets. Default when none is given.
tradeCreate and cancel orders, Featured Assets contracts.
withdrawRequest and cancel withdrawals. Requires at least one IP in the whitelist.

List keys

GET/api/api-keys

Returns id, label, public_key, permissions, ip_whitelist, revoked, last_used_at, created_at. The secret is never returned.

Create key

POST/api/api-keys
{ "label": "my-bot", "permissions": ["read","trade"], "ip_whitelist": ["203.0.113.10"] }
{ "publicKey": "xln_…", "secret": "…", "permissions": ["read","trade"],
  "ip_whitelist": ["203.0.113.10"], "warning": "Secret is shown only now. Store it safely." }

Revoke key

POST/api/api-keys/{id}/revoke
{ "revoked": true }

Trading API (private)

Authenticated endpoints for placing/managing orders and reading balances. Require an API Key (Account → Security). Use permissions read + trade for bots; grant withdraw only with an IP whitelist, and never to a bot you do not fully control.

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.

My trades NEW

GET/api/trades/mine?symbol=XLN/USDT  · auth: read

Your executed trades, optionally filtered by symbol.

Portfolio history NEW

GET/api/portfolio/history?days=90  · auth: read

Net worth evolution in USDT. days is typically 7, 30, 90 or 365. Each point is the end-of-day balance of every coin (available + locked) valued at that day’s last price in USDT (via the coin’s USDT market; otherwise through XLN/XLNFT; otherwise the coin’s USD price). Rate limit: 40 / 60 s.

{
  "days": 90,
  "points": [ { "t": "2026-10-21", "v": 2000.0 }, { "t": "2026-10-22", "v": 2045.3 } ],
  "current": 2554.05, "start": 1976.0, "change": 580.0, "change_pct": 29.3,
  "high": 2610.0, "low": 1980.0, "net_flow": 300.0,
  "composition": [ { "currency": "XLN", "value": 1800.0, "pct": 70.5 } ]
}

net_flow = deposits minus withdrawals in the period (valued on the day), so you can tell whether the change came from new funds or from results. Limitation: without a daily snapshot, coins with no USDT market use their current price for past days.

Notifications NEW

GET/api/notifications?limit=40  · auth: read

Account events from the last 60 days, newest first. They are derived from deposits, withdrawals and orders (no separate storage). Rate limit: 60 / 60 s.

kindWhenFields
DEPOSITDeposit creditedsymbol, amount
WITHDRAW_APPROVEDWithdrawal approved / being processed / broadcastsymbol, amount
WITHDRAW_DONEWithdrawal confirmedsymbol, amount
WITHDRAW_REJECTEDWithdrawal rejected or failedsymbol, amount
ORDER_FILLEDOrder fully executedpair, side, amount
{ "items": [ { "id": "d41", "kind": "DEPOSIT", "symbol": "XLN", "amount": "250", "ts": 1793000000 } ], "now": 1793000500 }

The site also shows relevant announcements in the bell, from /api/announcements. Read/unread state is kept in the browser.

Wallets & withdrawals NEW

Method & pathPermissionDescription
GET /wallets/addressesreadYour deposit addresses
POST /wallets/addresses/{symbol}readCreate a deposit address
GET /wallets/depositsreadDeposit history
GET /wallets/withdrawalsreadWithdrawal history
GET /wallets/withdrawals/{id}readOne withdrawal
POST /wallets/withdrawalswithdrawRequest a withdrawal
POST /wallets/withdrawals/{id}/cancelwithdrawCancel a pending withdrawal
GET /favorites · POST /favorites/togglereadFavorite pairs
GET /referrals/stats · /referrals/rewardsreadReferral program

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)

Limits & notes UPDATED

EndpointLimit
POST /orders120 / 60 s per user
GET /announcements120 / 60 s per IP
GET /portfolio/history40 / 60 s per user
GET /notifications60 / 60 s per user

On 429, honor Retry-After. Display note: the BEP-20 token BTCB is shown as BTC on the website; the internal symbol in the API is unchanged.

What’s new