HTTP API Reference
HTTP based API providing historical market data feeds, supported exchanges details and more
Base API Endpoint: https://api.tardis.dev/v1
get
https://api.tardis.dev/v1
/data-feeds/:exchange
/data-feeds/:exchange
See downloadable CSV files documentation and related datasets API if you'd like to access historical tick-by-tick 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 the historical data this way.
Python
Node.js
cURL
1
import json
2
import requests
3
4
5
def get_data_feeds():
6
filters = [
7
{"channel": "trade", "symbols": ["XBTUSD", "ETHUSD"]},
8
{"channel": "orderBookL2", "symbols": ["XBTUSD", "ETHUSD"]},
9
]
10
qs_params = {"from": "2019-07-01", "offset": 3, "filters": json.dumps(filters)}
11
12
headers = {"Authorization": "Bearer YOUR_API_KEY"}
13
14
url = "https://api.tardis.dev/v1/data-feeds/bitmex"
15
16
response = requests.get(url, headers=headers, params=qs_params, stream=True)
17
18
for line in response.iter_lines():
19
# empty lines in response are being used as markers
20
# for disconnect events that occurred when collecting the data
21
if len(line) <= 1:
22
continue
23
24
parts = line.decode("utf-8").split(" ")
25
local_timestamp = parts[0]
26
message = json.loads(parts[1])
27
# local_timestamp string marks message arrival timestamp
28
# message is a message dict as provided by exchange real-time stream
29
print(local_timestamp, message)
30
31
32
get_data_feeds()
Copied!
See also Python client library with built-in data caching that provides more convenient access to tick-level historical market data — it returns data for the whole time periods in contrast to HTTP API where single call returns data for single minute time period.
1
const fetch = require('node-fetch')
2
const split2 = require('split2')
3
4
const serialize = (options) => {
5
return encodeURIComponent(JSON.stringify(options))
6
}
7
8
async function getDataFeeds() {
9
const filters = serialize([
10
{
11
channel: 'trade',
12
symbols: ['XBTUSD', 'ETHUSD']
13
},
14
{
15
channel: 'orderBookL2',
16
symbols: ['XBTUSD', 'ETHUSD']
17
}
18
])
19
20
const base_url = 'https://api.tardis.dev/v1/data-feeds/bitmex'
21
const url = `${base_url}?from=2019-07-01&offset=3&filters=${filters}`
22
23
const response = await fetch(url)
24
const lines = response.body.pipe(split2())
25
26
for await (const line of lines) {
27
// empty lines in response are being used as markers
28
// for disconnect events that occurred when collecting the data
29
if (line.length === 0) {
30
continue
31
}
32
33
const parts = line.split(' ')
34
const localTimestamp = parts[0]
35
const message = JSON.parse(parts[1])
36
// localTimestamp string marks message arrival timestamp
37
// message is a message dict as provided by exchange real-time stream
38
console.log(localTimestamp, message)
39
}
40
}
41
42
getDataFeeds()
Copied!
See also Node.js client library with built-in data caching that provides more convenient access to tick-level historical market data — it returns data for the whole time periods in contrast to HTTP API where single call returns data for single minute time period.
1
curl -g 'https://api.tardis.dev/v1/data-feeds/bitmex?from=2019-07-01&filters=[{"channel":"trade","symbols":["XBTUSD"]}]&offset=3'
Copied!
https://api.tardis.dev/v1/data-feeds/bitmex?from=2019-07-01&filters=[{%22channel%22:%22trade%22,%22symbols%22:[%22XBTUSD%22]}]&offset=3
api.tardis.dev
Click to see API response in the browser

Sample requests

https://api.tardis.dev/v1/data-feeds/bitmex?from=2019-04-1&offset=2
api.tardis.dev
Full BitMEX data feed from 2019-04-01T00:02:00.000Z to 2019-04-01T00:03:00.000Z
https://api.tardis.dev/v1/data-feeds/bitmex?from=2019-05-1&filters=[{%22channel%22:%22trade%22}]
api.tardis.dev
BitMEX trades for all instruments from 2019-05-01T00:00:00.000Z to 2019-05-01T00:01:00.000Z
https://api.tardis.dev/v1/data-feeds/bitmex?from=2019-06-1&filters=[{%22channel%22:%22trade%22,%20%22symbols%22:%20[%22XBTUSD%22]}]
api.tardis.dev
BitMEX trades for XBTUSD from 2019-06-01T00:00:00.000Z to 2019-06-01T00:01:00.000Z
https://api.tardis.dev/v1/data-feeds/deribit?from=2019-06-1&offset=10
api.tardis.dev
Full Deribit data feed from 2019-06-01T00:10:00.000Z to 2019-06-01T00:11:00.000Z
get
https://api.tardis.dev/v1
/exchanges
/exchanges

Sample request

https://api.tardis.dev/v1/exchanges
api.tardis.dev
List of all supported exchanges that historical market data is available for
get
https://api.tardis.dev/v1
/exchanges/:exchange
/exchanges/:exchange

Sample request

https://api.tardis.dev/v1/exchanges/bitmex
api.tardis.dev
BitMEX exchange details
get
https://api.tardis.dev/v1/
api-key-info
/api-key-info
Last modified 25d ago