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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
7 1 1 4

Use screener with get_timeseries?

Hi all,

I am trying to get time series data on close price for a given country.

dt=ek.get_timeseries(rics='SCREEN(U(IN(Equity(active,public,primary))/*UNV:Public*/), IN(TR.ExchangeCountryCode, "NZ"))', fields='CLOSE', start_date="2016-03-01", end_date = "2017-03-01", interval = "monthly")

But it's not working, it gives an error saying something like

eikon.eikonError.EikonError: Error code -1 | SCREEN(U(IN(Equity(active,public,primary))/*UNV:Public*/), IN(TR.ExchangeCountryCode, "NZ")): Invalid RIC | 

Is the SCREEN command only works with get_data?

Is there a way to get data for all stocks from a given country?

Thanks in advance!

eikoneikon-data-apipythonworkspaceworkspace-data-apirefinitiv-dataplatform-eikonscreening-api
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

Upvote
Accepted
18k 21 12 20

Hi @zzhao

Is the SCREEN command only works with get_data?

You cannot use SCREENER with get_timeseries.

You can use it with get_data to build a RIC list first then pass this RIC list in your get_timeseries API call.

Here is the sample:

df,e = ek.get_data('SCREEN(U(IN(Equity(active,public,primary))), IN(TR.ExchangeCountryCode, "NZ"))', 'TR.RIC')
ric_list = df['RIC'].tolist()

dt=ek.get_timeseries(rics=ric_list, fields='CLOSE', start_date="2016-03-01",
                     end_date = "2017-03-01", interval = "monthly")
dt

Is there a way to get data for all stocks from a given country?

You can use the SCREENER app to define a SCREENER formula which contains only country criteria.

Then follow the sample process to get the RIC list and retrieve data accordingly.

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.

Thank you so much! This puzzled me a long time!