question

Upvotes
Accepted
13 1 0 2

Unable to retrieve mid price for WTI futures using get_history

I have issues with the python API. the get_history function works fine for certain RICs but I am getting errors for others, for instance:


df = rd.get_history(

universe=["LGOc1"],

interval="1h",

fields=["MID_PRICE"],

count=1000)


df = rd.get_history(

universe=["CLc1"],

interval="1h",

fields=["MID_PRICE"],

count=1000)

An error occurred while requesting URL('http://localhost:9000/api/rdp/data/historical-pricing/v1/views/intraday-summaries/CLc1?interval=PT1H&count=1000&fields=MID_PRICE%2CDATE_TIME').

ReadTimeout('timed out')

Traceback (most recent call last):


Cell In[32], line 1

df = rd.get_history(


File ~\anaconda3\Lib\site-packages\refinitiv\data\_access_layer\get_history_func.py:206 in get_history

raise RDError(-1, except_msg)


RDError: Error code -1 | timed out


The same request works fine for Gasoil or Brent futures but not for WTI futures. By reducing the count parameter, I manage however to have the function work for WTI too.


Can you please help?

eikonpythonworkspaceworkspace-data-api#technology
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
Upvotes
Accepted
81.4k 267 53 76

@Mark Lucio

Thank you for reaching out to us.

It could be the HTTP timeout.

You can configure this value in RD configuration file. The default value should be 20 seconds.

You can try to increase it to other values, such as 60.

1716786056822.png

For more information, please refer to the answer in this discussion.


1716786056822.png (3.6 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.

Hi @Jirapongse and @jonathan.legrand, the above is helpful. The resolution for this case is we found that mid prices are not available for this RIC (CLc1) for intraday intervals. Thank you!

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.