can't connect to yahoo

조회 수: 5 (최근 30일)
Adhish Aggarwal
Adhish Aggarwal 2017년 4월 18일
댓글: Denis Alaev 2017년 6월 18일
c = yahoo; error using yahoo (line 63) Unable to connect or retrieve data from given URL.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2017년 5월 2일
The MathWorks Support Team recently posted an update on this issue. Here is the answer to save you the click:
“In April 2017, Yahoo introduced some changes in the protocol of their API. These changes prevented the Datafeed Toolbox from connecting to the service. The following webpage contains the workaround for this issue and instructions on how to apply the fix. https://www.mathworks.com/support/bugreports/1571158
  댓글 수: 3
Fabio Pasquali
Fabio Pasquali 2017년 5월 20일
i have the same problem
Denis Alaev
Denis Alaev 2017년 6월 18일
It seems that after several changes Yahoo Finance closed their API forever. The API was closed on May 15, one month ago already.
I've tested several alternatives and found that https://eodhistoricaldata.com the best one for those who used Yahoo Finance. They provide raw data, adjusted closes and splits/dividends.
They also have CSV output, with very similar format for Yahoo Finance users.
Also there is a https://intrinio.com/ data provider, looks good, but they much more expensive, have no data for Mutual Funds and API is very different in compare to Yahoo Finance. Then you need to significantly change your code.

댓글을 달려면 로그인하십시오.

추가 답변 (5개)

Artur Sepp
Artur Sepp 2017년 4월 19일
편집: Artur Sepp 2017년 4월 20일
It appears that Yahoo have changed the http to the encrypted https. You should now create the queries using 'https://ichart.finance.yahoo.com/table.csv?s=' + requests instead of 'http://ichart.finance.yahoo.com/table.csv?s=' + requests. This solution is a bit messy than using the conventional yahoo handle in the matlab datafeed packadge. It took me a few hours to re-write my data fetching analytics...
Matlab function c=yahoo is a build-in one and cannot be overwritten with something like c=yahoo('https://ichart.finance.yahoo.com'). So we can only wait for Matlab to update the datafeed toolbox to pick up this change from Yahoo. I hope that someone from Matlab support team would read this post and take the needed action.
  댓글 수: 1
Denis Alaev
Denis Alaev 2017년 6월 18일
No, it appears that Yahoo closed the API forever...

댓글을 달려면 로그인하십시오.


Adriano
Adriano 2017년 4월 20일
편집: Adriano 2017년 4월 20일
Hello! I contact Matlab support and they give me a new code for datafeed toolbox. Now it works! You should do the same if you want fix the problem quickly.
  댓글 수: 1
Adhish Aggarwal
Adhish Aggarwal 2017년 4월 20일
편집: Adhish Aggarwal 2017년 4월 20일
Hi Adriano, Can you post the code that Matlab support gave you?

댓글을 달려면 로그인하십시오.


Alexandre Amorim
Alexandre Amorim 2017년 4월 30일
MATLAB uses Yahoo's API under the hood. Around April 18 Yahoo introduced some changes in the protocol of their API. These changes prevented the Datafeed Toolbox from connecting to the service.
The development team implemented a fix that takes into account those changes, but the fix needs to be applied manually. To apply the fix, follow these steps:
1) Download the attached files: 'yahoo.m' and 'fetch.m'
2) Remove the following file
%MATLAB_ROOT%\toolbox\datafeed\datafeed\@yahoo\yahoo.p
%MATLAB_ROOT%\toolbox\datafeed\datafeed\@yahoo\fetch.m
where %MATLAB_ROOT% can be found with the following MATLAB command:
>> matlabroot
3) Place the downloaded files in the following locations:
%MATLAB_ROOT%\toolbox\datafeed\datafeed\@yahoo\yahoo.m
%MATLAB_ROOT%\toolbox\datafeed\datafeed\@yahoo\fetch.m
4) Run the following MATLAB command
>> rehash toolboxcache
>> clear classes
Now you should be able to retrieve historic and current data as usual:
>> % Current data
>> fetch(yahoo,'IBM')
Thanks to Shashank
  댓글 수: 2
Andy
Andy 2017년 6월 6일
Fetch may work as in your command: fetch(yahoo,'IBM')
But try this: K>> d = fetch(c,'IBM',now) Error using yahoo/fetch (line 318) Unable to return data for given security and date.
K>>
Or actually, try any example from the yahoo fetch doc page. It will fail in R2016b (patched according to the above description).
Steven Lord
Steven Lord 2017년 6월 6일
The bug report has been updated since that answer was posted.

댓글을 달려면 로그인하십시오.


Jeremy Shaw
Jeremy Shaw 2017년 4월 18일
i have this problem also, worked fine last week, now fails; the API/Yahoo has a problem???
  댓글 수: 4
Octavio Garcia
Octavio Garcia 2017년 4월 19일
편집: Walter Roberson 2017년 4월 19일
....after read a post, a guy changed http by https in the URL, and now WORKS!! using urlread
[temp, status] = urlread(strcat('https://ichart.finance.yahoo.com/table.csv?s='...
,tickers{i},'&a=',bm,'&b=',bd,'&c=',by,'&d=',em,'&e=',ed,'&f=',...
ey,'&g=',freq,'&ignore=.csv'));% urlread2.urlread2( ... do the same
Adhish Aggarwal
Adhish Aggarwal 2017년 4월 19일
It is still not working.

댓글을 달려면 로그인하십시오.


Calder
Calder 2017년 4월 19일
Help us matlab!!

카테고리

Help CenterFile Exchange에서 Web Services에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by