Quickstart

Install, configure and get started with the tardis-dev npm package

Node.js tardis-dev library provides convenient access to tick-level historical and real-time cryptocurrency market data both in exchange-native and normalized formats. Instead of callbacks it relies on async iteration (for await ...of) enabling composability features like seamless switching between real-time data streaming and historical data replay or computing derived data locally.

Features

Tardis-dev GitHub repository

Installation

Requires Node.js v24+ installed.

Node.js examples on this page use ES modules and top-level await. Save snippets as .mjs or set "type": "module" in your package.json.

Historical Replay

Replaying Historical Data

Real-Time Streaming

Streaming Real-Time Data

Debugging and logging

tardis-dev lib uses debug package for verbose logging and debugging purposes that can be enabled via DEBUG environment variable set to tardis-dev*.

ES Modules and TypeScript

Examples in this page use standard ES module imports and top-level await:

This works in modern Node.js and gives you first class TypeScript typings.

Historical market data helpers

init(options)

This function doesn't affect real-time streaming functionality in any way, it's useful only for historical data replay.

When working with market data via replay and replayNormalized, by default only the first day of each month of historical data is available for replay, and locally cached historical data is stored in the default location on disk (OS temp dir).

Init function allows providing an apiKey received via email after ordering historical market data access via Tardis.dev website, a custom cacheDir, and the preferred compression for historical replay requests. apiKey can also be provided directly via options of replay and replayNormalized functions - that overrides anything that was provided via init.

init options

name
type
default
description

apiKey

string (optional)

undefined

API key for Tardis.dev HTTP API - if not provided only first day of each month of historical data is accessible

cacheDir

string

<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

dataFeedCompression

'zstd' | 'gzip' (optional)

'zstd'

preferred compression for historical replay requests; set to 'gzip' when you need the client to request gzip-compressed slices

getExchangeDetails(exchange)

Given exchange id provides exchange details (available symbols, availability dates, available channels, pricing info etc) provided by exchanges/:exchange API endpoint.

type of response returned by awaiting on getExchangeDetails

getApiKeyAccessInfo(apiKey?)

Given apiKey provided as optional parameter or provided in init function provides information about what historical data access is available for it: exchanges, access type, data plan, date ranges, and symbol restrictions.

type of response returned by awaiting on getApiKeyAccessInfo()

clearCache()

Clears local data cache dir.

downloadDatasets(options)

Downloads CSV datasets for specified exchange, data types, symbols and date range. Handles day-by-day downloads, retries and skipping already-downloaded files automatically.

Download via client libraries

getInstrumentInfo(exchange, symbol)

Returns instrument metadata (tick sizes, contract multipliers, base/quote currencies) for a given exchange and symbol.

You can also pass an instrument metadata filter, or an array of exchanges, when you need full metadata records.

findInstrumentSymbols(exchanges, filter, selector?)

Use this helper when you know the market you want but not each exchange's symbol format. It queries the Instruments Metadata API with normalized criteria and returns the correct exchange-specific id for each requested exchange, ready to pass to replay, streaming, or raw data feeds.

The optional selector defaults to id. Pass datasetId only when you need symbols for direct CSV dataset file downloads:

Returned symbols are exchange-provided IDs and are not normalized by the client.

Last updated

Was this helpful?