pandas-datareader icon indicating copy to clipboard operation
pandas-datareader copied to clipboard

ConnectionError: HTTPSConnectionPool(host='finance.yahoo.com', port=443): Read timed out.

Open AtulVG opened this issue 5 years ago • 2 comments

I have written a simple code to get data of a stock.

import numpy as np import pandas as pd import pandas_datareader as pdr

pdr.get_data_yahoo('RELIANCE.NS').tail()

But this is throwing up a connection error after a few seconds..These codes were working fine last week.I have tried restarting the kernel and browser window.I am able to access the Yahoo Fianace site on the browser.Yet the cal from Python return the error

ConnectionError: HTTPSConnectionPool(host='finance.yahoo.com', port=443): Read timed out.

Can someone please explain why?

AtulVG avatar Sep 14 '20 07:09 AtulVG

getting a similar error with Tiingo

for t in tickers: start_time = time.time()

print(t)
temp_df = pdr.get_data_tiingo(t, api_key=TIINGO_API_KEY, pause=TIINGO_PAUSE, retry_count=TIINGO_RETRY)
time.sleep(2)

ConnectionError: HTTPSConnectionPool(host='api.tiingo.com', port=443): Max retries exceeded with url: /tiingo/daily/AAPL/prices?startDate=2015-12-12&endDate=2020-12-10&format=json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x132bda9d0>: Failed to establish a new connection: [Errno 60] Operation timed out'))

ghost avatar Dec 10 '20 13:12 ghost

Your code is fine. The problem is in Yahoo side, don't worry, wait a minute and try again, you can connect to Yahoo.

cwjcw avatar Feb 18 '21 02:02 cwjcw