We're happy to introduce our bulk REST API built with the Rust programming language. This delivery mechanism allows larger requests than our existing GraphQL endpoint and is more suitable for heavy workloads.
We've tried to maintain consistency between the returned objects and the parameters used with our existing GraphQL product.
We will be adding functionality, documentation, and API clients as we get feedback from our customers. Thank you!
Connecting
The REST API is available at https://rest.blocktap.io
To make a valid request, you will need to provider you API via the Authorization
header in the format Bearer <token>
:
Authorization: Bearer 0000000000000000000000000000000000000000000000000000000000000000
For testing purposes you can supply the API key via the the query string using api_key=<your_api_key>
.
The following API endpoints are now available:
/exchanges
Queries available exchanges and returns a JSON array of the exchange objects.
Result - JSON Array
[
{
"exchangeSymbol": "Bibox",
"exchangeName": "Bibox",
"isActive": true
},
{
"exchangeSymbol": "Binance",
"exchangeName": "Binance",
"isActive": true
}
]
exchangeSymbol
:string
- symbol of the exchange used in subsequent queriesexchangeName
:string
- name of the exchangeisActive
:boolean
- indicates if the exchange is still active
/currencies
Queries available currencies and returns a JSON array of the currency objects.
Query Parameters
currencySymbol
- symbol for of the currency. Supports wildcards via%
symbol.
https://rest.blocktap.io/currencies?currencySymbol=btc%currencyName
- name of the currency. Supports wildcards via%
symbol
https://rest.blocktap.io/currencies?currencyName=bit%isActive
-true
to filter for active markets,false
to filter to inactive currencies.
https://rest.blocktap.io/currencies?isActive=false
Results - JSON Array
[{
"currencySymbol": "BTC",
"currencyName": "Bitcoin",
"isActive": true
},
{
"currencySymbol": "BTCP",
"currencyName": "Bitcoin Private",
"isActive": true
}
...
]
currencySymbol
:string
- the normalized symbol of the currencycurrencyName
:string
- the common name of the currencyisActive
:boolean
- true when the currency is still active
/markets
Queries available markets and returns a JSON array of the market objects.
Query Parameters
exchangeSymbol
- optionally filters markets by exchange
https://rest.blocktap.io/markets?exchangeSymbol=coinbaseprobaseSymbol
- optionally filters markets by base currency symbol
https://rest.blocktap.io/markets?baseSymbol=btcquoteSymbol
- optionally filters markets by quote currency symbol
https://rest.blocktap.io/markets?quoteSymbol=usd
Results - JSON Array
[
{
"id": "bitfinex_btc_usd",
"marketType": "Spot",
"marketSymbol": "Bitfinex:BTC/USD",
"marketStatus": "Active",
"exchangeSymbol": "Bitfinex",
"baseSymbol": "BTC",
"quoteSymbol": "USD",
"remoteId": "BTCUSD"
},
{
"id": "bitflyer_btc_usd",
"marketType": "Spot",
"marketSymbol": "bitFlyer:BTC/USD",
"marketStatus": "Active",
"exchangeSymbol": "bitFlyer",
"baseSymbol": "BTC",
"quoteSymbol": "USD",
"remoteId": "BTC_USD"
},
{
"id": "bitmex_btc_usd",
"marketType": "Swap",
"marketSymbol": "BitMEX:BTC/USD",
"marketStatus": "Active",
"exchangeSymbol": "BitMEX",
"baseSymbol": "BTC",
"quoteSymbol": "USD",
"remoteId": "XBTUSD"
},
...
]
id
:string
- unique identifier for the marketmarketType
:string
- indicates Spot, Futures, Swap, or Options marketsmarketSymbol
:string
- the printable symbol for the marketmarketStatus
:string
- Active or InactiveexchangeSymbol
:string
- the symbol for the exchangebaseSymbol
:string
- the symbol for the base currencyquoteSymbol
:string
- the symbol for the quote currencyremoteId
:string
- the identifier the exchange uses for the market
/markets/:market_id
Queries a single market by its market identifier and returns a JSON object. This is the same object returned in the list of markets in the /markets
API.
Example: https://rest.blocktap.io/markets/bitmex_btc_usd
Returns - JSON Object
{
"id": "bitmex_btc_usd",
"marketType": "Swap",
"marketSymbol": "BitMEX:BTC/USD",
"marketStatus": "Active",
"exchangeSymbol": "BitMEX",
"baseSymbol": "BTC",
"quoteSymbol": "USD",
"remoteId": "XBTUSD"
}
id
:string
- unique identifier for the marketmarketType
:string
- indicates Spot, Futures, Swap, or Options marketsmarketSymbol
:string
- the printable symbol for the marketmarketStatus
:string
- Active or InactiveexchangeSymbol
:string
- the symbol for the exchangebaseSymbol
:string
- the symbol for the base currencyquoteSymbol
:string
- the symbol for the quote currencyremoteId
:string
- the identifier the exchange uses for the market
/markets/:market_id/candles
Queries for OHLCV candles for the market. This API currently does not have restrictions on the number of candles returned.
Query Parameters
period
- required field with values1m
,5m
,15m
,30m
,1h
,2h
,4h
,12h
,1d
startDate
- required field, that starting time in RFC3339/ISO8601 format (2020-01-01T00:00:00Z)endDate
- optional field that defaults to the current time. Value must be in RFC3339/ISO8601 format (2020-01-01T00:00:00Z)
Example: https://rest.blocktap.io/markets/bitmex_btc_usd/candles?period=1d&startDate=2020-01-01T00:00:00Z
Returns - JSON Array
[
[
"1577836800",
"7162.50000000",
"7234.50000000",
"7153.00000000",
"7179.00000000",
"762775093.00000000"
],
[
"1577923200",
"7179.00000000",
"7183.00000000",
"6905.50000000",
"6942.00000000",
"1471023953.00000000"
],
...
]
Array of string values where the columns represent
- Unix timestamp of start of candle
- Open price of the first trade in the period
- High price trade during the period
- Low price trade during the period
- Closing trade price
- Volume of traded assets in the base currency
/markets/:market_id/trades
Queries for raw trade information for the the market. This API is currently limited to 1 day's worth of trades. We may increase limits as we get additional feedback.
Query Parameters
startDate
- required field, that starting time in RFC3339/ISO8601 format (2020-01-01T00:00:00Z)endDate
- optional field that defaults to the current time. Value must be in RFC3339/ISO8601 format (2020-01-01T00:00:00Z)
Returns - JSON Array
[
{
"id": "4fb119fdb7298f07e3436d186554f958",
"unix": 1596067203072,
"buy": "Bid",
"price": "11109.00000000",
"amount": "29.00000000"
},
{
"id": "cf5eea66c16d892a5a2c3fbc4596d5bd",
"unix": 1596067203079,
"buy": "Bid",
"price": "11109.00000000",
"amount": "657.00000000"
},
...
]
id
:string
- uniqued identifier for the trade provided by the exchangeunix
:number
- millisecond unix timestamp provided by the exchange when the trade was executedside
:string
-Bid
orAsk
indicates the side of the taker as reported by the exchange-
price
:string
- the price the match executed at amount
:string
- the amount of currency traded in the match