Developers
A consistent REST API for assets, quotes, orders and portfolios, real-time streams, and signed webhooks. All endpoints in this environment serve simulated data.
The API is organised around REST, returns JSON, and uses standard HTTP status codes. Every response that contains market data includes a meta.simulated flag — always check it.
https://api.xstockss.fun/api/v1curl https://api.xstockss.fun/api/v1/portfolio \
-H "Authorization: Bearer sk_demo_••••••••••••"/api/v1/market-statusCurrent US equity session status and the next session change.
/api/v1/assets/{symbol}/bars?timeframe=1DOHLCV bars. Timeframes: 1H, 1D, 1W, 1M, 3M, 1Y, 5Y.
{
"data": [
{
"time": 1791100800,
"open": 182.41,
"high": 182.66,
"low": 182.3,
"close": 182.52,
"volume": 845213
}
],
"meta": {
"symbol": "NVDA",
"timeframe": "1D",
"source": "demo",
"simulated": true
}
}/api/v1/assetsList instruments. Filters: search, sector, network, country, tradable. Add include=quotes to embed quotes.
/api/v1/assets/NVDAA single instrument with token configuration per network and its current quote.
{
"data": {
"symbol": "NVDA",
"name": "NVIDIA Corporation",
"kind": "stock",
"tokenSymbol": "sNVDA",
"networks": [
"ethereum",
"solana",
"base",
"arbitrum"
],
"tokenStatus": "tokenized",
"tradable": true,
"tokens": [
{
"network": "ethereum",
"standard": "ERC-20 (permissioned extension)",
"decimals": 18,
"contractAddress": null,
"status": "tokenized"
}
]
},
"meta": {
"source": "demo",
"simulated": true
}
}/api/v1/quotes?symbols=NVDA,AAPLQuotes for up to 200 symbols.
/api/v1/quotes/NVDALatest quote. price is the token reference price; underlyingPrice freezes outside regular hours.
{
"data": {
"symbol": "NVDA",
"price": 185.01,
"underlyingPrice": 183.59,
"change24h": 4.1,
"changePct24h": 0.0227,
"changePct7d": 0.0312,
"open24h": 180.91,
"high24h": 185.79,
"low24h": 180.91,
"volume24h": 280108718,
"bid": 184.88,
"ask": 185.14,
"marketStatus": "closed",
"timestamp": 1791011541150,
"source": "demo"
},
"meta": {
"source": "demo",
"simulated": true
}
}/api/v1/ordersscope: tradeSubmit a market, limit or stop order.
curl -X POST https://api.xstockss.fun/api/v1/orders \
-H "Authorization: Bearer sk_demo_••••" \
-H "Content-Type: application/json" \
-d '{"symbol":"NVDA","side":"BUY","type":"LIMIT","quantity":2.5,"limitPrice":180,"network":"ethereum","clientOrderId":"rebalance-2026-10-03-001"}'{
"data": {
"id": "ord_…",
"symbol": "NVDA",
"side": "BUY",
"type": "LIMIT",
"quantity": 2.5,
"limitPrice": 180,
"status": "OPEN",
"filledQty": 0,
"network": "ethereum",
"provider": "demo",
"simulated": true
},
"meta": {
"simulated": true,
"notice": "Simulated order — no real asset will be purchased."
}
}/api/v1/orders?status=OPENscope: readList orders and recent trades.
/api/v1/orders/{id}scope: tradeCancel an open order.
/api/v1/portfolioscope: readCash, positions, valuation and P&L.
{
"data": {
"simulated": true,
"cash": 24310.55,
"equityValue": 81240.18,
"totalValue": 105550.73,
"pnl24h": 912.4,
"totalPnl": 5550.73,
"positions": [
{
"symbol": "NVDA",
"tokenSymbol": "sNVDA",
"quantity": 65,
"avgCost": 171.22,
"price": 185.18,
"value": 12036.7,
"allocation": 0.114
}
]
}
}/api/v1/portfolio/history?range=3Mscope: readPortfolio value series reconstructed from the ledger. Ranges: 1W, 1M, 3M, 1Y, ALL.
/api/v1/transactionsscope: readLedger entries: deposits, trades, fees, distributions and transfers.
/api/v1/watchlistscope: readThe authenticated user's watchlist.
{
"id": "evt_…",
"type": "order.filled",
"created": "2026-10-03T14:30:05Z",
"data": {
"orderId": "ord_…",
"symbol": "NVDA",
"side": "BUY",
"quantity": 2.5,
"price": 179.95,
"simulated": true
}
}import { createHmac, timingSafeEqual } from "node:crypto";
function verify(rawBody: string, header: string, secret: string) {
const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest();
return timingSafeEqual(expected, Buffer.from(v1, "hex"));
}/api/stream/quotes, and clients fall back to polling when neither is reachable.wss://api.xstockss.fun/marketsquotes
Top-of-book and last price per symbol
trades
Executions on supported venues
orderbook
Depth snapshots and incremental updates
portfolio
Valuation changes (authenticated)
orders
Order state transitions (authenticated)
{
"type": "subscribe",
"channel": "quotes",
"symbols": [
"NVDA",
"AAPL"
]
}{
"channel": "quotes",
"simulated": true,
"quotes": [
{
"symbol": "NVDA",
"price": 185.01,
"changePct24h": 0.0227,
"timestamp": 1791011541150
}
]
}/api/v1/assets/{symbol}See tokens[] for per-network configuration.
/api/v1/transparencyReserve reconciliation snapshot, attestation reports and mint/burn events. In demo mode this is a demonstration dataset, flagged meta.demonstration.
/api/v1/corporate-actions/{symbol}Dividends, splits, mergers and other events with token treatment. Returns an empty list and meta.providerConfigured=false until a reference-data feed is connected.
{
"error": {
"code": "validation_error",
"message": "Request validation failed",
"details": [
{
"path": "limitPrice",
"message": "Limit price is required for limit orders"
}
]
}
}| Bucket | Limit |
|---|---|
| auth | 10 requests / 10 min |
| orders | 30 requests / 1 min |
| write | 60 requests / 1 min |
| read | 300 requests / 1 min |
| contact | 5 requests / 1h |
Exceeding a limit returns 429 with a Retry-After header. Request bodies are capped at 32 KB.