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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
4 1 1 5

How can I download historical Brent and WTI contract.

I am looking to download historical Brent contracts. For example, on the Reuters terminal or on the Excel API, if I am looking for the Brent contract expiring in December 2012, I am able to download prices by using the RIC code "LCOZ2^1".

However, on the Eikon API for Python, when I type:

bre = ek.get_timeseries('LCOZ2ˆ1', start_date = dt.datetime(2007,1,1))

I get:

EikonError: 'Error code Error | LCOZ2ˆ1: Invalid RIC |  '

Is it normal? How can I access the historical data for this contract through the API?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonapicommodities
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.

Upvotes
Accepted
39.2k 75 11 27

I have no problem on my end executing get_timeseries method with parameters you specified. I could not however copy & paste the RIC from your request to mine. The encoding of the caret symbol appears to be wrong. Try executing the same request again, but make sure to type in the RIC from keyboard as opposed to copy & paste it.

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.

Upvotes
4 1 1 5

Hi Axel,

I have trying to type the RIC using my keyboard or by copy-pasting it. It doesn't work. I use the ^ symbol which is on the 6 key on a QWERTY board but this do not change anything.

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'm curious if converting the RIC input to a list will make a difference. Could you try
ek.get_timeseries(['LCOZ2^1'], start_date = dt.datetime(2007,1,1))?

If you still get the same error, please add debug=True parameter to the request and share the full response including the traceback of the error.
ek.get_timeseries(['LCOZ2^1'], start_date = dt.datetime(2007,1,1), debug=True)

Hi Axel,

Thank you very much, the first solution works and I get the data when I convert it to a list.

Click below to post an Idea Post Idea