Last answered:

01 Dec 2021

Posted on:

02 Jul 2021

1

RemoteDataError: Unable to read URL for Yahoo using pandas_datareader

Hi,

After running this piece of code (same from solution and exercise ) in the "importing and organizing" portion of Python for Finance course:

F = wb.DataReader('F', data_source='yahoo', start='2005-1-1')

I get the following error message below. I tried to research for a solve on StackOverFlow, but can not find any solution for this issue.

Has anyone successfully run this code?

RemoteDataError: Unable to read URL: https://finance.yahoo.com/quote/F/history?period1=1104573600&period2=1625216399&interval=1d&frequency=1d&filter=history
Response Text:
b'<!DOCTYPE html>\n  <html lang="en-us"><head>\n  <meta http-equiv="content-type" content="text/html; charset=UTF-8">\n      <meta charset="utf-8">\n      <title>Yahoo</title>\n      <meta name="viewport" content="width=device-width,initial-scale=1,minimal-ui">\n      <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">\n      <style>\n  html {\n      height: 100%;\n  }\n  body {\n      background: #fafafc url(https://s.yimg.com/nn/img/sad-panda-201402200631.png) 50% 50%;\n      background-size: cover;\n      height: 100%;\n      text-align: center;\n      font: 300 18px "helvetica neue", helvetica, verdana, tahoma, arial, sans-serif;\n  }\n  table {\n      height: 100%;\n      width: 100%;\n      table-layout: fixed;\n      border-collapse: collapse;\n      border-spacing: 0;\n      border: none;\n  }\n  h1 {\n      font-size: 42px;\n      font-weight: 400;\n      color: #400090;\n  }\n  p {\n      color: #1A1A1A;\n  }\n  #message-1 {\n      font-weight: bold;\n      margin: 0;\n  }\n  #message-2 {\n      display: inline-block;\n      *display: inline;\n      zoom: 1;\n      max-width: 17em;\n      _width: 17em;\n  }\n      </style>\n  <script>\n    document.write(\'<img src="//geo.yahoo.com/b?s=1197757129&t=\'+new Date().getTime()+\'&src=aws&err_url=\'+encodeURIComponent(document.URL)+\'&err=%<pssc>&test=\'+encodeURIComponent(\'%<{Bucket}cqh[:200]>\')+\'" width="0px" height="0px"/>\');var beacon = new Image();beacon.src="//bcn.fp.yahoo.com/p?s=1197757129&t="+new Date().getTime()+"&src=aws&err_url="+encodeURIComponent(document.URL)+"&err=%<pssc>&test="+encodeURIComponent(\'%<{Bucket}cqh[:200]>\');\n  </script>\n  </head>\n  <body>\n  <!-- status code : 404 -->\n  <!-- Not Found on Server -->\n  <table>\n  <tbody><tr>\n      <td>\n      <img src="https://s.yimg.com/rz/p/yahoo_frontpage_en-US_s_f_p_205x58_frontpage.png" alt="Yahoo Logo">\n      <h1 style="margin-top:20px;">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.</p>\n      </td>\n  </tr>\n  </tbody></table>\n  </body></html>'
16 answers ( 0 marked as helpful)
Instructor
Posted on:

02 Jul 2021

0

Hi Cindy!

Thanks for reaching out.

It seems that you have made too many attempts to pull data from that API for a certain period of time. Please retry from another pc or later and the error should disappear.
If this doesn't work, you should be able to download data from that API the next day.

Hope this helps.
Best,
Martin

Posted on:

03 Jul 2021

2

I have the same problem.  Tested it on 4 different computers and different Python versions. Always the same error.

pandas_datareader._utils.RemoteDataError: Unable to read URL: https://finance.yahoo.com/quote/RCO.PA/history?period1=1420081200&period2=1625363999&interval=1d&frequency=1d&filter=history
Response Text:
b'\n  <html lang="en-us"><head>\n  \n      <meta charset="utf-8">\n      <title>Yahoo</title>\n      <meta name="viewport" content="width=device-width,initial-scale=1,minimal-ui">\n      <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">\n      <style>\n  html {\n      height: 100%;\n  }\n  body {\n      background: #fafafc url(https://s.yimg.com/nn/img/sad-panda-201402200631.png) 50% 50%;\n      background-size: cover;\n      height: 100%;\n      text-align: center;\n      font: 300 18px "helvetica neue", helvetica, verdana, tahoma, arial, sans-serif;\n  }\n  table {\n      height: 100%;\n      width: 100%;\n      table-layout: fixed;\n      border-collapse: collapse;\n      border-spacing: 0;\n      border: none;\n  }\n  h1 {\n      font-size: 42px;\n      font-weight: 400;\n      color: #400090;\n  }\n  p {\n      color: #1A1A1A;\n  }\n  #message-1 {\n      font-weight: bold;\n      margin: 0;\n  }\n  #message-2 {\n      display: inline-block;\n      *display: inline;\n      zoom: 1;\n      max-width: 17em;\n      _width: 17em;\n  }\n      </style>\n  <script>\n    document.write(\'
\');var beacon = new Image();beacon.src="//bcn.fp.yahoo.com/p?s=1197757129&t="+new Date().getTime()+"&src=aws&err_url="+encodeURIComponent(document.URL)+"&err=%<pssc>&test="+encodeURIComponent(\'%<{Bucket}cqh[:200]>\');\n  </script>\n  </head>\n  <body>\n  <!-- status code : 404 -->\n  <!-- Not Found on Server -->\n  <table>\n  <tbody><tr>\n      <td>\n
\n      <h1 style="margin-top:20px;">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.</p>\n      </td>\n  </tr>\n  </tbody></table>\n  </body></html>'
Posted on:

04 Jul 2021

0

I am facing the same error.. did Yahoo change anything at their website?

Posted on:

05 Jul 2021

2

I am also facing the same issue. When trying to run my report today. Please let me know if you found any alternative.

Regards
Yasaswy.

Instructor
Posted on:

05 Jul 2021

0

Hi everyone!

Thanks for reaching out!

Apparently, the issue regards a lack of connection to the server. As written in the error message:

Will be right back...
Thank you for your patience.
Our engineers are working quickly to resolve the issue.

In the past, the Yahoo Finance API Service has been discontinued, too, but it has later been reinstated. Therefore, please use the *.csv files provided until the Yahoo engineers solve the issue. Alternatively, you can use sources like yfinance, however we do advise you to use the *.csv files provided since they abide by the structure that is required for data analysis and analytics throughout the course.

Hope this helps.
Kind regards,
Martin

Posted on:

06 Jul 2021

0

when will it be fixed Martin?

Posted on:

06 Jul 2021

0

I´m facing the same problem for the 4th day, now. It seems Yahoo API is out of service, as if you copy and paste the link into a browser, it works fine.
In the page it opens, you can see a Download button. I had downloaded the data and changed the program to read from a .csv file, instead of calling the API directly (truly, I have to do it for 6 pages, as I was calling the function for 6 different objects, but it is far better than to be stuck waiting for the service to come back).

Instructor
Posted on:

07 Jul 2021

0

Hi Bobby and Marli,

Thanks for reaching out.

@Marli: Thank you for sharing this experience with the Community!

@Bobby: Knowing the answer is beyond our control and it is in the hands of the Yahoo API engineers. What we can do (and have done!) is prepare *.csv files containing relevant data that can be used to complete this course. Therefore, please refer to that data when working on the lectures and exercises from the course.

Hope this helps.
Best,
Martin

Posted on:

14 Jul 2021

2

I am getting the same problem for the past couple of weeks. It seems yahoo has changed some authentication settings, this could be due to upgradation of their web servers. And the API team needs to conform to the new security standard before we can pull data programmatically from yfinance.
Hope its resolved soon as its one of my major data source.
Niloy

Instructor
Posted on:

15 Jul 2021

0

Hi Niloy!
Thanks for sharing your experience with the rest of the Community! Certainly, all (or at least many) of us hope the Yahoo Service will be reinstated. Let's cross fingers that this happens and that this happens soon.
Kind regards,
Martin

Posted on:

16 Jul 2021

5

I got the same error from the beginning of this month. After browsing dozens of sites, I found a solution which works for me.
First, I installed yfinance.
https://pypi.org/project/yfinance/
Official document said we can override pandas_datareader by just adding one line, getting what we want to get with yfinance without changing the original format of the codes.

yf.pdr_override()

However, I got a JSONDecodeError upon running yfinance. So I browsed for solution again. Finally finding a post recommending an upgrade of yfinance.
https://stackoverflow.com/questions/68331065/json-decode-error-with-yfinance-jsondecodeerror-expecting-value-line-1-column

pip install yfinance --upgrade --no-cache-dir

I run that on prompt and it works. The following is my testing codes, copied from an example in the official document of yfinance.

from pandas_datareader import data as pdr

import yfinance as yf
yf.pdr_override()
data = pdr.get_data_yahoo("SPY", start="2017-01-01", end="2017-04-30")
print(data)

Hope it helps.

Instructor
Posted on:

20 Jul 2021

0

Hi T. Spark!

Thanks for reaching out and sharing this solution with the Community.

Indeed, yfinance has been a module that has been quite solid and consistent throughout the years with the data it offers and its support. Nevertheless, so far we've thought the Yahoo FInance API has been providing an easier access to data of good enough quality.
In the current situation, you can try to opt for yfinance data or, what will secure the smooth taking of the course, you can use the *.csv files provided in all lectures where doing so has been relevant.

Hope this helps.
Best,
Martin

Posted on:

11 Aug 2021

0

Remote data error should be fixed with following:

pip install --upgrade pandas
pip install --upgrade pandas-datareader
Instructor
Posted on:

11 Aug 2021

1

Hi Sharad!

Thanks for sharing this solution with the Community! Indeed, pandas and pandas-datareader have been updated and now we can continue to use the Yahoo API smoothly, hopefully for a long time ahead.

Kind regards,
Martin

Posted on:

16 Nov 2021

0

the same problem

Instructor
Posted on:

01 Dec 2021

0

Hi Omar!

Thanks for reaching out.

Can you please be more specific - which problem do you exactly encounter at the minute? Thank you.

Looking forward to your answer.
Best,
Martin

Submit an answer