The cash flow or incomeStatementHistory are not available for some tickers. Example:
In [20]: si.get_income_statement("IWF")
KeyError Traceback (most recent call last)
in
----> 1 si.get_income_statement("IWF")
/Library/Python/3.8/site-packages/yahoo_fin/stock_info.py in get_income_statement(ticker, yearly)
420
421 if yearly:
--> 422 temp = json_info["incomeStatementHistory"]["incomeStatementHistory"]
423 else:
424 temp = json_info["incomeStatementHistoryQuarterly"]["incomeStatementHistory"]
KeyError: 'incomeStatementHistory'
Would be nice to add a key check or catch it with exception and assign to None or something to handle gracefully
Encountered when running a script to download a list of tickers
The cash flow or incomeStatementHistory are not available for some tickers. Example: In [20]: si.get_income_statement("IWF")
KeyError Traceback (most recent call last)