In line with this question:
The example code retrieves vessel information for all ports within a specified timeframe, then filters out unwanted ports locally using .isin()., which wastes API calls.
How can the port name filter be incorporated directly into the API parameters to limit results at the source?
for i in range(0, len(vessels_imo), batch_size):
temp = ld.get_data(vessels_imo[i:i+batch_size],["TR.AssetName;TR.AssetPolygonName;TR.AssetEventType;TR.AssetFacilityType;TR.AssetLocationType;TR.AssetDateTime, TR.AssetLocationDraught"],
{'SDate': from_date , 'EDate': today_date ,'ZT':'P', 'LT':'ENTRY'})
temp = temp[temp['Polygon Name'].isin(port_list)]
vessels_positions = pd.concat([vessels_positions,temp])
Thank you!