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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
7 0 0 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-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonscreening-api
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

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

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

Click below to post an Idea Post Idea