For the complete documentation index, see llms.txt. This page is also available as Markdown.

HTTP API Reference

Historical market data feeds, exchange metadata and more

Base API Endpoint: https://api.tardis.dev/v1

/data-feeds/:exchange

GET https://api.tardis.dev/v1/data-feeds/:exchange

Returns historical market data for the requested exchange as newline-delimited JSON (NDJSON). Each line starts with the local timestamp in ISO 8601 format, followed by one exchange-native JSON message.

Empty lines mark disconnect events that occurred during data collection.

Requests without a compression query parameter must include an Accept-Encoding header that allows compressed responses.

By default, /data-feeds returns gzip. To get Zstandard, set compression=zstd and use a client that accepts and decodes content-encoding: zstd. Accept-Encoding: zstd alone is not enough because Cloudflare normalizes that header before it reaches the Worker.

By default, each request returns one minute of historical market data starting at from plus the minute offset. Filtered requests can set sliceSize from 1 to 10 to return consecutive minutes in one request.

Parallel requests to this endpoint are supported. Using more than ~60 parallel requests does not improve throughput. Use HTTP/1.1; in our testing HTTP/2 was noticeably slower for this endpoint.

Official client libraries are built on top of this endpoint and handle date ranges, caching, compression and normalized data formats.

Path Parameters

Name
Type
Description

exchange*

string

one of https://api.tardis.dev/v1/exchanges (field id)

Query Parameters

Name
Type
Description

from*

string

requested UTC start date of historical market data feed (e.g.: 2019-04-05 or 2019-04-05T01:02:00.000Z)

offset

number

Minute offset that, together with from, specifies the first minute of historical data returned. For example, from=2019-04-05, offset=2 and default sliceSize=1 returns data between 2019-04-05T00:02:00.000Z and 2019-04-05T00:03:00.000Z. With sliceSize greater than 1, the response starts at the same offset and covers consecutive minutes. Minute boundaries are based on localTimestamp (when we received the message), not exchange event timestamps. An empty response for a given offset is normal and means no data was recorded during that minute.

filters

string

URL-encoded JSON string in {channel:string, symbols?: string[]}[] format with optional historical market data filters, e.g.: [{"channel":"trade", "symbols":["XBTUSD"]}]

To request all active symbols for a channel, omit symbols or pass an empty symbols array. Use this when you need the whole channel instead of sending one request per symbol.

If you need selected symbols, put them in one symbols array. One filter can include up to 50 symbols.

Symbols are case-sensitive and must match the format returned by the /exchanges/:exchange API. For example, Binance uses lowercase symbols (btcusdt), not uppercase.

To get the list of allowed channels and symbols for each exchange, use the https://api.tardis.dev/v1/exchanges/:exchange API endpoint documented below.

Subscriptions with limited scope (e.g., perpetuals data plan) must provide explicit symbols in filters. Omitting symbols on a limited-scope plan will return an entitlement error.

sliceSize

number

Number of consecutive minutes returned by one request. Valid values are whole integers from 1 to 10. Default is 1.

Values greater than 1 require the filters query parameter.

sliceSize reduces /data-feeds request count when replaying consecutive minutes with the same filters.

compression

string

Optional response compression override for /data-feeds. Allowed values are gzip, zstd and zstd-multiframe. Prefer zstd-multiframe for Zstandard-capable clients; use zstd only when the decoder cannot consume concatenated frames.

Headers

Name
Type
Description

Authorization

string

For authenticated requests, provide the Authorization header with value Bearer YOUR_API_KEY. Without API key historical data feeds for the first day of each month are available.

Accept-Encoding

string

Required unless compression is set. Use gzip for default responses. To request Zstandard, set compression=zstd; Accept-Encoding: zstd alone is not enough.

Each line contains local timestamp (ISO 8601) and JSON message in exchange native data format. Compression is indicated by the content-encoding response header and can be zstd or gzip.

The x-slice-size response header contains the slice size used for this response. The x-suggested-slice-size response header contains a recommended sliceSize for later requests with the same exchange, filters and compression. Official Node.js and Python clients do this automatically.

compression=zstd-multiframe is more efficient and usually returns faster because it avoids server-side recompression. The response uses content-encoding: zstd and contains one independent Zstandard frame per minute, including one frame when sliceSize=1. Clients must decode every concatenated frame; the official clients handle this automatically. Plain compression=zstd remains available for decoders that support only a single Zstandard stream.

Invalid request parameters. This includes sliceSize values outside 1 to 10, non-integer sliceSize values, and sliceSize greater than 1 without filters.

Example response headers:

Example response body:

Too many requests. Retry later. A 429 response for filtered /data-feeds requests may include x-suggested-slice-size; use that value as sliceSize on later requests with the same exchange, filters and compression.

Example response headers:

Example response body:

Lines in the response are ordered by capture time. When multiple events share the same millisecond exchange timestamp, use line order as the tie-breaker — see event ordering FAQ.

See downloadable CSV files documentation and related datasets API if you'd like to access historical tick-level trades, order book snapshots, incremental order book L2 updates, options chains, quotes, derivative tickers and liquidations datasets in daily intervals split by exchange, data type and symbol. It may be faster and more native to your toolkit to access historical data this way.

The Python client adds local caching and date-range replay on top of this endpoint, so you can request longer periods while the client handles raw data replay requests.

The Node.js client adds local caching, date-range replay, and normalized data helpers on top of this endpoint, so you can request longer periods while the client handles raw data replay requests.

Sample requests

Full BitMEX data feed from 2019-04-01T00:02:00.000Z to 2019-04-01T00:03:00.000Z
BitMEX trades for all instruments from 2019-05-01T00:00:00.000Z to 2019-05-01T00:01:00.000Z
BitMEX trades for XBTUSD from 2019-06-01T00:00:00.000Z to 2019-06-01T00:01:00.000Z
BitMEX trades for XBTUSD from 2019-06-01T00:00:00.000Z to 2019-06-01T00:05:00.000Z (sliceSize=5)
Full Deribit data feed from 2019-06-01T00:10:00.000Z to 2019-06-01T00:11:00.000Z

/exchanges

GET https://api.tardis.dev/v1/exchanges

Gets the list of all supported exchanges that historical market data is available for.

Example response shortened for readability. Use the live endpoint for the current full exchange list.

Sample request

List of all supported exchanges that historical market data is available for

/exchanges/:exchange

GET https://api.tardis.dev/v1/exchanges/:exchange

Gets the exchanges details: available symbols, availability dates, available channels, CSV datasets info, incidents etc.

Path Parameters

Name
Type
Description

exchange*

string

one of https://api.tardis.dev/v1/exchanges (field id)

channelDetails[].changes is optional. When present, each entry describes previous user-visible metadata for the same public channel up to until; omitted fields are unchanged from the current channel detail. Typical changed fields are apiVersion, frequency, sourceFor, description, additionalInfo, and generated.

Sample request

BitMEX exchange details

/api-key-info

GET https://api.tardis.dev/v1/api-key-info

Given API_KEY provided in request header provides information about what historical data (exchanges, date ranges, symbols) is available for given API_KEY.

Headers

Name
Type
Description

Authorization*

string

Authorization header with value: 'Bearer YOUR_API_KEY'

Last updated

Was this helpful?