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 queries
  • exchangeName: string - name of the exchange
  • isActive: boolean - indicates if the exchange is still active

/currencies

Queries available currencies and returns a JSON array of the currency objects.

Query Parameters

Results - JSON Array

 [{
    "currencySymbol": "BTC",
    "currencyName": "Bitcoin",
    "isActive": true
  },
  {
    "currencySymbol": "BTCP",
    "currencyName": "Bitcoin Private",
    "isActive": true
  }
  ...
]
  • currencySymbol: string -  the normalized symbol of the currency
  • currencyName: string- the common name of the currency
  • isActive: boolean - true when the currency is still active

/markets

Queries available markets and returns a JSON array of the market objects.

Query Parameters

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 market
  • marketType: string - indicates Spot, Futures, Swap, or Options markets
  • marketSymbol: string - the printable symbol for the market
  • marketStatus: string - Active or Inactive
  • exchangeSymbol: string - the symbol for the exchange
  • baseSymbol: string - the symbol for the base currency
  • quoteSymbol: string - the symbol for the quote currency
  • remoteId: 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 market
  • marketType: string - indicates Spot, Futures, Swap, or Options markets
  • marketSymbol: string - the printable symbol for the market
  • marketStatus: string - Active or Inactive
  • exchangeSymbol: string - the symbol for the exchange
  • baseSymbol: string - the symbol for the base currency
  • quoteSymbol: string - the symbol for the quote currency
  • remoteId: 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 values 1m, 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)

Example: https://rest.blocktap.io/markets/bitmex_btc_usd/trades?startDate=2020-07-30T00:00:00Z&endDate=2020-07-30T00:01: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 exchange
  • unix: number - millisecond unix timestamp provided by the exchange when the trade was executed
  • side: string - Bid or Ask 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