Error in receiving Historical stock data using pandas

Viewed 84

Unable to download the historical data from Yahoo using pandas_datareader.data (google anyway doesnt provide). The same used to work fine most of the time but not so since July 2021. My code:

import pandas_datareader.data as web # including other required classes as per my requirement
def get_data(ticker, start_time, end_time):
    connected = False
    while not connected:
        try:
            df = web.get_data_yahoo(ticker, start=start_time, end=end_time)
            connected = True
            ........
        except Exception as e:
            ........
            pass   
    return df

I have been consistently receiving this error msg:

Unable to read URL... ( with the message.

Will be right back...</h1>\n      <p id="message-1">Thank you for your patience.</p>\n      <p id="message-2">Our engineers are working quickly to resolve the issue

...)

but it has been long since they have been able to rectify it. Can anyone please suggest some alternative or a way to resolve this?

1 Answers

This is an actual open issue with yfinance, you can follow the open ticket to get more insight ISSUE #607

Related