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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
18 0 1 4

Is there a possibility to retrieve options via Rsearch EIKON Data API (Python)?

1637757276129.png

How could I replicate the request presented on the screenshot attached in Python?

eikon-data-api
1637757276129.png (38.8 KiB)
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.

Upvote
Accepted
9.7k 49 38 60

Hi @susskaya.anita

Try the following:

import refinitiv.dataplatform as rdp

...

response = rdp.Search.search(
    filter = "UnderlyingQuoteRIC xeq 'SPY' and IsChain eq false and \
              CallPutOption xeq 'Put' and ExerciseStyle xeq 'A'  and \
              PeriodicityCode eq 'M' and ExpiryDate ge 2022-04-01 and \
              ExpiryDate le 2022-04-30",
    order_by = "StrikePrice",
    top = 2000,
    select = "StrikePrice, ExpiryDate, RIC"
)
response.data.df

ahs.png


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

I could not install this because when I try pip install refinitiv-dataplatform conda shows me refinitiv-dataplatform 1.0.0a11 requires httpx>=0.18.0, but you have httpx 0.14.2 which is incompatible. I installed 0.14.2 because it was the only solution for the following problem:

Error: no proxy address identified. Check if Eikon Desktop or Eikon API Proxy is running.
@susskaya.anita you can also use try pip install httpx==0.19.0 and see if that works on your setup.

For now I have the following problem:1637831511200.png

1637831511200.png (107.5 KiB)
Show more comments
Upvotes
6.7k 8 6 7

@susskaya.anita Please also post the full code including the import statements and the appkey setting (you can remove your actual app key for security reasons). thx

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.

import eikon as ek # the Eikon Python wrapper package


import refinitiv.dataplatform as rdp


import numpy as np # NumPy


import pandas as pd # pandas


import configparser as cp


import sys


ek.set_app_key('')


response = rdp.Search.search(

filter = "UnderlyingQuoteRIC xeq 'SPY' and IsChain eq false and \

CallPutOption xeq 'Put' and ExerciseStyle xeq 'A' and \

PeriodicityCode eq 'M' and ExpiryDate ge 2022-04-01 and \

ExpiryDate le 2022-04-30",

order_by = "StrikePrice",

top = 2000,

select = "StrikePrice, ExpiryDate, RIC"

)

response.data.df

@susskaya.anita so you need to open the rdp desktop session first - please add the following line below your ek.set_app_key(''):

rdp.open_desktop_session('YOUR APP KEY HERE')

and try running thx

It worked. Thank you so much for your help and attention!

another code is working properly

1637832187732.png

1637832187732.png (53.1 KiB)
Click below to post an Idea Post Idea