ranaroussi / yfinance

Download market data from Yahoo! Finance's API
https://aroussi.com/post/python-yahoo-finance
Apache License 2.0
14.89k stars 2.44k forks source link

option_chain() function is returning error while calling it. #1969

Closed sunnysaxena closed 3 months ago

sunnysaxena commented 4 months ago

KeyError Traceback (most recent call last) Cell In[31], line 1 ----> 1 yca.option_chain()

File ~/anaconda3/envs/prepJob/lib/python3.11/site-packages/yfinance/ticker.py:98, in Ticker.option_chain(self, date, tz) 94 date = self._expirations[date] 95 options = self._download_options(date) 97 return _namedtuple('Options', ['calls', 'puts', 'underlying'])(**{ ---> 98 "calls": self._options2df(options['calls'], tz=tz), 99 "puts": self._options2df(options['puts'], tz=tz), 100 "underlying": options['underlying'] 101 })

KeyError: 'calls'