pydata / pandas-datareader

Extract data from a wide range of Internet sources into a pandas DataFrame.
https://pydata.github.io/pandas-datareader/stable/index.html
Other
2.95k stars 681 forks source link

TypeError when indexing response from DataReader with 'yahoo' as data source #976

Closed ghost closed 1 year ago

ghost commented 1 year ago

When using pandas_datareader.DataReader() with 'yahoo' as the source there is a TypeError 'string indices must be integers'.

The issue appears to be in yahoo/daily.py on line 153, when trying to access 'data = j["context"]["dispatcher"]["stores"]["HistoricalPriceStore"]'.

The "HistoricalPriceStore" field isnt able to be indexed anymore, I assume yahoo changed somehting in their api. I was able to index j["context"]["dispatcher"]["stores"] and the value is now a base64 encoded string, which explains the TypeError.

I tried to decode the string to access the "HistoricalPriceStore" field, but when decoded it begins with 'Salted__' and i wasnt able to figure out how to decode it from there.

ghost commented 1 year ago

Found that its already open in a different issue #952