Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 0 2

Vessel API Pull Issues

I have Eikon Commodities product, and am struggling with two issues:

  1. Certain fields only populate on the earliest DateTime.
  2. When I add certain RICS, I get an error message and the Tuple only returns a one row dataframe , in the example below I added the field “TR.AssetDestinationPortCountry” which triggered the error.

"""

PYTHON CODE BELOW

"""

#Import Libraries
import eikon as ek
import pandas as pd
import numpy as np

ek.set_app_key('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')

pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)

#Extract HistAll
tupHistAll = ek.get_data(["9498298"],["TR.AssetName;\
TR.AssetDateTime;\
TR.AssetDestination;\
TR.AssetDestinationPort;\
TR.AssetDestinationZone;\
TR.AssetDWT;\
TR.AssetFlowCommodity;\
TR.AssetDraught;\
TR.AssetETA;"\
],\
{'SDate': '06Jun22', 'EDate': '14Jun22', 'RH': 'In'})
dfVesselHistAllTest = pd.DataFrame(tupHistAll[0]).iloc[:,1:]
dfVesselHistAllErr = pd.DataFrame(tupHistAll[1]).iloc[:,1:]


#Extract HistDaily
tupHistDaily = ek.get_data(["9498298"],[
"TR.AssetName;\
TR.AssetDateTime;\
TR.AssetDestination;\
TR.AssetDestinationPort;\
TR.AssetDestinationZone;\
TR.AssetDWT;\
TR.AssetFlowCommodity;\
TR.AssetDraught;\
TR.AssetETA;\
"],\
{'SDate': '07Oct20', 'EDate': '15Oct20', 'RH': 'In',\
'VDT':'True'})
dfVesselHistDaily = pd.DataFrame(tupHistDaily [0]).iloc[:,1:]

dfVesselHistDailyErr = pd.DataFrame(tupHistDaily [1]).iloc[:,1:]

#Extract HistAll
tupHistAll2 = ek.get_data(["9498298"],["TR.AssetName;\
TR.AssetDateTime;\
TR.AssetDestination;\
TR.AssetDestinationPort;\
TR.AssetDestinationPortCountry;\
TR.AssetDestinationZone;\
TR.AssetDWT;\
TR.AssetFlowCommodity;\
TR.AssetDraught;\
TR.AssetETA;"\
],\
{'SDate': '06Jun22', 'EDate': '14Jun22', 'RH': 'In'})
dfVesselHistAllTest2 = pd.DataFrame(tupHistAll2[0]).iloc[:,1:]
dfVesselHistAllErr2 = pd.DataFrame(tupHistAll2[1]).iloc[:,1:]

#Extract HistDaily
tupHistDaily2 = ek.get_data(["9498298"],[
"TR.AssetName;\
TR.AssetDateTime;\
TR.AssetDestination;\
TR.AssetDestinationPort;\
TR.AssetDestinationPortCountry;\
TR.AssetDestinationZone;\
TR.AssetDWT;\
TR.AssetFlowCommodity;\
TR.AssetDraught;\
TR.AssetETA;\
"],\
{'SDate': '07Oct20', 'EDate': '15Oct20', 'RH': 'In',\
'VDT':'True'})
dfVesselHistDaily2 = pd.DataFrame(tupHistDaily2[0]).iloc[:,1:]
dfVesselHistDailyErr2 = pd.DataFrame(tupHistDaily2[1]).iloc[:,1:]


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

Hello @duanepelz80304

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,


AHS

<private post>

this question is moved from Eikon COM to Eikon Data APIs forum

1 Answer

· Write an Answer
Upvotes
Accepted
79.2k 251 52 74

@duanepelz80304

You can check with the Data Item Browser to verify which fields are available for this instrument. I checked and found that the TR.AssetDestinationPortCountry is not a valid field for this instrument.

Moreover, you can also use the Data Item Browser to verify if fields support time-series data by using the Parameters tab.

For example, TR.AssetDestinationPort doesn't support time-series data.

1655376270163.png

The TR.AssetDestination field supports time-series data.

1655376379660.png

I hope this will help you


1655376270163.png (84.3 KiB)
1655376379660.png (49.5 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.

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.