dpguthrie / dpguthrie/yahooquery

failed in retrieving data of multiple symbols with Ticker class

Open
#213 0 comments 4 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
920
Forks
164
PR merge metrics
No merged PRs in 30d

Description

When the Ticker class is used to get the data of multiple symbols, if one or some of the symbols do not have complete data in the yahoo finance website or some other reasons, an error occurs. Here is the sample code:
import yahooquery as yq
tickers = yq.Ticker(['AAPL', 'AASL', 'AAACX', 'AAMBAX', 'MSFT'], asynchronous=True)
summary = tickers.summary_detail

When running these three lines of code, an error popped up as following:
Traceback (most recent call last):
File "F:\Users\Huajiang\My Code & Modeling\Python\venvs\iTrade\Lib\site-packages\yahooquery\base.py", line 1217, in _construct_data
data = json[response_field]["result"][0][addl_key]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'summaryDetail'

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.