Simple R wrapper for public APIs of cryptocurrency exchanges to extract orderbook information.
To install the package, run
devtools::install_github("christophscheuch/CryptoX")
library(CryptoX)
To get the symbols tradeable on an exhange, type
get_symbols("lykke")
To get orderbook data, simply type
get_orderbook(exchange = "coinbasepro", asset_pair = "BTCUSD", level = 10)
To store a list that contains orderbook data use
save_orderbook(exchange = "binance", asset_pair = "BTCUSD", level = 10)
The resulting file contains a list with the orderbook of the corresponding exchange (BTC/ USD) up to the first 5 levels (can be adjuted using the level parameter). The files are stored in a subfolder named after the exchange.
Currently supported exchanges include
supported_exchanges <- c("binance", "bitfinex", "bitflyer", "bitmex", "bitpanda", "bitstamp", "gemini", "hitbtc", "kraken", "lykke", "poloniex", "xbtce")
Currently supported asset pairs include
supported_assets <- c("BTCUSD", "BTCEUR", "ETHUSD", "ETHEUR",
"LTCUSD", "LTCEUR", "XRPUSD", "XRPEUR")
Below is a list of the currently supported exchanges and whether orderbook data for a specific asset pair is available.
| Exchange | BTCUSD | BTCEUR | ETHUSD | ETHEUR | LTCUSD | LTCEUR | XRPUSD | XRPEUR | | ----------------------------------------- |:------:|:------:|:------:|:------:|:------:|:------:|:------:|:------:| | Binance | Yes | No | Yes | No | Yes | No | Yes | No | | Bitfinex | Yes | Yes | Yes | Yes | Yes | No | Yes | No | | bitFlyer | Yes | Yes | No | No | No | No | No | No | | BitMEX | Yes | No | No | No | No | No | No | No | | Bitpanda| Yes | Yes | No | Yes | No | No | No | Yes | | Bitstamp | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | | Bittrex | Yes | No | Yes | No | Yes | No | Yes | No | | CEX.IO | Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | | Coinbase Pro | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | | Gate.io | Yes | No | Yes | No | Yes | No | Yes | No | | Gemini | Yes | No | Yes | No | Yes | No | No | No | | HitBTC | Yes | No | Yes | No | Yes | No | No | No | | Kraken | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | | Lykke | Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | | Poloniex | Yes | No | Yes | No | Yes | No | Yes* | No | | xBTCe | Yes | Yes | Yes | Yes | Yes | Yes | No | No |
*Note: Tether (USDT) is used if the exchange does not offer USD fiat pairs.
**Note that BitMEX is a derivatives market and not actually spot trading BTCUSD.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.