This function will query the intraday endpoint of eodhd and return all data for a user supplied time period.
get_intraday(
ticker = "AAPL",
exchange = "US",
frequency = "5m",
first_date = Sys.Date() - 7,
last_date = Sys.Date(),
cache_folder = get_default_cache(),
check_quota = TRUE
)
A dataframe with news events and sentiments
A company ticker (e.g. AAPL). You can find all tickers for a particular exchange with get_tickers()
.
A exchange symbol (e.g. US). You can find all tickers for a particular exchange with get_tickers()
. Be aware that, for US companies, the exchange symbols is simply "US"
The frequency of the intraday data. Available options: "1m"= 1 minute, "5m" = 5 minutes, "1h" = 1 hour
the first date to fetch news. The function will keep querying the api until this date is reached. Default is previous week.
the last date to fetch news. Default is today.
A local directory to store cache files. By default, all functions use a temporary path, meaning that the caching system is session persistent (it will remove all files when you exit your R session). If you want a persistent caching system, simply point argument cache_folder to a local directory in your filesystem. Be aware, however, that a persistent cache will not refresh your data for new api queries.
A flag (TRUE/FALSE) for whether to check the current quota status from the api. This option implies a small cost of execution time. If you need speed, just set it to FALSE.
if (FALSE) {
set_token(get_demo_token())
df_intraday <- get_intraday(ticker = "AAPL", exchange = "US")
}
Run the code above in your browser using DataLab