For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
16 0 1 0

Using Python API via MATLAB

I am using the Python API via MATLAB which works fine as long as I request only single fields:

py.eikon.set_app_key('*****');

instruments = ['LCO5000B1'];

fields= 'CF_CLOSE'; % OR fields= 'CF_CURR';

df= py.eikon.get_data(instruments,fields);

I am now struggling to get data for both fields (CF_CLOSE and CF_CURR) in a single call of get_data. What would be the correct syntax for that?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonmatlab
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvote
Accepted
39.2k 75 11 27

@Peter.Winkler3

Use py.list method of Matlab to create a Python list of fields or instruments, which can then be passed to Eikon Data APIs library for Python:

instruments = py.list({'LCO5000B1','LCO5000B2','LCO5000B3'});
fields = py.list({'CF_CLOSE','CF_CURR'});
res = py.eikon.get_data(instruments, fields);
display(res);
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Thank you very much, @Alex Putkov.! It works perfectly this way!
Upvotes
18k 21 12 20

Hi @Peter.Winkler3

I cannot answer you on the MATLAB.

I can give you the Python example.


ahs.png (14.0 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea