We wish you a Merry Christmas and Happy New Year! And as a small gift, we are happy to introduce Matlab Connector for our API. The usage is very user-friendly, as explained in our documentation for Matlab Connector with examples.

Example for Live/Delayed Prices

>> data =
EODML('prices', 'symbol','AAPL', 'datatype','live')
data = 
  struct with fields:
           symbol: 'AAPL.US'
        timestamp: 1577480400
        gmtoffset: 0
             open: 291.12
             high: 293.97
              low: 288.12
            close: 289.8
           volume: 36566500
    previousClose: 289.91
           change: -0.11
         change_p: -0.038
      datestr_GMT: '27-Dec-2019 21:00:00'
      datenum_GMT: 737786.875

More details you can find in our documentation or the Undocumented Matlab website:  https://UndocumentedMatlab.com/EODML/.

About the Author

The connector had been developed by Yair Altman. Yair Altman is a recognized Matlab expert with 30 years of experience. Yair published two textbooks on Matlab and is a member of the MathWorks advisory board. He is widely known from his UndocumentedMatlab website and contributions to public forums.

Comments

  1. Ruerd Heeg

    This can also be done with urlRead command and the free JSONio plugin. See https://github.com/gllmflndn/JSONio

    I did this with Octave instead of Matlab. When using Octave compile the plugin with “mkoctfile –mex jsonread.c”
    Then use “addpath /home/login/Documents/MATLAB/JSONio” also from the Octave prompt.

    You can call the plugin like this:
    urlString = [ …
    “https://eodhistoricaldata.com/api/eod/AAPL.US?from=2019-01-01&to=2020-01-01” …
    “&api_token=&period=d&fmt=json” ];
    [s, success, errorMessage] = urlread(urlString);
    result = jsonread(s);
    for i=1:size(result)
    adjustedClose = [ adjustedClose; result(i).adjusted_close];
    # this datenum call is computationally expensive, so better use a lookup array
    datesClose = [ datesClose; datenum(result(i).date, 29) ];
    endfor