get_eod_historical_stock_market_data {eodhd} | R Documentation |
Get historical data
Description
This function retrieves historical data from the API.
Usage
get_eod_historical_stock_market_data(
api_token,
symbol,
from_date = NULL,
to_date = NULL,
period = "d",
order = "a"
)
Arguments
api_token |
The API token for authentication. |
symbol |
consists of two parts: SYMBOL_NAME.EXCHANGE_ID, then you can use, for example, AAPL.MX for Mexican Stock Exchange. or AAPL.US for NASDAQ |
from_date |
Format: YYYY-MM-DD. The start date for earnings data, if not provided, today will be used. |
to_date |
Format: YYYY-MM-DD. The end date for earnings data, if not provided, today + 7 days will be used. |
period |
use 'd' for daily, 'w' for weekly, 'm' for monthly prices. By default, daily prices will be shown. |
order |
use āaā for ascending dates (from old to new), ādā for descending dates (from new to old). |
Value
A list containing the historical data.
Examples
api_token <- "demo"
from_date <- "2017-09-10"
to_date <- "2017-09-12"
symbol <- "AAPL.MX"
period <- "d"
order <- "a"
result <- get_eod_historical_stock_market_data(api_token, symbol, from_date, to_date, period, order)
[Package eodhd version 1.0.4 Index]