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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 2 4

I'm using GET_DATA etc. and getting back delayed quotes/prices/... What do I need to do to get real time data? Do I have to use Websocket API ?

eikon-data-apipython 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.

Upvotes
Accepted
14.7k 64 39 63

Hi @vlad.dimanshteyn

You can use the following statement to get your constituents:

option_chain,err = ek.get_data('0#SPX*.U', ['CF_NAME'])

ahs.png

And to get your real-time data, try something like this: (Note: The Pricing interface / WebSocket service has a limitation when making a single request - so you will have to break up the request into buckets - in the example below, I'm using a value of 100).

ahs.png


ahs.png (53.1 KiB)
ahs.png (74.1 KiB)
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.

I'm doing that already Nick, that's why I provided the code !!!! The issue I'm having is that the data I get back is delayed and I want it real time !!!! What do I need to do to get real time data using that code????? Thanks
Oh sorry, its different code that you modified, I missed that stream thing. Thanks so much, I will try it.

Nick,

I need Web Socket Service for this as I understand, is that correct? That's a separate subscription that I need to get, right? I do no have Refinitiv library to do

from refinitiv.data.content import pricing

I just have Eikon library

Thanks so much for your help

Hi @vlad.dimanshteyn

The refinitiv.data library should be available to you. You can refer to the learning material on our dev portal for more details: Refinitiv Data Library for Python. I believe you should have streaming services as part of your license - I would try one of the basic tutorials within the link I provided.

Also, you can try one of the pricing examples within CodeBook - under the __Examples__ folder, you can navigate down to many examples - the one I'm referring to is: EX_01_01_11_Content_Pricing_Streaming. If you can successfully execute that example, you are good to go.

Thank you sir for those last 2 messages. I really appreciate it. As long as I can do from refinitiv.data.content import pricing

I should be fine. May have to install that package. I'll try it tomorrow and let you know. We have your data company wide, we dropped Bloomberg so I would think I have license needed.

Hi Nick,

1 last question. I also need to get weekly SPX option chain. Its about 13,000 items. When I run:

option_chain, err = ek.get_data('0#SPXW*.U', ['CF_NAME'])

it times out. What options do I have to get weekly SPX option chain? Can I use a filter to pull only a subset of them?

Thanks so much Nick

Hi @vlad.dimanshteyn

Does the request to retrieve this option chain always fail? I don't know if it may fall into the category of data limits or if there is a backend issue. I think it would be best if you were to post this as a separate question as I think it will involve more than a few comments here :-). Thanks.

Upvotes
14.7k 64 39 63

Hi @vlad.dimanshteyn

If you want to get real-time data, I would suggest you look at the pricing cache example which subscribes to data and allows the ability to pull out live data from the cache.


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.

Currently I use:

option_chain, err = ek.get_data('0#SPX*.U', ['TRADE_DATE', 'ACVOL_1'])

option_data_block, err = ek.get_data(instruments =option_chain['Instrument'].tolist(), fields=['PUTCALLIND', 'TRDPRC_1', 'BID', 'ASK', 'TRADE_DATE', 'SALTIM', 'STRIKE_PRC', 'EXPIR_DATE'])

undelying_price, err = ek.get_data('.SPX', ['CF_LAST'])


Are you saying Nick that I can not use those 3 statements to get real time option data and the price of underlying?


I need to get those field real time !!!!

How do I do that?