API version: 1.0
For websocket API, see WSAPIDOC
Endpoints:
https://api.algohouse.ai/
Timestamps specifying date ranges in request have format YYYY-DD-MM'T'HH:MI:SS, for example: 2022-09-31T14:59:20. All times are in UTC.
Output format is: tab-separated values (tsv) with implicit (from doc) column names.
Authorization (for historical data) is performed by signing the request URL. At the time of the writing,
the authorization of realtime data is not yet implemented.
signerEmail
requestTimestamp
. Timestamp is the current time since UNIX epoch in millis. Server will refuse calls with this argument containing time which is too far from current clock.The signing workflow is represented below (in shell script):
# this comes from registration
EMAIL=user@domain.tld
SIGNKEY=52fdfc072182654fa63f5f0f9a621d7a
# this is original request composed of API arguments
QUERY="/trades_aggregated?ins=1000LUNCBUSD&ex=binance/f&from=2020-01-01T00:00:00&to=2023-01-01T00:00:00&aggregation=1m"
# this is preparation for signing - adding 2 identification arguments
QUERY="$QUERY&signerEmail=$EMAIL"
QUERY="$QUERY&requestTimestamp=`date +%s`000"
# calculating the signature
QUERY="$QUERY&signature=`echo -n $QUERY | openssl dgst -sha256 -hmac $SIGNKEY| awk '{print $2}'`"
# performing the request
curl "https://api.algohouse.ai${QUERY}"
Of course, this workflow can be implemented in other preferred language, and is given as a reference implementation.
HTTP GET /instruments
This will return list of active instruments in a system. One line per pair. There's no more detailed metadata on the
pairs yet (generalized name etc)
Example output:
$ curl -s https://api.algohouse.ai/instruments
coinbase 1INCH-BTC spot 1INCH BTC 7 1 1 0 0
coinbase 1INCH-EUR spot 1INCH EUR 3 1 1 0 0
coinbase 1INCH-USD spot 1INCH USD 3 1 1 0 0
coinbase AAVE-BTC spot AAVE BTC 6 1 1 0 0
Each record contains following columns
NB: the metadata format is subject to change in backwards-compatible way. The meaning of existing
fields is guaranteed to remain, with new fields to be added as needed.
HTTP GET /exchanges
HTTP GET /exchanges.json
This will return list of all exchanges in a system.
Example output:
$ curl -s https://api.algohouse.ai/exchanges
# exchange_code exchange_transport_quality_score exchange_official_volume_score exchange_data_credibility toptier official_name exchange_url instrument_trade_url
ace 0.0 0.0 0.0 0 ace https://ace.io/
aex 0.0 0.0 0.0 0 aex https://www.aex.com/
apexpro 0.9 1.0 0.9 1 apexpro https://pro.apex.exchange/trade/BTCUSD
ascendex 0.9 1.0 1.0 1 ascendex https://ascendex.com/en/cashtrade-spottrading/usdt/btc
...
# END
Each record contains following columns
HTTP GET /options?query
This will return list of known options in a system. One line per instrument.
query arguments are described below:
Example output:
$ curl 'https://api.algohouse.ai/options?ex=binance/o&date=2023-07-07'
binance/o BTC-230929-15000-C 2023-03-28 BTC 2023-09-29 15000 CALL A
binance/o BTC-230929-15000-P 2023-03-28 BTC 2023-09-29 15000 PUT E
binance/o BTC-230929-20000-C 2023-03-28 BTC 2023-09-29 20000 CALL A
binance/o BTC-230929-20000-P 2023-03-28 BTC 2023-09-29 20000 PUT A
binance/o BTC-230929-25000-C 2023-03-28 BTC 2023-09-29 25000 CALL A
...
Each record contains following columns
NB: the metadata format is subject to change in backwards-compatible way. The meaning of existing
fields is guaranteed to remain, with new fields to be added as needed.
HTTP GET /trades?query
HTTP GET /trades.json?query -- will produce JSON output
query arguments are described below:
Each record contains following columns
Example output:
$ curl -s 'https://api.algohouse.ai/ins=BTC-USD&ex=coinbase&from=2023-02-21T00:00:00&limit=100&to=2024-01-06T00:00:00'
1677004777410 B 24577.170000 0.000082
1677004777435 S 24577.520000 0.004028
1677004777456 B 24577.510000 0.000386
1677004777487 B 24577.540000 0.017565
1677004777488 B 24577.540000 0.003545
1677004777514 S 24578.550000 0.000406
....
HTTP GET /multi/trades?params
HTTP GET /multi/trades.json?params
query arguments are described below:
NB: For options trades, seting base_currency to single element like "BTC", will return BTC-24MAR-24-62000-C and all similar instruments.
For options instruments, multiple currencies is not suported.
Each record contains following columns
Example output:
$ curl -s 'https://api.algohouse.ai/multi/trades?base_currencies=BTC,ETH"e_currencies=USD*,EUR&exchanges=*&ins=BTCUSD&from=2023-01-06T17:30:00&limit=10000&to=2024-01-06T00:00:00'
1675428799446 coinbase ETH-USD B 1652.280000 0.302592
1675428799447 coinbase ETH-USD B 1652.270000 0.006468
1675428799528 coinbase ETH-USDT S 1652.530000 0.003043
1675428799560 coinbase ETH-USDT S 1652.530000 0.000006
1675428800358 coinbase BTC-USD B 23534.350000 0.011700
1675428800359 coinbase BTC-USD B 23534.350000 0.011058
1675428800587 coinbase ETH-USD B 1652.200000 0.060950
1675428800590 coinbase ETH-USD B 1652.200000 1.642310
1675428800601 coinbase ETH-USD B 1652.200000 0.301060
1675428800605 coinbase ETH-USD B 1652.090000 0.302616
1675428800606 coinbase ETH-USD B 1652.080000 0.907946
1675428800640 coinbase ETH-USD B 1652.020000 0.650000
1675428800640 coinbase ETH-USDT B 1652.140000 0.383200
HTTP GET /trades_aggregated?query
HTTP GET /trades_aggregated.json?query
query arguments are described below:
Each record contains following columns
Example output:
$ curl -s 'https://api.algohouse.ai/trades_aggregated?ins=BTC-USD&ex=coinbase&from=2023-02-21T00:00:00&limit=100&to=2024-01-06T00:00:00&aggregation=1m'
1676937600000 24841.34 24849.53 24833.68 24835.63 3.28310616 180 24844.383341987836
1676937660000 24835.63 24842.03 24824.73 24829.9 4.28656456 258 24830.62173560299
1676937720000 24829.9 24843.67 24827.11 24830.62 26.97287251 354 24837.614159779972
1676937780000 24830.61 24836.01 24822.96 24829.16 3.60295447 210 24830.101053576014
1676937840000 24829.06 24829.16 24820.27 24821.16 3.54654831 235 24824.926026726276
1676937900000 24821.16 24835.8 24815.16 24835.79 15.69944144 247 24824.156182249913
1676937960000 24835.23 24835.79 24822.32 24830.12 7.25260626 239 24826.47482317252
...
HTTP GET /orderbooks?query
HTTP GET /orderbooks.json?query -- will produce json output
query arguments are described below:
Each record contains following columns
Note that orderbooks deltas are stored in following format: vol1@price1|vol2@price2|....|volN@priceN . Example: 56@.00000782|174.5323@.000003|705@.00000188|86.9787@.00000216|50.8867@.00000215|227.86764705@.00000203
Also, the time offset may be included: vol1@price1|+300|vol1@price2|vol3@price3... This denotes that following happened:
Time offsets come monotonically increasing, and their meaning is time offset (from base timestamp) of subsequent price changes, as explained above.
Note that output can be truncated, in this case, last line will contain this comment: # truncated . Output will not be split in the middle of the second. To resume, you can use next second (without milliseconds) after last received row in "from" parameter.
Example: /orderbooks?ins=BTCUSD&ex=liquid&from=2022-09-27T00:00:00&to=2222-09-28T01:00:00
Example output:
$ curl -s 'https://api.algohouse.ai/orderbooks?ins=BTC-USD&ex=coinbase&from=2023-01-27T05:00:00&to=2023-01-29T01:00:00'
1674795600000 B .03672002@22802.03|.05@22801.99|.21921092@22801.98|.04@22801.65|.21914155@22801.23|.28885622@22801.16|.08771685@22800.63|.21929336@22800.5|.715881@22800.33|.01057166@22800|.76912944@22799.57|.132@22799.24|.72348125@22799.01|.31001105@22799 R
1674795600000 S .00000005@9999999999|.00000002@9999999998|.00000001@8888888888|.00000001@2000000000|1.00000003@1000000000|.00000001@799000000|.00000001@750000000|.00000001@500000000|.25@48322747.41|.0001@32438915|.00007237@21000000|.00007237@20000000 R
1674798677093 S .224@22947.26|0@22947.89|.92162995@22950.55|.019537@22947.27|+60|.03@22947.85|0@22947.29|.263@22947.14|.22@22947.26|1.72639885@22950.55|.023519@22947.25|+121|0@22947.27|+181|.22@22947.14|.062519@22947.13
1674798677093 B .019@22944.4|.03@22943.76|0@22943.45|+60|.010899@22942.95|+121|.03@22943.64|+181|.004@22943.8|.019519@22943.79|0@22944.39|.059@22944.4
HTTP GET /options_aggregated?query
HTTP GET /options_aggregated.json?query -- will produce JSON output
query arguments are described below:
Each record contains following columns
timestamp, instrument, ask_min_price, ask_max_price, ask_last_price,ask_avg_price,ask_volume, bid_min_price,
bid_max_price, bid_last_price,bid_avg_price,bid_volume, open_interest
Example output:
$ curl -s 'https://api.algohouse.ai/options_aggregated?ex=binance/o&ins=BTC&from=2023-04-10T00:00:00&to=2025-01-10T06:00:00&limit=2000&aggregation=1h'
1687154400000 BTC-230929-25000-C 347500 351500 351500 349520.662412640518158 1.14 313000 321000 320500 318191.583105439105039 3.813956244302643 0
1687154400000 BTC-230929-40000-C 34500 35000 35000 34501.670209535377408 4.12136957181901 28500 31500 30500 29715.912541755240448 3.641120558761008 0
1687158000000 BTC-230620-26500-P 21500 26500 25500 25403.56083086053376 4.819234421364985 20500 23500 22500 22041.691394658750464 6.27473887240356 0
1687158000000 BTC-230623-25000-C 158000 161500 160000 159943.916913946591232 2.479964391691394 139000 142500 142500 141577.299703264083969 4.159225519287834 0
1687158000000 BTC-230619-27500-P 123500 123500 123500 123500.000000000000002 2.7 98000 104500 103500 103293.930310977896451 0.450708130385912 0
....
with json:
$ curl -s 'https://api.algohouse.ai/options_aggregated.json?ex=binance/o&ins=BTC&from=2023-04-10T00:00:00&to=2025-01-10T06:00:00&limit=2000&aggregation=1h'
{"ts":1687158000000,"ins":"BTC-230630-27000-P"," askmin":103000,"askmax":106000,"asklast":105000,"askavg":104580.679086538473475,"askvol":4.424429086538461,"bidmin":97500,"bidmax":100500,"bidlast":99500,"bidavg":99569.561298076925955,"bidvol":2.821514423076923,"open_interest":0}
,{"ts":1687158000000,"ins":"BTC-230623-29000-P"," askmin":273000,"askmax":273500,"asklast":273500,"askavg":273163.501483679514626,"askvol":2.823133531157269,"bidmin":237000,"bidmax":259000,"bidlast":237000,"bidavg":237228.486646884270084,"bidvol":2.672062314540059,"open_interest":0}
...
HTTP GET /option_quotes?query
HTTP GET /option_quotes.json?query
query arguments are described below:
BTC-
as instrument name to obtain full elements of composite option.Each record in response contains following columns in order:
Note the missing columns vary from exchange to exchange. In such cases, they contain zero values.
Example: /option_quotes?from=2022-12-10T00:00:00&ins=BTC-&ex=deribit/o&to=2022-12-11T00:00:00
Example output:
$ curl -s 'https://api.algohouse.ai/option_quotes?from=2022-12-10T00:00:00&ins=BTC-&ex=deribit/o&to=2022-12-11T00:00:00'
# ts instrument underlying_price settlement_price open_interest min_price max_price mark_price mark_iv last_price interest_rateindex_price greek_vega greek_theta greek_rho greek_gamma greek_delta estimated_delivery_price bid_iv best_bid_amount best_bid_price ask_iv best_ask_amount best_ask_price volume_24h
1670630400138 BTC-10DEC22-16500-C 17129.223600 0.042895 100.000000 0.000100 0.074500 0.036800 54.870000 0.042000 0.000000 17130.590000 0.158670 -4.353010 0.148840 0.000110 0.98826017130.590000 0.000000 5.000000 0.015500 282.980000 5.000000 0.055000 0.000000
1670630400138 BTC-11DEC22-16750-C 17125.424700 0.000000 1.000000 0.000100 0.060500 0.023200 32.400000 0.023000 0.000000 17130.590000 2.151870 -26.145000 0.531780 0.000620 0.87322017130.590000 19.810000 2.400000 0.022000 999.000000 0.400000 0.908000 0.000000
1670630400480 BTC-11DEC22-16500-C 17125.424700 0.000000 100.000000 0.001000 0.074500 0.037000 38.060000 0.043000 0.000000 17130.590000 1.095530 -15.633910 0.570110 0.000270 0.94835017130.590000 0.000000 0.000000 0.000000 999.000000 0.300000 0.790000 0.000000
...
HTTP GET /stream?query where query arguments are described below:
Example: /stream?ins=BTCUSD&ex=liquid
Each record contains following columns
Example output:
$ curl -s 'https://api.algohouse.ai/stream?ins=BTC-USDT&ex=coinbase'
$ 1677006219597 BTC-USDT B .00000081@24695.41|.03239927@24688.91|.00228286@24683.93|.055@24683.59|.97239958@24678.59|.08454194@24665.24|.03243694@24660.24|.0519004@24659.69|.08109421@24659.68|.04865669@24659.6|.06488085@24657.59|.055@24657.22|.01976939@24657.19|.00794749>
$ 1677006219597 BTC-USDT S .00100001@10000000|.00100001@9000000|.00100001@8000000|.00100001@7000000|.00100001@6000000|.00100001@5000000|.00100001@4000000|.00100001@3000000|.00049329@2679288.22|.000644@2216718.64|.00100001@2100000|.00100001@2000000|.00003308@1871713|.0154>
$ 1677006219598 BTC-USDT S 0@24664.53|0@24664.37|0@24664.34|.04054976@24664.52
$ 1677006219642 BTC-USDT B .02@24656.46
...
$ 1677006228756 BTC-USDT S .02@24670.61|0@24665.07|.2@24670.59|0@24671.59|0@24671.58|.12557482@24672.11|.5@24670.6
$ 1677006228971 BTC-USDT B 0@24605.79|.31393683@24659.92|.13517474@24659.93
! 1677006229074 BTC-USDT B 24661.410000 0.000108
...
HTTP GET /stream/snapshots?query where query arguments are described below:
Example: /stream/snapshots?ins=BTCUSD&ex=liquid&topn=5
Each record contains following columns
Example output:
$ curl -s 'https://api.algohouse.ai/stream?ins=BTC-USD&ex=coinbase&topn=5'
$ 1682159256876 BTC-USD B .26506875@27228.06|.11018048@27228.05|.05647589@27227.76|.2@27227.69|.02929758@27227.28
$ 1682159256935 BTC-USD B .21916175@27228.06|.11018048@27228.05|.2@27227.69|.11018607@27226.67|.04905841@27226.51
$ 1682159256935 BTC-USD S .04942311@27229.3|.08974338@27229.33|.05979717@27229.36|.06492636@27229.37|.05140142@27229.4
$ 1682159256995 BTC-USD B .22834375@27228.06|.11018048@27228.05|.02993371@27227.75|.2@27227.69|.14691207@27226.67
$ 1682159256995 BTC-USD S .08974338@27229.33|.05979717@27229.36|.06492636@27229.37|.05140142@27229.4|.06227788@27229.42
$ 1682159257203 BTC-USD B .11018048@27228.05|.02992615@27227.75|.12@27227.7|.11018607@27226.67|.59886475@27226.5
$ 1682159257203 BTC-USD S .01455@27228.07|.22@27228.6|.00119925@27228.61|.47134098@27228.63|.018363@27228.64
$ 1682159257294 BTC-USD B .11018048@27228.05|.02881907@27226.77|1.096@27226.49|.11949494@27225.96|.04767597@27225.52
$ 1682159257294 BTC-USD S .62404048@27228.06|.018363@27228.07|.01790364@27228.26|.22@27228.6|.00119925@27228.61
$ 1682159257357 BTC-USD B .11018674@27226.5|1.096@27226.49|.02890255@27226.19|.02993574@27226.12|.23911107@27225.5
$ 1682159257357 BTC-USD S .44@27226.51|.04787607@27227.33|.03406564@27227.34|.15584797@27227.36|.04497139@27228.01
$ 1682159257397 BTC-USD S .58251117@27226.51|.15584797@27227.36|.007343@27227.46|.003672@27227.55|.00205361@27227.98
$ 1682159257472 BTC-USD B .11018674@27226.5|1.096@27226.49|.03808455@27226.19|.02993574@27226.12|.23911107@27225.5
$ 1682159257472 BTC-USD S .64678717@27226.51|.00237221@27227.32|.036729@27227.35|.15584797@27227.36|.007343@27227.46
...
HTTP GET /stream/bbo?query where query arguments are described below:
Example: /stream/bbo?ins=BTCUSD&ex=liquid
Each record contains following columns
Example output:
$ curl -s 'https://api.algohouse.ai/stream/bbo?ins=BTC-USDT&ex=coinbase'
1682159622962 BTC-USD BID:.037@27229.89 ASK:1.21389435@27229.9
1682159622963 BTC-USD BID:.037@27229.89 ASK:1.28734235@27229.9
1682159623002 BTC-USD BID:.037@27229.89 ASK:1.21389435@27229.9
1682159623088 BTC-USD BID:.037@27229.89 ASK:1.31488535@27229.9
1682159623234 BTC-USD BID:.25045@27229.89 ASK:1.31488535@27229.9
1682159623234 BTC-USD BID:.25045@27229.89 ASK:1.29488535@27229.9
1682159623244 BTC-USD BID:.25045@27229.89 ASK:1.26734235@27229.9
1682159623351 BTC-USD BID:.017@27229.89 ASK:1.26734235@27229.9
1682159623351 BTC-USD BID:.017@27229.89 ASK:1.24559685@27229.9
1682159623370 BTC-USD BID:.017@27229.89 ASK:1.26559685@27229.9
1682159623674 BTC-USD BID:.037@27229.89 ASK:1.26559685@27229.9
1682159623674 BTC-USD BID:.037@27229.89 ASK:1.26548778@27229.9
1682159623724 BTC-USD BID:.25045@27229.89 ASK:1.26548778@27229.9
1682159623724 BTC-USD BID:.25045@27229.89 ASK:1.19203978@27229.9
1682159623886 BTC-USD BID:.037@27229.89 ASK:1.19203978@27229.9
...
These API's work on the vocabulary that converts from/to currency to particular instrument. If this instrument is available on exchange,
the data will be shown, like in the aggregate data example above. If instrument is not available, the conversion using third currency is
not yet implemented.
Please note that output of the API is mostly compatible with existing formats. The output is in JSON,
in contrast to AlgoHouse native output format.
HTTP GET /data/v2/histoday?query - get daily OHLCV data
HTTP GET /data/v2/histohour?query - get hourly OHLCV data
HTTP GET /data/v2/histominute?query - get minute OHLCV data
where query arguments are described below:
Example output:
{
"Data": {
"Aggregated": false,
"Data": [
{
"close": 27925.01,
"conversionSymbol": "",
"conversionType": "direct",
"high": 27925.88,
"low": 27922.58,
"open": 27925.87,
"recordNo": 0,
"time": 1680863400,
"timeString": "2023-04-07 10:30:00 +0000 UTC",
"volumefrom": 0.0015663493558880025,
"volumeto": 43.74004
},
{
"close": 27917.16,
"conversionSymbol": "",
"conversionType": "direct",
"high": 27925.25,
"low": 27914.83,
"open": 27925.01,
"recordNo": 1,
"time": 1680863460,
"timeString": "2023-04-07 10:31:00 +0000 UTC",
"volumefrom": 0.0016965671397791665,
"volumeto": 47.37035
}
],
"TimeFrom": "2023-04-07T10:29:18",
"TimeTo": "2023-04-07T10:44:18"
},
"HasWarning": false,
"Message": "",
"Response": "Success",
"Type": 100
}
HTTP GET /data/ob/l1/top - obtain top values (bit,ask prices/volumes) of the orderbook
HTTP GET /data/v2/ob/l2/snapshot - obtain top N values (prices/volumes) of the orderbook, for bids and asks
where query arguments are described below:
Example outputs:
Top of orderbook:
{
"Data": {
"DISPLAY": {
"BTC": {
"USD": {
"ASK": 27958.4,
"BID": 27956.07
}
}
},
"RAW": {
"BTC": {
"USD": {
"ASK": 27958.4,
"ASK_REPORTED_MS": 1680864786593,
"BID": 27956.07,
"BID_REPORTED_MS": 1680864786593
}
}
}
},
"HasWarning": false,
"Message": "",
"Response": "Success",
"Type": 100
}
Snapshot of orderbook (depth=3):
{
"Data": {
"ASK": [
{
"P": 27951.32,
"Q": ".10732946"
},
{
"P": 27951.34,
"Q": ".138594"
},
{
"P": 27952.01,
"Q": ".175"
}
],
"BID": [
{
"P": 27950.33,
"Q": ".00003506"
},
{
"P": 27949.16,
"Q": ".00455529"
},
{
"P": 27948.59,
"Q": ".05785011"
}
],
"FSYM": "BTC",
"M": "coinbase",
"TSYM": "USD",
"Type": 9
},
"HasWarning": false,
"Message": "",
"Response": "Success",
"Type": 100
}
Returns current and average values for the symbol. See output below for details.
HTTP GET /latest_tick?query - get general symbol information
with query parameters:
Example usage:
curl -s 'https://api.algohouse.ai/latest_tick?ins=BTC-USD&ex=coinbase'
{
"LAST_UPDATE_QUANTITY": 0.00000368,
"LAST_UPDATE_PRICE": 28089.83,
"LAST_UPDATE_QUOTE_QUANTITY": 0.000000000131008,
"VALUE_LAST_UPDATE_TS": "2023-04-21 12:14:10",
"CURRENT_HOUR_VOLUME": 553.13078215,
"CURRENT_HOUR_TOTAL_INDEX_UPDATES": 46,
"CURRENT_HOUR_OPEN": 28001.94,
"CURRENT_HOUR_CLOSE": 28089.83,
"CURRENT_HOUR_HIGH": 28096.58,
"CURRENT_HOUR_LOW": 28063.63,
"CURRENT_HOUR_CHANGE": 87.89,
"CURRENT_DAY_VOLUME": 31141.08897863,
"CURRENT_DAY_TOTAL_INDEX_UPDATES": 1387,
"CURRENT_DAY_OPEN": 28297.37,
"CURRENT_DAY_CLOSE": 28089.83,
"CURRENT_DAY_HIGH": 28956.83,
"CURRENT_DAY_LOW": 28920.02,
"CURRENT_DAY_CHANGE": -207.54,
"CURRENT_MONTH_VOLUME": 106882.36430662,
"CURRENT_MONTH_TOTAL_INDEX_UPDATES": 701,
"CURRENT_MONTH_OPEN": 30321.41,
"CURRENT_MONTH_CLOSE": 28089.83,
"CURRENT_MONTH_HIGH": 30981.5,
"CURRENT_MONTH_LOW": 30879.92,
"CURRENT_MONTH_CHANGE": -2231.58,
"LIFETIME_FIRST_UPDATE_TS": "2023-04-07 00:00:58",
"LIFETIME_VOLUME": 694988.05635148,
"LIFETIME_QUOTE_VOLUME": 34.98910568096015,
"LIFETIME_OPEN": 28053.46,
"LIFETIME_HIGH": 30497.75,
"LIFETIME_LOW": 16542.52,
"LIFETIME_TOTAL_INDEX_UPDATES": 107,
"LIFETIME_CHANGE": 2304.67
}