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:
- Replay any exchange/symbol/date combination from capture archives
- Filter by time range (start/end hours)
- Configurable book depth (1–50 levels)
- Real-time progress via Server-Sent Events (SSE)
- Deterministic — same capture files always produce the same results
Access
The replay server is available at these endpoints:
| Environment | URL |
|---|---|
| Production | https://replay.microversesystems.com |
| Local dev | http://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
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
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
}
| Field | Type | Description |
|---|---|---|
| packets | integer | Total capture packets processed |
| files | integer | Number of capture files read |
| symbols_found | integer | Distinct symbols found in capture data |
| elapsed_ms | integer | Server-side replay time in milliseconds |
| corrupt_packets | integer | Corrupt packets encountered (only present if > 0) |
Supported Exchanges
The replay server can replay captures from any of the 21 connected exchanges:
| Exchange | ID | Markets |
|---|---|---|
| Binance | binance | Spot |
| Coinbase | coinbase | Advanced Trade |
| OKX | okx | Spot |
| Bybit | bybit | Spot |
| Kraken | kraken | Spot |
| Gate.io | gateio | Spot |
| KuCoin | kucoin | Spot |
| Bitget | bitget | Spot |
| Gemini | gemini | Spot |
| HTX | htx | Spot |
| MEXC | mexc | Spot |
| Bitfinex | bitfinex | Spot |
| Crypto.com | cryptocom | Spot |
| CoinEx | coinex | Spot |
| BingX | bingx | Spot |
| Bitmart | bitmart | Spot |
| Phemex | phemex | Spot |
| Upbit | upbit | Spot |
| LBank | lbank | Spot |
| AscendEX | ascendex | Spot |
| Deribit | deribit | Options & 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.