How can I import "curl" API in MATLAB using webread function?

13 views (last 30 days)
Josh Goreham
Josh Goreham on 28 Apr 2022
Commented: Josh Goreham on 29 Apr 2022
I am trying to import a dataset from a website ( using their API. The specific website to use (from their example) is: curl ""
In the case above, I believe my issue is the "curl" portion of the website. I am unsure what this is or how to code it into MATLAB. I tried the following:
api_url = '';
api = webread(api_url);
With this error message:
Error using matlab.internal.webservices.HTTPConnector/copyContentToByteArray
The server returned the status 404 with message "Not Found" in response to the request to URL
Error in readContentFromWebService (line 46)
byteArray = copyContentToByteArray(connection);
Error in webread (line 125)
[varargout{1:nargout}] = readContentFromWebService(connection, options);
I also included "curl" in the webread function, but that did not work either.
I am able to import data from a similar website using this code:
api_url = '';
api = webread(api_url);
I appreciate any help.
Thank you,

Accepted Answer

Jan on 28 Apr 2022
Edited: Jan on 28 Apr 2022
What about using curl instead? This is included in Linux, MacOS and Windows also:
system(['curl "', ...
The web service replies: "Could not find a regatta with name 'Kornati Cup 2019 - B46'"
So there seems to be another problem.

Sign in to comment.

More Answers (0)





Community Treasure Hunt

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

Start Hunting!