New posts are disabled while we improve the user experience.

You can browse the site, or for urgent issues, raise a query at MyAccount.

question

Upvotes
Accepted
1 1 0 0

Multiple values of parameters in eikon.get_data query (Codebook, Python)

Good afternoon!

I am new to Eikon Data API and Codebook. In my Codebook I download historical fundamental data for some companies (Revenue, EBITDA etc.). For instance, I want to get Revenue over 3 last years for some ric.

So I should write a query like:

df, err = eikon.get_data(ric, [{'Tr.Revenue': {'params': {'year': 'FY2019', 'curncy': 'USD'} } },
                      {'Tr.Revenue': {'params': {'year': 'FY2018', 'curncy': 'USD'} } },
                      {'Tr.Revenue': {'params': {'year': 'FY2017', 'curncy': 'USD'} } }])

The question is, how can I pass multiple parameter values in one query. In the example above I makein fact 3 queries, which seems to be rather unefficient. I would like to do something like:

df, err = eikon.get_data(ric, {'Tr.Revenue': {'params': {'year': ['FY2019',
                                                                  'FY2018',
                                                                  'FY2017'], 
                                                         'curncy': 'USD'} } })

I have written some custom function in Python to do that. May be I don't know something and there is built-in method to pass multiple values for parameter in query?

P. S. Parameter names in get_data and DIB do not match. For example, in DIB (Data Item Builder) I see 'Currency', and in get_data I shall write 'Curncy'. Where can I find parameter names exactly for get_data() function ( help(eikon.get_data() is useless )?

eikoneikon-data-apipythonworkspacerefinitiv-dataplatform-eikonworkspace-data-apicodebook
icon clock
10 |1500

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

1 Answer

· Write an Answer
Upvotes
Accepted
18.2k 21 13 21

Hi @ayushkin

Please only use parameters from DIB, they are the valid parameters.

Please follow this sample:



ahs1.png (227.5 KiB)
ahs2.png (38.2 KiB)
icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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