vortexasdk.endpoints.vessel_positions
Try me out in your browser:
VesselPositions
VesselPositions(self)
Vessel Positions endpoint.
search
VesselPositions.search(
vessel_id: typing.Union[str, typing.List[str], NoneType] = None,
vessel_class: typing.Union[str, typing.List[str], NoneType] = None,
time_max: typing.Optional[str] = None,
time_min: typing.Optional[str] = None,
interval: str = '1d')
Find all latest positions of vessels matching given search arguments. Search arguments are combined in an AND manner.
Arguments
-
time_max: The earliest timestamp before which you'd like your positions sourced from
vessel_id: ID or IDs of vessels we'd like to search
vessel_class: vessel_class (or list of vessel classes) we'd like to search. This will give you positions for all vessels within this class, if no IDs are set. Each vessel class must be one of
"oil_coastal", "oil_intermediate", "oil_flexi", "oil_handysize", "oil_mr1","oil_handymax", "oil_mr2", "oil_panamax", "oil_lr1", "oil_aframax", "oil_lr2", "oil_suezmax","oil_lr3", "oil_vlcc","lpg_coasters", "lpg_handysize", "lpg_mgc", "lpg_lgc", "lpg_vlgc", "lpg_vlec", "lng_small_scale_lng", "lng_mid_scale_lng", "lng_two_stroke", "lng_tfde_dfde", "lng_steam", "lng_ssd", "lng_q_flex", "lng_q_max", "oil_coastal", "oil_specialised", "oil_handysize_mr1", "oil_handymax_mr2", "oil_panamax_lr1", "oil_aframax_lr2", "oil_suezmax_lr3", "oil_vlcc","lpg_sgc", "lpg_mgc", "lpg_lgc", "lpg_vlgc_vlec","lng_small_scale_lng", "lng_mid_scale_lng","lng_conventional_lng", "lng_q_fleet", "oil", "lpg", "lng",
. Refer to VortexaAPI Vessel Entities for the most up-to-date list of vessel classes.
Returns
List of vessel positions matching the search arguments.
Examples
- Let's find a position for all Aframax vessels, from the day of March 12th, 2024
>>> from vortexasdk import VesselPositions
>>> vessel_positions_df = VesselPositions().search(vessel_class=['oil_aframax'], time_max='2024-03-12T23:59:59.000Z', time_min='2024-03-12T00:00:00.000Z', interval='1d').to_df(columns=['vessel_id', 'timestsamp', 'lat', 'lon', 'speed', 'heading'])
vessel_id | lat | lon | timestamp | speed | heading | |
---|---|---|---|---|---|---|
0 | bc49bed3d600b394 | 17.36560 | -161.39080 | 2023-10-31T23:57:11.000Z | 19.299 | 308 |
...to >800 results |
Note that we will show you all fields by default if you don't set the columns argument.
Further Documentation
VortexaAPI Vessel Positions Reference
vortexasdk.endpoints.vessel_positions_result
VesselPositionsResult
VesselPositionsResult(*, records: typing.List,
reference: typing.Dict[str, typing.Any])
Container class that holds the result obtained from calling the Vessel-Positions
endpoint.
model_config
to_list
VesselPositionsResult.to_list()
Represent vessel positions as a list.
to_df
VesselPositionsResult.to_df(
columns:
typing.Union[typing_extensions.Literal['all'], typing.List[str], NoneType] = ['vessel_id', 'timestamp', 'lat', 'lon', 'speed', 'heading']
)
Represent vessel positions as a pd.DataFrame
.
Arguments
- columns: The vessel positions we want in the dataframe. Enter
columns='all'
to include all features. Defaults tocolumns = ['vessel_id', 'timestamp', 'lat', 'lon', 'speed', 'heading']
.
Returns
pd.DataFrame
of vessel positions.