get_historical_price: Get historical daily price data

Description Usage Arguments Value References Examples

View source: R/public_api.R

Description

get_historical_price provides price information about a single currency at the daily level.

Usage

1
2
3
get_historical_price(fsym, tsym, end_time = Sys.time(), unit = "day",
  exchange = "CCCAGG", aggregate = 1, limit = NULL, all_data = FALSE,
  sign = FALSE, try_conversion = TRUE, app_name = NULL)

Arguments

fsym

character. 3 letter name for coin to retreive price history for.

tsym

character. 3 letter name for how price should be reported for fsym.

end_time

character or POSIXct or POSIXt. Final date to retrieve data for in the format of yyyy-mm-dd with optional hh:mm:ss (used when unit is set to "hour" or "minute"). Defaults to Sys.time().

unit

character. Either "day", "hour", or "minute" indicating the granularity of the returned data. The default is 'day'. Note: minute data is only available for the past 7 days.

exchange

character. Exchange to query. Defaults to 'CCCAGG'.

aggregate

numeric. Data is reported every n units. Defaults to 1. Maximum value of 30.

limit

numeric. Number of records to retrive leading up to end_date. If all_data is set to true, this is ignored. Defaults to 30 when unit is "day", 168 when unit is "hour", and 1440 when unit is "minute". Minimum of 1, maximum of 2000.

all_data

logical. SHould all historical data for fsym be retreived? Defaults to FALSE.

sign

logical. Should the server sign the response? Defaults to FALSE

try_conversion

logical. Should BTC conversion be used fsym is not trading in tsym on specified exchange? Defaults to TRUE.

app_name

character. Name of app to be passed in API request. Defaults to NULL.

Value

A tibble containing daily price details for fsym

References

https://www.cryptocompare.com/api#-api-data-histoday-

Examples

1
2
3
4
## Not run: 
get_daily_price("BTC", "USD", "2017-10-31")

## End(Not run)

blairj09/cryptor documentation built on May 23, 2019, 7:32 a.m.