Skip to contents

The cryptoQuotes package provides open access to cryptocurrency market data in R by utilizing public market data endpoints through curl. This package does not require any API keys, making it straightforward and easy to use for accessing real-time and historical cryptocurrency data.

Example: Bitcoin OHLC-V with Long-Short Ratios

Bitcoin (BTC) in 30 minute intervals with Long-Short Ratios.
index open high low close volume long short ls_ratio
2024-05-20 13:00:00 67072.7 67278.4 67012.9 67174.1 3421.493 0.498 0.502 0.993
2024-05-20 13:30:00 67174 67200 66868.6 66974 3401.276 0.494 0.506 0.977
2024-05-20 14:00:00 66974 67063 66859.3 66883.9 2277.018 0.492 0.508 0.97
2024-05-20 14:30:00 66883.9 66994.7 66760 66903.5 4318.688 0.492 0.508 0.969
2024-05-20 15:00:00 66903.5 67073.9 66866 66960 3334.157 0.49 0.51 0.961
2024-05-20 15:30:00 66959.9 67059.7 66929.9 67059.6 526.914 0.492 0.508 0.967
Source
## get OHLC-V in 30 minute intervals
## for Bitcoin from Binance
## futures market since yesterday
BTC <- cryptoQuotes::get_quote(
  ticker   = 'BTCUSDT',
  source   = 'binance',
  futures  = TRUE,
  interval = '30m',
  from     = Sys.Date() - 1 
)

## get the Long-Short Ratios in 30 minute
## intervals for Bitcoin from 
## Binance since yesterday
BTC_LSR <- cryptoQuotes::get_lsratio(
  ticker   = 'BTCUSDT',
  source   = 'binance',
  interval = '30m',
  from     = Sys.Date() - 1 
)

## merge the OHLC-B
## and Long-Short Ratios
BTC <- merge(
  BTC,
  BTC_LSR
)

Installation

Stable version

# install from CRAN
install.packages(
  pkgs = 'cryptoQuotes',
  dependencies = TRUE
)

Development version

# install from github
devtools::install_github(
  repo = 'https://github.com/serkor1/cryptoQuotes/',
  ref  = 'development'
)