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
1 3 3 3

Get closing price from multiple stocks using Eikon API?

I would like to get daily closing price for multiple stocks using eikon API and display them into a data frame python

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

Thank you for your participation in the forum.
Is the reply below satisfactory in answering your question?
If yes please click the 'Accept' text next to the reply.
This will guide all community members who have a similar question.
Otherwise please post again offering further insight into your question.
Thanks,
AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,


AHS

Upvotes
Accepted
39.4k 77 11 27

Check out the discussion on this previous thread.

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.

This is only for one stock. I want the same thing but for multiple stocks

You can pass multiple instruments to the instruments argument of get_data method as a Python list.

instruments = ['AAPL.O', 'IBM.N', 'FB.O']

But the point is that you can use CodeCreator app in Eikon, which is very helpful in creating code samples for the retrieval of most all content available through Eikon Data APIs.

Upvote
17.3k 82 39 63

@maxwilliams.boko.

The example only shows one, but it is wrapped in a list. You can specify multiple stocks, comma-separated. For example:

df, err = ek.get_data(
    instruments = ['stock1', 'stock2', 'stock3'],
    fields = ['TR.CLOSEPRICE.Date','TR.CLOSEPRICE'],
    parameters = {'SDate':'2021-02-01','EDate':'2021-02-28','Curn':'USD'}
)
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.

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.