Quickstart
Install via Docker or npm and run your first replay

Tardis-machine is a locally runnable server with built-in data caching that uses Tardis.dev HTTP API under the hood. It provides both tick-level historical and consolidated real-time cryptocurrency market data via its HTTP and WebSocket APIs and is available via npm and Docker.
Features
efficient data replay API endpoints returning historical market data for whole time periods (in contrast to Tardis.dev HTTP API where single call returns data for single minute time period)
exchange-native market data APIs
tick-by-tick historical market data replay in exchange-native format
WebSocket API providing historical market data replay from any given past point in time with the same data format and 'subscribe' logic as real-time exchanges' APIs - in many cases existing exchanges' WebSocket clients can be used to connect to this endpoint
consistent format for accessing market data across multiple exchanges
consolidated real-time data streaming connecting directly to exchanges' WebSocket APIs
customizable order book snapshots and trade bars data types
transparent historical local data caching (cached data is stored on disk in compressed GZIP format and decompressed on demand when reading the data)
support for top cryptocurrency exchanges: BitMEX, Deribit, Binance Spot, Binance USDT Futures, OKX Spot, HTX Spot, bitFlyer, Bitstamp, Coinbase Exchange, Kraken Futures (Crypto Facilities), Gemini, Kraken, Bitfinex, Bybit Derivatives, OKCoin and more
Real-time streaming via tardis-machine is available only in normalized format. Exchange-native (raw) real-time data is not provided. If you need raw real-time feeds, connect directly to exchange WebSocket APIs.
Installation
Docker
Pull and run latest version of tardisdev/tardis-machine image:
Tardis-machine server's HTTP endpoints will be available on port 8000 and WebSocket API endpoints on port 8001. Your API key will be passed via environment variable (TM_API_KEY) — simply replace YOUR_API_KEY with the API key you've received via email.
The command above does not use persistent volumes for local caching (each Docker restart will result in losing local data cache). To use ./host-cache-dir as a persistent volume (bind mount) cache directory, run:
Since using volumes can cause issues especially on Windows, it's fine to run Docker image without them with the caveat of potentially poor local cache ratio after each container's restart.
Config environment variables
You can set the following environment variables to configure tardis-machine server:
TM_API_KEY
API key for Tardis.dev HTTP API - if not provided only first day of each month of historical data is accessible
TM_PORT
8000
HTTP port on which server will be running, WebSocket port is always this value + 1 (8001 with port set to 8000)
TM_CACHE_DIR
/.cache
path to local dir that will be used as cache location
TM_CLUSTER_MODE
false
will launch cluster of Node.js processes to handle the incoming requests if set to true, by default server runs in single process mode
TM_DEBUG
false
server will print verbose debug logs to stdout if set to true
TM_CLEAR_CACHE
false
server will clear local cache dir on startup if set to true
The local cache grows without limit by default. For large backfills this can consume significant disk space. Use TM_CLEAR_CACHE=true to clear the cache on startup, or set autoCleanup: true in replay options to remove cached data after each replay completes. See the replay options section for autoCleanup concurrency caveats.
Tardis-machine also supports exchange-specific environment variables (exchange credentials, proxy, WebSocket URL overrides, Binance rate limit tuning) — see the Node.js client environment variables for the full list.
npm
Requires Node.js v12+ and git installed.
Install and runtardis-machine server via npx command:
or install globally via npm:
and then run:
Tardis-machine server's HTTP endpoints will be available on port 8000 and WebSocket API endpoints on port 8001. Your API key will be passed via --api-key config flag — simply replace YOUR_API_KEY with API key you've received via email.
CLI config flags
You can configure tardis-machine server via environment variables as described in Docker section as well.
You can set following CLI config flags when starting tardis-machine server installed via npm:
--api-key
API key for Tardis.dev HTTP API - if not provided only first day of each month of historical data is accessible
--port
8000
HTTP port on which server will be running, WebSocket port is always this value + 1 (8001 with port set to 8000)
--cache-dir
<os.tmpdir>/.tardis-cache
path to local dir that will be used as cache location - if not provided default temp dir for given OS will be used
--cluster-mode
false
will launch cluster of Node.js processes to handle the incoming requests if set to true, by default server runs in single process mode
--debug
false
server will print verbose debug logs to stdout if set to true
--clear-cache
false
server will clear local cache dir on startup is set to true
--help
shows CLI help
--version
shows tardis-machine version number
Examples
Historical normalized replay
Real-time normalized streaming
Last updated
