Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yahoo returning: pandas_datareader._utils.RemoteDataError: Unable to read URL: #170

Closed
canivel opened this issue Feb 8, 2016 · 55 comments
Closed

Comments

@canivel
Copy link

canivel commented Feb 8, 2016

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

@canivel
Copy link
Author

canivel commented Feb 8, 2016

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

@femtotrader
Copy link
Contributor

It works fine on my side.

Feel free to reopen if you still facing this issue.

@unijoy
Copy link

unijoy commented Aug 18, 2016

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

@femtotrader
Copy link
Contributor

Hello,

Please use 3 backquotes for code in GitHub https://help.github.com/articles/creating-and-highlighting-code-blocks/
Please use latest master see #223 (comment)

Kind regards

@ghost
Copy link

ghost commented Feb 19, 2017

Looks like another user has encountered this error:

http://stackoverflow.com/questions/42333827/error-scraping-data-from-yahoo-finance

@tavito
Copy link

tavito commented Feb 20, 2017

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

@jefftham
Copy link

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

@dyyyl
Copy link

dyyyl commented Mar 19, 2017

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!

@arkilis
Copy link

arkilis commented Aug 16, 2017

Still not working. The issue happens occasionally.

@SutharMukesh
Copy link

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

@aldsouza4
Copy link

Facing this problem in 2021 july Now

@KatieMarsh
Copy link

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

@lefteyecct
Copy link

can't believe it worked ever?

@lefteyecct
Copy link

image

@AndrianAru
Copy link

AndrianAru commented Jul 2, 2021

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']

@TheR3njithR
Copy link

its still down :(

@abdulvaseem123
Copy link

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

@maximilianreisinger
Copy link

Still down right??

@abdulvaseem123
Copy link

Yes, Still Down

@TheR3njithR
Copy link

seems like the wait is forever

@akhil14shukla
Copy link

mine is still down!!

@lefteyecct
Copy link

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

@gho21
Copy link

gho21 commented Jul 2, 2021

wow! the code AndrianAru posted worked!

@NewCodingStudent
Copy link

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')

@gho21
Copy link

gho21 commented Jul 2, 2021

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

@NewCodingStudent
Copy link

Thank you AndrianAru & gho21. It worked!

@abdulvaseem123
Copy link

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

@abdulvaseem123
Copy link

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

@PhilEats
Copy link

PhilEats commented Jul 2, 2021

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

@jcsvpn
Copy link

jcsvpn commented Jul 3, 2021

Pulling data for baba
Error: Unable to read URL

getting this error from yesterday. Can anyone help me?

@burkart-analytics
Copy link

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

@Johnnyttw
Copy link

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.

@echoround
Copy link

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

@ashraf999
Copy link

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

@akhil14shukla
Copy link

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

@aldsouza4
Copy link

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

@ithotline
Copy link

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")

@burkart-analytics
Copy link

@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)

@datatalking
Copy link

Please read the stack trace...

Our engineers are working quickly to resolve the issue.

@abdulvaseem123
Copy link

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

@BajajAryan310
Copy link

BajajAryan310 commented Jul 9, 2021 via email

@aldsouza4
Copy link

Yfinance not working for me too

@aldsouza4
Copy link

Please read the stack trace...

Our engineers are working quickly to resolve the issue.

U talking about yfinance or yahoo finance ?

@ardaozdemir
Copy link

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?

@Johnnyttw
Copy link

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?

@rizkiyansyah
Copy link

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)

@dustinpeng
Copy link

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

@dustinpeng
Copy link

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

@Johnnyttw
Copy link

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

yes, it can work. TKS a lot

@theGadgetplayer
Copy link

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

Pls Help

@bashtage
Copy link
Contributor

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

@aldsouza4
Copy link

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

Pls Help

Send your code here I'll try to help

@aldsouza4
Copy link

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

@bashtage
Copy link
Contributor

0.10.0 was released yesterday with support for Yahoo fixed.

@theGadgetplayer
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests