Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
7 2 2 5

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-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apiscreening-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

· Write an Answer
Upvote
Accepted
18.2k 21 13 21

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!

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.