How to use RESTful web services in Matlab

I have a data provider that provides a RESTful web interface. I am trying to get this data in matlab. The interface is relatively simple, but am I still looking for someone out there who has any experience? The service does not provide SOAP / WSDL, which Matlab can easily use. The provider has an β€œadapter” that you can install on the machine (basically, installing Appache / Tomcat with some kind of β€œplug-in”) to act as an intermediary that provides these services, but for many reasons it will be very difficult to configure in my company.

+4
source share
2 answers

If the RESTful interface returns JSON, it looks as simple as installing a small plugin:

http://www.mathworks.com/matlabcentral/fileexchange/20565

and ((almost) directly from the readme of this plugin):

google_search = 'http://ajax.googleapis.com/....'; matlab_results = parse_json(urlread(google_search)); 

I think the good thing about RESTful interfaces over SOAP or something else is that you don't need excessive mechanisms to solve this problem. I am sure that if the interface does not return JSON, it will be something similar that you can parse.

+6
source

MATLAB R2014b can do this natively: http://uk.mathworks.com/help/matlab/ref/webread.html

For instance:

 api = 'http://climatedataapi.worldbank.org/climateweb/rest/v1/'; url = [api 'country/cru/tas/year/USA']; S = webread(url) 
+1
source

All Articles