question

Upvotes
Accepted
1 0 0 3

How can I get real-time stock price using EIKON API or Refinitiv-data API ?

I want to get real-time stock price for S&P 500 constituents and S&P 500 Index.


I did it 2 ways, there are each problem. And there are delayed data only.

Do I need additional subscription charged?

Please check there are any problem.


1.

spx_cons = ['MMM.N', 'AOS.N', 'ABT.N', ....]

data, err = ek.get_data(spx_cons, ['CF_LAST'])

Through this way, there are not real-time price. only 15 minutes delayed data.

If I uncheck "Automatically switch to delayed data" in workspace setting, then I get real-time data? not delayed?


2.

  
                
  1. rd.open_session()
  2. df = rd.get_data('0#.SPX',['TR.RIC'])
  3. stream = rd.open_pricing_stream(    universe= df['Instrument'].tolist(),    fields=['BID', 'ASK'] )
  4. stream.get_snapshot()


In this way, there are not real-time price, only delayed data, too

And, I want to get recently contract price, not bid or ask. Is there field?

I think Second method is more better for me. Because it's streaming.


Please help me

Thank you

eikon-data-apipythonworkspacerefinitiv-realtime#technologyrefinitiv-data-platform-eikon
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
25.1k 57 17 14

Hello @dw.jung

The 2nd code that uses the Data Library for Python Access layer - Pricing streams should give you the data based on your permission. I strongly suggest you contact your LSEG representative to verify if you have a permission for the real-time pricing data or delay.

If you need a real-time streaming data, you can use the Access layer - Pricing streams and Content - Pricing - Streaming Events examples based on your preference.

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.