Skip to contents

ℹ️ Overview

The cryptoQuotes-package is a high-level API-client to get current, and historical, cryptocurrency OHLC-V market and sentiment data in R, without using web-crawlers or API keys. This R-package uses xts and zoo under the hood and are compatible with quantmod and TTR out of the box.

Supported exchanges and markets

All supported exchanges and markets are listed in the table below, alongside the available range of intervals available from the respective exchanges,

Supported exchanges, markets and intervals.
Exchange Spot Futures Available Intervals Smallest Interval Biggest Interval
Binance 16 1 second(s) 1 month(s)
Bitmart 13 1 minute(s) 1 week(s)
Bybit 13 1 minute(s) 1 month(s)
Kraken 10 1 minute(s) 2 week(s)
Kucoin 13 1 minute(s) 1 week(s)

ℹ️ Basic Usage

OHLC-V Market Data

Get USDT denominated Bitcoin spot market price from Binance with 30m-intervals using the get_quote()-function,

## BTC OHLC prices
## from Binance spot market
## in 30 minute intervals
BTC <- cryptoQuotes::get_quote(
  ticker   = 'BTCUSDT',
  source   = 'binance',
  futures  = FALSE,
  interval = '30m',
  from     = Sys.Date() - 1 
)
Bitcoin (BTC) OHLC-prices
index open high low close volume
2024-05-18 08:30:00 66753.62 66963.86 66730 66920.03 350.87501
2024-05-18 09:00:00 66920.03 67240.69 66839.12 67190.01 420.24327
2024-05-18 09:30:00 67190 67190.01 66829 66887 448.78951
2024-05-18 10:00:00 66887.01 67085.19 66840 67010 281.41346
2024-05-18 10:30:00 67009.99 67037.45 66923.87 67027.59 178.27045
2024-05-18 11:00:00 67027.59 67119.04 66999.99 67018.19 369.53234

Charting OHLC-V

The BTC-object can be charted using the chart()-function,

## Chart BTC
## using klines, SMA, 
## MACD and Bollinger Bands
cryptoQuotes::chart(
  ticker = BTC,
  main   = cryptoQuotes::kline(),
  sub    = list(
    cryptoQuotes::volume(),
    cryptoQuotes::macd()
  ),
  indicator = list(
    cryptoQuotes::sma(n = 7),
    cryptoQuotes::sma(n = 14),
    cryptoQuotes::sma(n = 21),
    cryptoQuotes::bollinger_bands()
  )
)

cryptocurrency charts in R

ℹ️ 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'
)

⚠️ Disclaimer

This library is still considered experimental but no breaking changes will be made on functions labelled as stable without appropriate action; please refer to the release notes, or submit an issue if that promise is broken.

ℹ️ Code of Conduct

Please note that the cryptoQuotes project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.