can't connect to yahoo
Show older comments
c = yahoo; error using yahoo (line 63) Unable to connect or retrieve data from given URL.
Accepted Answer
More Answers (5)
Artur Sepp
on 19 Apr 2017
Edited: Artur Sepp
on 20 Apr 2017
2 votes
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 Comment
Denis Alaev
on 18 Jun 2017
No, it appears that Yahoo closed the API forever...
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 Comment
Adhish Aggarwal
on 20 Apr 2017
Edited: Adhish Aggarwal
on 20 Apr 2017
Alexandre Amorim
on 30 Apr 2017
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')
2 Comments
Andy
on 6 Jun 2017
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
on 6 Jun 2017
Jeremy Shaw
on 18 Apr 2017
0 votes
i have this problem also, worked fine last week, now fails; the API/Yahoo has a problem???
4 Comments
Adriano
on 19 Apr 2017
I have the same problem and nobody help us!
Walter Roberson
on 19 Apr 2017
You should contact Mathworks technical support.
The regular volunteers who answer questions here do not happen to use that toolbox.
Octavio Garcia
on 19 Apr 2017
Edited: Walter Roberson
on 19 Apr 2017
....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
on 19 Apr 2017
Calder
on 19 Apr 2017
0 votes
Help us matlab!!
Categories
Find more on Web Services in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!