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?

Best Answer

  • Jirapongse
    Answer ✓

    @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.

Answers