Replay API

Replay historical order book data from captured market feeds. Browse available exchanges and dates, then stream book snapshots at 1-minute intervals via Server-Sent Events.

Overview

The Replay Server reads binary capture files recorded by the live feed handlers and replays them through the full parser + book pipeline. The result is a series of order book snapshots at 1-minute intervals, delivered as JSON.

Key features:

Access

The replay server is available at these endpoints:

EnvironmentURL
Productionhttps://replay.microversesystems.com
Local devhttp://localhost:8086

No authentication is required. All endpoints support CORS (Access-Control-Allow-Origin: *).

GET /api/replay

Replay a captured order book for a specific exchange, symbol, and date. Returns results via Server-Sent Events (SSE) — the server streams progress events followed by a final result event containing the complete replay data.

Parameters

exchange string required — Exchange ID (e.g. binance, okx).
symbol string required — Symbol to replay (e.g. BTC-USDT).
date string required — Date in YYYY-MM-DD format.
start string optional — Start time as HH:MM (UTC). Default: beginning of capture.
end string optional — End time as HH:MM (UTC). Default: end of capture.
levels integer optional — Number of price levels per side (1–50). Default: 10.

Example Request

GET /api/replay?exchange=binance&symbol=BTC-USDT&date=2026-03-27&start=14:00&end=15:00&levels=5

SSE Events

The response is a text/event-stream. Progress events are sent during replay:

event: progress
data: {"phase":"scanning","pct":0,"detail":"4 capture files"}

event: progress
data: {"phase":"replaying","pct":50,"detail":"file 2/4"}

The final event contains the complete result:

event: result
data: {
  "exchange": "binance",
  "symbol": "BTC-USDT",
  "date": "2026-03-27",
  "start": "14:00",
  "end": "15:00",
  "levels": 5,
  "snapshots": [ ... ],
  "stats": { ... }
}

JavaScript Example

const url = `/api/replay?exchange=binance&symbol=BTC-USDT&date=2026-03-27&levels=10`;
const es = new EventSource(url);

es.addEventListener('progress', (e) => {
  console.log('Progress:', JSON.parse(e.data));
});

es.addEventListener('result', (e) => {
  const data = JSON.parse(e.data);
  console.log('Snapshots:', data.snapshots.length);
  es.close();
});

GET /api/available

List all available exchanges and their capture dates. Use this to discover what data is available for replay.

Example Request

GET /api/available

Example Response

{
  "exchanges": {
    "binance": ["2026-03-25", "2026-03-26", "2026-03-27"],
    "okx": ["2026-03-25", "2026-03-26", "2026-03-27"],
    "coinbase": ["2026-03-26", "2026-03-27"],
    "bybit": ["2026-03-27"]
  }
}

Each exchange maps to a sorted array of YYYY-MM-DD date strings for which capture files exist.

GET /api/symbols

List available symbols for a given exchange and date. The server scans the capture file to extract the symbol list.

Parameters

exchange string required — Exchange ID.
date string required — Date in YYYY-MM-DD format.

Example Request

GET /api/symbols?exchange=binance&date=2026-03-27

Example Response

{
  "exchange": "binance",
  "date": "2026-03-27",
  "symbols": [
    "BTC-USDT",
    "ETH-USDT",
    "SOL-USDT",
    "XRP-USDT",
    "DOGE-USDT"
  ]
}

GET /api/health

Health check endpoint. Returns server status and uptime.

Example Request

GET /api/health

Example Response

{
  "status": "ok",
  "uptime": 86400
}

The uptime field is in seconds.

Snapshot Format

Each snapshot in the snapshots array represents the order book state at a 1-minute interval:

{
  "time": "14:00",
  "bids": [
    ["87234.50", "1.234"],
    ["87234.00", "2.567"],
    ["87233.75", "0.891"]
  ],
  "asks": [
    ["87235.00", "0.456"],
    ["87235.50", "1.789"],
    ["87236.00", "3.012"]
  ]
}

Each price level is an array of [price, quantity] as strings. Bids are sorted best (highest) first, asks are sorted best (lowest) first.

Stats Object

The stats object in the replay response provides replay metadata:

{
  "packets": 245891,
  "files": 4,
  "symbols_found": 127,
  "elapsed_ms": 1823
}
FieldTypeDescription
packetsintegerTotal capture packets processed
filesintegerNumber of capture files read
symbols_foundintegerDistinct symbols found in capture data
elapsed_msintegerServer-side replay time in milliseconds
corrupt_packetsintegerCorrupt packets encountered (only present if > 0)

Supported Exchanges

The replay server can replay captures from any of the 21 connected exchanges:

ExchangeIDMarkets
BinancebinanceSpot
CoinbasecoinbaseAdvanced Trade
OKXokxSpot
BybitbybitSpot
KrakenkrakenSpot
Gate.iogateioSpot
KuCoinkucoinSpot
BitgetbitgetSpot
GeminigeminiSpot
HTXhtxSpot
MEXCmexcSpot
BitfinexbitfinexSpot
Crypto.comcryptocomSpot
CoinExcoinexSpot
BingXbingxSpot
BitmartbitmartSpot
PhemexphemexSpot
UpbitupbitSpot
LBanklbankSpot
AscendEXascendexSpot
DeribitderibitOptions & Futures

Use /api/available to check which exchanges have capture data for a given date.

Try It

The replay server includes a built-in interactive test page where you can select an exchange, date, symbol, and time range, then view replayed book snapshots in real time.

Open Replay Tool