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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 0

API freightOS 40' Container Rates data via python

I'm interested in API'ing freightOS 40' Container Rates data via python.

Line of code: data, err = eikon.get_data(ric, fields, params)

Prior to calling eikon.get_data, I define ric, fields, and params immediately below.

ric = 'FREIGHTOS-CN-USWC'

fields = ['RHistory.LAST_QUOTE.Timestamp', 'RHistory.LAST_QUOTE.Close']

params= {'SDate': start_date, 'EDate': lastMonth, 'INTERVAL': '1MO', 'Ch': 'Fd', }

start_date = '1979-12-31'

lastMonth = '2021-10-31'

I have also tried setting fields equal to what is found immediately below, however, that does not help. fields = ['LAST_QUOTE.Timestamp', 'LAST_QUOTE.Close']

eikon-data-api
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
38.1k 69 35 53

@Alex.ottrisk

The get_data method can't get the RHistory fields. It can be used to get Real-Time & Fundamentals fields which are the same fields as the =TR Excel function. 1636435879368.png

Please try the get_timeseries method instead.

df = ek.get_timeseries('FREIGHTOS-CN-USWC',
            start_date = '1979-12-31T00:00:00',
            end_date   = '2021-10-31T00:00:00',
            fields     = ['CLOSE'],
            interval   = 'monthly')

The output is:

1636436260410.png


1636435879368.png (19.3 KiB)
1636436260410.png (12.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.

Click below to post an Idea Post Idea