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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 0 0

5 year range EIA Crude Cushing Chart - Eikon Python Pull

Hi Everyone,

I'm attempting to pull some EIA data to generate a chart that shows the 5 year range of EIA Crude Stock Levels at Cushing. I tried figuring it out on my own, but the examples on github were overwhelming. Could someone please help me with how to generate a basic python script for how to create a chart like this? I'm looking for something that would show the last 5 years of data, all on one chart.

To start, I was writing some python to try to find the basic time series. I saw the Reuters code for this information as USOICC=ECI, however, this script didn't work (I put in my API key properly, and it worked for basic futures quotes like WTI already)


Thanks so much for your help!

Peter

import eikon as ek
ek.set_app_key('XXXXXXX')
df = ek.get_timeseries(['USOICC=ECI'], 
                       start_date="2016-01-01",
                       end_date="2020-12-31",
                       )
df
eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
1614012802758.png (37.9 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.

1 Answer

Upvotes
Accepted
18k 21 12 20

Hi @pwares

To make the API call work, you have to add interval='weekly'


Then you can plot the data from the "df" variable.

df.plot()

ahs1.png (21.7 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.

Click below to post an Idea Post Idea