coinbase_candles {cryptotrackr}R Documentation

coinbase_candles

Description

coinbase_candles

Usage

coinbase_candles(
  api_key,
  api_secret,
  product_id,
  start,
  end,
  granularity,
  timeout_seconds = 60
)

Arguments

api_key

your Coinbase API key

api_secret

your Coinbase API secret

product_id

the trading pair.

start

timestamp for starting range of aggregations, in UNIX time.

end

timestamp for ending range of aggregations, in UNIX time.

granularity

time slice value for each candle. Options: "ONE_MINUTE", "FIVE_MINUTE", "FIFTEEN_MINUTE", "THIRTY_MINUTE", "ONE_HOUR", "TWO_HOUR", "SIX_HOUR", or "ONE_DAY"

timeout_seconds

seconds until the query times out. Default is 60.

Value

returns a dataframe with your Coinbase candle data.

Examples

## Not run: 
api_key <- "..."
api_secret <- "..."
end <- coinbase_time()
end_timestamp <- as.POSIXct(end, origin = "1970-01-01", tz = "UTC")
start_timestamp <- end_timestamp - 20 * 60  # 20 minutes in seconds
start <- as.numeric(start_timestamp)
coinbase_candles(api_key, api_secret, 'BTC-USD', start, end, 'ONE_MINUTE')
## End(Not run)

[Package cryptotrackr version 1.3.3 Index]