Pandas-datareader: Yahoo returning: pandas_datareader._utils.RemoteDataError: Unable to read URL:

Created on 8 Feb 2016  Â·  55Comments  Â·  Source: pydata/pandas-datareader

I always use the call to the service like this:

import datetime as dt
import pandas_datareader.data as web

start_date = dt.datetime(2008,1,1)
end_date = dt.datetime(2009,1,1)
web.DataReader('GOOG', 'yahoo', start_date, end_date)

Today I'm getting:

pandas_datareader._utils.RemoteDataError: Unable to read URL: http://ichart.finance.yahoo.com/table.csv

Is yahoo off?

from google finance it comes ok.

Thanks

Most helpful comment

Facing this problem in 2021 july Now

All 55 comments

I tried in two different networks still getting the same error, so it's no a network block

It works fine on my side.

Feel free to reopen if you still facing this issue.

startDate = datetime.datetime(2016, 8, 15)

endDate = datetime.datetime(2016, 8, 17)

tt = web.DataReader("SHA:600936", 'google', startDate, endDate)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/pandas_datareader/data.py", line 105, in DataReader
    session=session).read()
  File "/usr/lib/python2.7/site-packages/pandas_datareader/base.py", line 173, in read
    df = self._read_one_data(self.url, params=self._get_params(self.symbols))
  File "/usr/lib/python2.7/site-packages/pandas_datareader/base.py", line 80, in _read_one_data
    out = self._read_url_as_StringIO(url, params=params)
  File "/usr/lib/python2.7/site-packages/pandas_datareader/base.py", line 91, in _read_url_as_StringIO
    response = self._get_response(url, params=params)
  File "/usr/lib/python2.7/site-packages/pandas_datareader/base.py", line 117, in _get_response
    raise RemoteDataError('Unable to read URL: {0}'.format(url))
pandas_datareader._utils.RemoteDataError: Unable to read URL: http://www.google.com/finance/historical

not working for me

Hello,

Please use 3 backquotes for code in GitHub https://help.github.com/articles/creating-and-highlighting-code-blocks/
Please use latest master see https://github.com/pydata/pandas-datareader/issues/223#issuecomment-239853627

Kind regards

It started working again! I did not have to do anything about it. Thank you!

NO. it happens again. Both yahoo and google is NOT working now.

Hey everyone,

So I was looking into this, and came up with the hackiest solution ever. BRK-B and BF-B were listed on wikipedia as BRK.B and BF.B, respectively. A lot of people were scraping the ticker list directly from Wikipedia, so I edited the names to line up with Yahoo and everything is working for me now!

Still not working. The issue happens occasionally.

did anyone get any solution?

I've created a script to download historical data for a bunch of stocks.
the for loop just breaks in between with this error.

RemoteDataError: Unable to read URL: https://query1.finance.yahoo.com/v7/finance/download/BAC?period1=1427826600&period2=1522693800&interval=1d&crumb=b2hWv%5Cu002F6x.l2&events=history

agreed to @arkilis

Facing this problem in 2021 july Now

how long does it usually take to get back to working again?

can't believe it worked ever?

image

The following version should still work

Edit: forgot to change something in the first version. This one works for me at least

from datetime import datetime
import yfinance as yf
import pandas_datareader.data as pdr
import pandas as pd

yf.pdr_override()

start = datetime.strptime('2011-01-01', '%Y-%m-%d')
end = datetime.strptime('2020-01-01', '%Y-%m-%d')

sp500 = pdr.get_data_yahoo("^GSPC", start, end)['Adj Close']

its still down :(

How much time does it take still down!!!!!!!!!!!!!

Still down right??

Yes, Still Down

seems like the wait is forever

mine is still down!!

I download the dataset from yahoo finance as a workaround if this helps anyone here

wow! the code AndrianAru posted worked!

Does anyone know how to write AndrianAru's code to CSV? Thank you!

I tried this, but it didn't work...

sp500[["Adj Close"]].to_csv (r'C:\Users\j\export_dataframe.csv')

pdr.get_data_yahoo("^GSPC", start, end)['Adj Close'].to_csv('GSPC.csv')

Thank you AndrianAru & gho21. It worked!

Anybody able to get todays data(7/2/2021) using yf??

kindly please let me know if anyone able to extract todays data from yf ??

As AndrianAru & gho21 pointed out before, you can try using this. In my case everything worked fine with this codeline:

import yfinance as yf
import pandas_datareader.data as pdr

yf.pdr_override()

ticker = 'TSLA'
start_date = '01-01-2010'
end_date = '03-07-2021'


def download_data(symbol, source, start_date, end_date):
    start = datetime.strptime(start_date, '%d-%m-%Y')
    end = datetime.strptime(end_date, '%d-%m-%Y')
    df = pdr.get_data_yahoo(symbol, data_source=source, start=start, end=end)
    return df

Pulling data for baba
Error: Unable to read URL

getting this error from yesterday. Can anyone help me?

Try the AndrianAru solution (the problem is the date format):

import yfinance as yf
import pandas_datareader.data as pdr

yf.pdr_override()

start_date = '01-01-2010'
end_date = '03-07-2021'

start = datetime.strptime(start_date, '%d-%m-%Y')
end = datetime.strptime(end_date, '%d-%m-%Y')
df = pdr.get_data_yahoo('AAPL', data_source='yahoo', start=start, end=end)
df

Try the AndrianAru solution (the problem is the date format):

import yfinance as yf
import pandas_datareader.data as pdr

yf.pdr_override()

start_date = '01-01-2010'
end_date = '03-07-2021'

start = datetime.strptime(start_date, '%d-%m-%Y')
end = datetime.strptime(end_date, '%d-%m-%Y')
df = pdr.get_data_yahoo('AAPL', data_source='yahoo', start=start, end=end)
df

TKS a lot. it can work.

Try the AndrianAru solution (the problem is the date format):

import yfinance as yf
import pandas_datareader.data as pdr

yf.pdr_override()

start_date = '01-01-2010'
end_date = '03-07-2021'

start = datetime.strptime(start_date, '%d-%m-%Y')
end = datetime.strptime(end_date, '%d-%m-%Y')
df = pdr.get_data_yahoo('AAPL', data_source='yahoo', start=start, end=end)
df

Had exact same issue as above and this seems to work! Right now, at least

I am getting the same error. Is this service down now?

Code by AndrianAru is working fine. Try with that one!

hope AndrianAru's code dosent stop working too
i made a website out of this http://stock-toolkit.herokuapp.com/
do check it if u got the time
ps its for indian stocks only

Code by AndrianAru did not work for me - Below code did thoug:

import yfinance as yf

import pandas as pd

data = yf.download("Ticker_Symbol", period ="1d")

@ithotline try the code below, because without the "tail" its returning two lines, I test it in google colab and works fine

data = yf.download("AAPL", period ="1d").tail(1)

Please read the stack trace...

Our engineers are working quickly to resolve the issue.

yfinance is not working for me. Is it working for anyone??

Yes, it is working for me

On Fri, 9 Jul 2021, 10:39 pm abdulvaseem123, @.*>
wrote:

yfinance is not working for me. Is it working for anyone??

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/pydata/pandas-datareader/issues/170#issuecomment-877331582,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AUXF22KOHWDJ4VEHYBROU7DTW4ULRANCNFSM4B2XVQSA
.

Yfinance not working for me too

Please read the stack trace...

Our engineers are working quickly to resolve the issue.

U talking about yfinance or yahoo finance ?

Try the AndrianAru solution (the problem is the date format):

import yfinance as yf
import pandas_datareader.data as pdr

yf.pdr_override()

start_date = '01-01-2010'
end_date = '03-07-2021'

start = datetime.strptime(start_date, '%d-%m-%Y')
end = datetime.strptime(end_date, '%d-%m-%Y')
df = pdr.get_data_yahoo('AAPL', data_source='yahoo', start=start, end=end)
df

It was working until today, but it doesn't work now. Is it the same for you?

Try the AndrianAru solution (the problem is the date format):
import yfinance as yf
import pandas_datareader.data as pdr
yf.pdr_override()
start_date = '01-01-2010'
end_date = '03-07-2021'
start = datetime.strptime(start_date, '%d-%m-%Y')
end = datetime.strptime(end_date, '%d-%m-%Y')
df = pdr.get_data_yahoo('AAPL', data_source='yahoo', start=start, end=end)
df

It was working until today, but it doesn't work now. Is it the same for you?

bad news, as same as me, what's going on?

Try the AndrianAru solution (the problem is the date format):

import yfinance as yf
import pandas_datareader.data as pdr

yf.pdr_override()

start_date = '01-01-2010'
end_date = '03-07-2021'

start = datetime.strptime(start_date, '%d-%m-%Y')
end = datetime.strptime(end_date, '%d-%m-%Y')
df = pdr.get_data_yahoo('AAPL', data_source='yahoo', start=start, end=end)
df

raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Try the AndrianAru solution (the problem is the date format):
import yfinance as yf
import pandas_datareader.data as pdr
yf.pdr_override()
start_date = '01-01-2010'
end_date = '03-07-2021'
start = datetime.strptime(start_date, '%d-%m-%Y')
end = datetime.strptime(end_date, '%d-%m-%Y')
df = pdr.get_data_yahoo('AAPL', data_source='yahoo', start=start, end=end)
df

raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

same issue as rizkiyansyah

solved by pip install yfinance --upgrade
Upgrade yfinance to 0.1.63

solved by pip install yfinance --upgrade
Upgrade yfinance to 0.1.63

yes, it can work. TKS a lot

I have tried all suggestions, still down on my side :(

Pls Help

What version are you using? Run

pip uninstall pandas-datareader -y
# Again, to be sure
pip uninstall pandas-datareader -y
pip install pandas-datareader -U

I have tried all suggestions, still down on my side :(

Pls Help

Send your code here I'll try to help

What version are you using? Run

pip uninstall pandas-datareader -y
# Again, to be sure
pip uninstall pandas-datareader -y
pip install pandas-datareader -U

Pandas_datareader don't work anymore. ... That's done fam

0.10.0 was released yesterday with support for Yahoo fixed.

What version are you using? Run

pip uninstall pandas-datareader -y
# Again, to be sure
pip uninstall pandas-datareader -y
pip install pandas-datareader -U

Thanks, that seems to have fixed the problem :D appreciate the help

Was this page helpful?
0 / 5 - 0 ratings

Related issues

waswaswas10 picture waswaswas10  Â·  7Comments

BajajAryan310 picture BajajAryan310  Â·  7Comments

Chandrak1907 picture Chandrak1907  Â·  4Comments

zhongdai picture zhongdai  Â·  5Comments

paintdog picture paintdog  Â·  7Comments