Closed cotyreh closed 8 months ago
Ran into similar issue. My Mboum options data feed simultaneously broke so I wonder if the problem isn't further down the line?
Edit: I am also using the yfinance package in Python, not this package
looks like yahoo is using a crumb in the call. possibly related to what we saw w/ getQuote
and GDPR. may be able to reuse some of the work we did on that
for reference:
looks like yahoo is using a crumb in the call
That's it! It works when I add the crumb to the URL. I'll work on getting a patch pushed.
This should be fixed now. Please install and test with remotes::install_github("joshuaulrich/quantmod@407-getoptionchain")
This should be fixed now. Please install and test with
remotes::install_github("joshuaulrich/quantmod@407-getoptionchain")
It works!
`
SPX <-getOptionChain("^SPX") print(SPX) $calls ContractID ConractSize Currency Expiration Strike Last Chg ChgPct Bid Ask Vol 1 SPXW240129C01200000 REGULAR USD 2024-01-29 1200 3594.25 0.0000000 0.00000000 3719.3 3737.7 2 2 SPXW240129C01800000 REGULAR USD 2024-01-29 1800 3088.40 0.0000000 0.00000000 3119.3 3137.7 1 3 SPXW240129C02000000 REGULAR USD 2024-01-29 2000 2888.70 0.0000000 0.00000000 2919.3 2937.7 9 4 SPXW240129C02600000 REGULAR USD 2024-01-29 2600 2288.52 0.0000000 0.00000000 2319.3 2337.7 5 5 SPXW240129C03600000 REGULAR USD 2024-01-29 3600 1181.60 0.0000000 0.00000000 1319.3 1337.7 2`
Thanks for verifying the fix!
I'm still running into this issue after installing from GitHub.
I'm still running into this issue after installing from GitHub.
Still having the error as well, any other suggestions? Is quantmod going to be patched? I know Python had the same issue but yf has been since patched but it seems quantmod has not.
@avhz and @steversteves are you in GDPR countries?
@steversteves are you able to use yfinance to import options from yahoo? You say it had the same issue but has since been patched... but yfinance was last updated on Jan-21 and this issue began on Jan-26, 5 days after the last yfinance update.
@joshuaulrich No, Australia.
@avhz and @steversteves are you in GDPR countries?
@steversteves are you able to use yfinance to import options from yahoo? You say it had the same issue but has since been patched... but yfinance was last updated on Jan-21 and this issue began on Jan-26, 5 days after the last yfinance update.
Thanks for getting back! No I am in Canada, I am not a Python user personally, it was just reported to me by a Python user that there was also an issue that they had to update the yf library.
I can't import options no, I get the crumb error, I am completely blocked out of anything option related. I did run your patch it just didn't fix the issue for me and I did try to update quantmod, but again it didn't fix. I'm also a very noob coder so its probably me! :-(
@avhz can you try https://github.com/ranaroussi/yfinance and let me know if it works for you?
Just looking at this (from the UK) and it's this check NROW(curl::handle_cookies(ses$h)) > 1)
which for me fails the test for ses$can.crumb
.
If I add a test crumb to the v7 API URL endpoint for options ( e.g. https://query2.finance.yahoo.com/v7/finance/options/%5ESPX?crumb=YdJC5tMaYMS ) then the dataset comes back successfully.
Description
As of the morning of 26 Jan 2023 CST, there was some change on Yahoo Finance's side where
getOptionChain()
no longer has permission to access the option chain data with the link it uses. I know that it happened early in the morning because my script logs show that it was running as intended until the error popped up.Expected behavior
Here is an example from my logs of before and after the error started occurring:
I tried different symbols and none of them worked. I also checked that the getQuote still works, so the issue is contained to accessing the options chains from Yahoo Finance.