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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 0

Eikon Vessel API Bug/Issue: IMO 9782522

When I call Eikon Python API passing the IMO # 9782522, It threw me the following errors.

eikon.eikonError.EikonError: Error code 500 | Backend error. Failed to deserialize backend response. Expected valid JSON. Error: invalid character 'A' looking for beginning of value

API:

df = ek.get_data(imos, assets)

Assets:

['TR.AssetName;TR.AssetExName;TR.AssetStatus;TR.AssetType;TR.AssetSubType;TR.AssetSubSubType;TR.AssetIMO;TR.AssetFlag;TR.AssetDWT;TR.AssetLOA;TR.AssetCubicCapacity;TR.AssetBeam;TR.AssetDraught;TR.AssetHullType;TR.AssetNoTwentyFoot;TR.AssetCoated;TR.AssetRegisteredOwner;TR.AssetManager;TR.AssetSideType;TR.AssetBuilt;TR.AssetBuiltDemolition;TR.AssetIsDeactivated;TR.AssetTPC;TR.GrossTonnage;TR.AssetNetTonnage;TR.AssetFuelType;TR.AssetFuelOil;TR.AssetFuel;TR.AssetBallast;TR.AssetBallastWater;TR.AssetGrain;TR.AssetCargoHolds;TR.AssetLiquidCap;TR.AssetBale;TR.AssetFreshWater;TR.AssetDisplacement;TR.AssetDieselOil;TR.AssetCrudeCapacity;TR.AssetDeckTEU;TR.AssetHoldTEU;TR.AssetPassengers;TR.AssetLubeOil;TR.AssetReeferTEU;TR.AssetCars;TR.AssetCGT;TR.AssetGasOil;TR.AssetClassedBy1;TR.AssetClassedBy1DateChange;TR.AssetClassedBy1Status;TR.AssetClass;TR.AssetSurvey1Date;TR.AssetSurvey1;TR.AssetSurvey1NextDate;TR.AssetPIInsurerDate1;TR.AssetPIInsurer1;TR.AssetSurvey2;TR.AssetClassedBy1Reason;TR.AssetSurvey2Date;TR.AssetClassedBy2;TR.AssetClassedBy2DateChange;TR.AssetClassedBy2Status;TR.AssetSurvey2NextDate;TR.AssetIceClass;TR.AssetPIInsurerDate2;TR.AssetPIInsurer2;TR.AssetClassedBy2Reason;TR.AssetDepth;TR.AssetBreadthMoulded;TR.AssetBreadthExtreme;TR.AssetLengthBP;TR.AssetFreeboardWinter;TR.AssetFreeboardTropical;TR.AssetFreeboardSummer;TR.AssetAirDraught;TR.AssetDepthMoulded;TR.AssetLengthRegistered;TR.AssetBreadthRegistered;TR.AssetBeamExtreme;TR.AssetFreeboardLightship;TR.AssetFreeboardNormalBallast;TR.AssetFreeboardSegregatedBallast;TR.AssetEngTotalKw;TR.AssetMainEngineModel;TR.AssetMainEngineBuilder;TR.AssetMainEngine;TR.AssetEngTotalBhp;TR.AssetMainEngineRpm;TR.AssetMainEngineKw;TR.AssetMainEngineBYear;TR.AssetMainEngineNo;TR.AssetMainEngineBhp;TR.AssetMainEngineShp;TR.AssetMainEnginePower;TR.AssetEngPower;TR.AssetMainEngineType;TR.AssetAuxEngine1;TR.AssetEngineBuilder;TR.AssetAuxEngine1No;TR.AssetAuxEngine1Kw;TR.AssetAuxEngine1Bhp;TR.AssetAuxEngine1Rpm;TR.AssetAuxEngine1BYear;TR.AssetAuxEngine1Shp;TR.AssetBollardPull;TR.AssetPropeller;TR.AssetPropellingType;TR.AssetLiftingEquipment;TR.AssetGenerator;TR.AssetGeneratorDescription;TR.AssetPropellerDescription;TR.AssetPropellerMake;TR.AssetGeneratorMake;TR.AssetGear;TR.AssetThruster;TR.AssetThrusterDescription;TR.AssetTrailers;TR.AssetThrusterMake;TR.AssetJonesAct;TR.AssetDecksNumber;TR.AssetServiceSpeed;TR.AssetPortRegistry;TR.AssetHullMaterial;TR.AssetSpeedConsumpt;TR.AssetFuelConsumption;TR.AssetContractDate;TR.AssetBulkheads;TR.AssetDeliveryDate;TR.AssetNewbuildingNumber;TR.AssetNewbuildingPrice;TR.AssetTrialSpeed;TR.AssetCoatings;TR.AssetManagerAddress;TR.AssetRegisteredOwnerAddress;TR.AssetRegisteredOwnerLocation;TR.AssetManagerLocation;TR.AssetISMManagerName;TR.AssetISMManagerLocation;TR.AssetManagerPhone;TR.AssetManagingAgent;TR.AssetManagingAgentCountry;TR.AssetManagerFax;TR.AssetManagerWebsite;TR.AssetManagerEmail;TR.AssetISMManagerAddress;TR.AssetRegisteredOwnerPhone;TR.AssetISMManagerPhone;TR.AssetManagingAgentPhone;TR.AssetISMManagerFax;TR.AssetRegisteredOwnerFax;TR.AssetManagingAgentFax;TR.AssetManagingAgentAddress;TR.AssetISMManagerWebsite;TR.AssetRegisteredOwnerWebsite;TR.AssetISMManagerEmail;TR.AssetManagingAgentWebsite;TR.AssetRegisteredOwnerEmail;TR.AssetBeneficialOwner;TR.AssetManagingAgentEmail;TR.AssetManagingAgentPost;TR.AssetBeneficialOwnerCountry;TR.AssetManagingOwner;TR.AssetManagingOwnerCountry;TR.AssetManagingOwnerPost;TR.AssetManagingOwnerAddress;TR.AssetGroupOwner;TR.AssetGroupOwnerCountry;TR.AssetManagingOwnerPhone;TR.AssetManagingOwnerFax;TR.AssetManagingOwnerWebsite;TR.AssetManagingOwnerEmail;TR.AssetCommercialManager;TR.AssetCommercialManagerCountry;TR.AssetReeferPts;TR.AssetOperatorName;TR.AssetTechnicalManager;TR.AssetTechnicalManagerCoutry;TR.AssetTechnicalManagerAddress;TR.AssetTechnicalManagerPost;TR.AssetOperatorLocation;TR.AssetOperatorAddress;TR.AssetTechnicalManagerPhone;TR.AssetOperatorPhone;TR.AssetOperatorWebsite;TR.AssetTechnicalManagerFax;TR.AssetOperatorFax;TR.AssetTechnicalManagerWebsite;TR.AssetOperatorEmail;TR.AssetTechnicalManagerEmail;TR.AssetRegister;TR.AssetManagingOwnerMobile;TR.AssetManagingAgentMobile;TR.AssetExName1;TR.AssetExName2;TR.AssetExName3;TR.AssetExName4;TR.AssetExName5;TR.AssetExName6;TR.AssetExName7;TR.AssetExName8;TR.AssetExName9;TR.AssetExName10;TR.AssetBuilder;TR.AssetYardNumber;TR.AssetCountryPlaceBuild;TR.AssetBuilderCountry;TR.AssetShipyard;TR.AssetLocationDate;TR.AssetPolygonZoneType;TR.AssetLocationLatitude;TR.AssetLocationLongitude;TR.AssetDateTime;TR.AssetDestination;TR.AssetDestinationPrevious;TR.AssetDestinationChangeTime;TR.AssetETA;TR.AssetETAPrevious;TR.AssetETAChangeTime;TR.AssetHeading;TR.AssetSpeed;TR.AssetLocationDraught;TR.AssetLocationWidth;TR.AssetLocationLength;TR.AssetLocationStatus;TR.AssetLocationStatusPrevious;TR.AssetLocationStatusChangeTime;TR.AssetCallSign;TR.AssetLocationDatasource;TR.AssetLocationShipType;TR.AssetLocationDraughtPercentage;TR.AssetPolygonDate;TR.AssetPolygonZoneType;TR.AssetPolygonName;TR.AssetCentrePoint;TR.AssetEnterTimestamp;TR.AssetOutTimestamp;TR.AssetRCSID;TR.AssetEventType;TR.AssetEventTypeId;TR.AssetLocationType;TR.AssetFacilityType;TR.AssetFacilityTypeId;TR.AssetLocation;TR.AssetPort;TR.AssetPortRIC;TR.AssetPortEntryTime;TR.AssetDestinationPort;TR.AssetDestinationPortRIC;TR.AssetDestinationCountry;TR.AssetDestinationCountryRCSID;TR.AssetDestinationZone;TR.AssetDestinationZoneRCSID;TR.AssetPreviousPort;TR.AssetPreviousPortRIC;TR.AssetPreviousEntryTime;TR.AssetPreviousExitTime;TR.AssetPreviousPortEntryDraft;TR.AssetPreviousPortExitDraft;TR.AssetBerth;TR.AssetBerthRIC;TR.AssetBerthEntryTime;TR.AssetPreviousBerth;TR.AssetPreviousBerthRIC;TR.AssetPreviousBerthEntryTime;TR.AssetPreviousBerthExitTime;TR.AssetPreviousBerthType;TR.AssetAnchorage;TR.AssetAnchorageRIC;TR.AssetAnchorageEntryTime;TR.AssetPreviousAnchorage;TR.AssetPreviousAnchorageRIC;TR.AssetPreviousAnchorageEntryTime;TR.AssetPreviousAnchorageExitTime;TR.AssetPreviousZone;TR.AssetPreviousZoneRCSID;TR.AssetPreviousCountry;TR.AssetPreviousCountryRCSID;TR.AssetCleanDirty;TR.AssetCleanDirtyAssessmentDate;TR.AssetCleanDirtySource;TR.AssetFlowLocationDate;TR.AssetFlowPermID;TR.AssetFlowRIC;TR.AssetLoadingPort;TR.AssetLoadingGeography;TR.AssetLoadingDateFrom;TR.AssetLoadingDateTo;TR.AssetLoadingGeographyForecastActual;TR.AssetLoadingDateForecastActual;TR.AssetDischargingPort;TR.AssetDischargingGeography;TR.AssetDischargingGeographyForecastActual;TR.AssetDischargingDateForecastActual;TR.AssetDepartureDate;TR.AssetDepartureDateForecastActual;TR.AssetDepartureEstimateType;TR.AssetArrivalDateFrom;TR.AssetArrivalDateTo;TR.AssetArrivalDateForecastActual;TR.AssetArrivalEstimateType;TR.AssetDischargeDate;TR.AssetFlowCommodity;TR.AssetFlowCommodityRCSCode;TR.AssetFlowGrade;TR.AssetGradeAF;TR.AssetCharterer;TR.AssetFreight;TR.AssetFreightType;TR.AssetVolume;TR.AssetVolumeMeasurement;TR.AssetFlowStatus;TR.AssetFlowComments;TR.AssetFlowTradeComments;TR.AssetTradeType;TR.AssetPriceDiscountPremium;TR.AssetPriceLow;TR.AssetPriceHigh;TR.AssetPriceMeasurement;TR.AssetPriceBasis;TR.AssetTerms;TR.AssetBenchmark;TR.AssetBuyer;TR.AssetSeller;TR.AssetIssuer;TR.AssetIssuerBuySell;TR.AssetAwardee;TR.AssetTradingDate;TR.AssetClosingDate']


eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
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
18k 21 12 20

Hi @ZShi

I could not find your registered email(xxxx@freexxxxx.com) on the Eikon Account.

I tested the API call and found that the issue is with "TR.AssetFlowComments" as Jason's answer.

However, it also affects Eikon Excel as well and this needs to be addressed by Refinitiv Helpdesk.


So, please visit https://my.refinitiv.com

And report the issue to Refinitiv Helpdesk using Eikon user (I could not do this on your behalf's because I could not find your registered email in Eikon Account)


ahs.png (161.6 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.

Upvotes
6.7k 8 6 7

@ZShi You need to make an array of fields as such:

assets = ['field1','field2','field3'] 

not in the format you have put them as one string with field names separated by a semi-colon. Please see our API reference guide which may be of use. On the same link please also check the API limits document as there are limits enforced per API call. I hope this can help.

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
1 0 0 0

You were wrong.

Use same API, all our other 400+ IMOs returned correct results. This is the only one with issue.

BTW, by the array like input as you suggested, I got this error

ValueError: get_data error: the fields should be of type string or dictionary


Here is the example in Eikon API document

#Pass IMO Number as the first argument to the function get_data to get the location details of any vessel
#In this example, we're passing IMO Number 9640176 as our vessel identifier
#You may replace that with an IMO of your choice

df = ek.get_data(["9640176"],["TR.AssetName;TR.AssetImo;TR.AssetLocationLatitude;TR.AssetLocationLongitude"])


You can see the assets are separated by semi colon.

From my experience, it seems one of the "asset" text value contains the Special character that is JSON reserved. My suggestion is:

1) You break the assets into small sets and try figure out which "asset" exactly caused the issue;

2) Go to your database, check what was the text value and what character caused the issue; and

3) Put a small fix in the code to handle this special character.


Thanks

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
6.7k 8 6 7

@ZShi Apols I stand corrected - hadn't seen that semi-colon format used before. The field that is causing the error is TR.AssetFlowComments. All others seem fine. This comment field must be free text and contains:

I will have to pass this onto the dev team to look at and get back to you. Thanks for your suggestions.

This format shouldn't error though:

fields = ['TR.AssetName','TR.AssetImo','TR.AssetLocationLatitude','TR.AssetLocationLongitude'] 
df,err = ek.get_data(["9640176"],fields) df



1603239948491.png (87.5 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.

Upvotes
1 0 0 0

Glad you guys found the issue! Wondering for a quick solution (instead of waiting the code release etc), could you guys simply fixed the data ( "TR.AssetFlowComments") of that IMO#.

This way, the API should at least return the valid output instead of error out.

Let me know, my email as zshi@freepoint.com

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.

Hi @ZShi

Please submit a ticket to support using the Eikon account user at https://my.refinitiv.com

So the technical support group will reach out to you regarding any fix/solution.

Click below to post an Idea Post Idea