download options chain data using quantmod in R [error msg]

66 Views Asked by At

I am trying to download options chain data using quantmod in R, however, when command is input, it returns with the following error msg:

install.packages("quantmod")
library(quantmod)
AAPL.OPT <- getOptionChain("AAPL","2024-02")

Error in Exp/86400 : non-numeric argument to binary operator
In addition: Warning message:
In open.connection(con, "rb") :
  cannot open URL 'https://query2.finance.yahoo.com/v7/finance/options/AAPL': HTTP status was '401 Unauthorized'

Tried to re-install n re-load the package, no luck though. Many thanks for ur help.


Updated quantmod, however the same issue persists:

remotes::install_github("joshuaulrich/quantmod@407-getoptionchain")
library(quantmod)
AAPL.OPT <- getOptionChain("AAPL","2024-02")

Error in Exp/86400 : non-numeric argument to binary operator
In addition: Warning message:
In open.connection(con, "rb") :
  cannot open URL 'https://query2.finance.yahoo.com/v7/finance/options/AAPL': HTTP status was '401 Unauthorized'
0

There are 0 best solutions below