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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

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-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythoncodebook
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.

1 Answer

Upvotes
Accepted
18k 21 12 20

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 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea