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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 1 1

What would be the most efficient way to retrieve multiple historical economic indicators f.e. inflation and gdp for multiple countries through Eikon Python API?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythontime-serieseconomic-datasentiment
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.

Upvotes
Accepted
1.4k 6 2 2

Hi @oberolis,


Looking at previous posts (that you may find here and here), I found that you can get such GDP data like this:


ek.get_timeseries(['aBDXGDP/CA', 'aBDXGDP/C',
                   'aUSXGDP/C', 'aUSXGDP/CA',
                   'aJPXGDP/C', 'aJPXGDP/CA'],
                  interval='yearly', start_date='1999-12-31')


Changing the two-letter country code as per this site. Note that I used two rics per country, that's because some of them need '/CA' at the end, others need '/C'; if you enter both, only the right one will give an output.


If you are looking for other Economic Indicators, you can repeat the process above with each of the indicators. E.g.: for inflation:


1. I looked for the Economic Indicators' App on Refinitiv Workspace


See Pic 1 bellow


2. Then I selected (a) the country and (B) indicator of choice:

See Pic 2 bellow


I can then see (C) the RIC to use. In this e.g. of Japan's CPI Inflation, it's 'A' followed by the acronym (here: 'JP') then 'CCORPE/A'.


Using the search box at the mid-left, you can enter other such RICs to see dropdowns and check each of your RICs (e.g.: US version of the Inflation above):

See Pic 3 bellow


Then you may add it to your request - e.g.:


ek.get_timeseries(['aBDXGDP/CA', 'aBDXGDP/C',
                   'aUSXGDP/C', 'aUSXGDP/CA',
                   'aJPXGDP/C', 'aJPXGDP/CA',
                   'aUSCCORPE/A'],
                  interval='yearly', start_date='1999-12-31')


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.

Pic 1:


Pic 2:

1619461034900.png (167.0 KiB)
1619461049364.png (91.6 KiB)

Pic 3 l last one:


1619461078544.png (74.0 KiB)
Upvote
1.4k 6 2 2

Hi @oberolis,


Would you mind clarifying what you mean by efficient?

In terms of processing/computing power? Request fetching time? Scripting?

For the 1st, all computation happens server-side, so as to minimize the load on your machine.

For the last, the Eikon Python API allows for short and comprehensive scripting, a good example can be found here.

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.

Upvotes
6.7k 8 6 7

@oberolis I have written an article about working with economic data. You do need to be cognizant of the API limits - esp if you are working with larger datasets - but you can build these iteratively. I hope this can help.

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.

Upvotes
3 0 1 1

Hi guys,

Thanks a lot for your clarifications!

I am looking for something like the following:

countries = ['Germany', 'Italy'...]
makro_variables = ['Inflation', 'GDP',...]

df = ek.get_timeseries(countries,
                           fields = makro_variables
                           start_date = "2000-01-01",
                           end_date = "2021-01-01",
                           interval = "monthly")

With efficient I meant that it would be great if I could have one code line that requests the data (GDP, Inflation etc) for a list of countries.

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