The Next Port Service serves the purpose of providing predictions in relation to next port. The service provides 2 views, a vessel centric and a port centric. The Vessel centric view returns predictions for the next port call for a vessel and the port centric provides predictions for which vessels are having the requested ports as their next port. Both view delivers ETA and predictability.
The Next Port service have the following endpoints:
Provides predictions for the next port call for a Vessel
import json
import requests
request_data = {"user_id": "username", "password": "passWORD1234##"}
data_json = json.dumps(request_data)
response_auth = requests.post(
"https://api-demo.oceanio.com/authentication/login",
headers={
"content-type": "application/json",
"X-Api-Key": "LVQEGHrM0P5CceeUbGWSO5gX0kZlOG877Kr.....",
},
data=data_json,
)
result = json.loads(response_auth.content)
response = requests.get(
"https://api-demo.oceanio.com/nextport/vessel/9755933/predictions",
headers={
"content-type": "application/json",
"X-Api-Key": "LVQEGHrM0P5CceeUbGWSO5gX0kZlOG877Kr.....",
"Authorization": f"Bearer {result.get('token')}",
},
)
print(json.loads(response.content))
{
"predictions": [
{
"un_location_code": "USLAX",
"eta_datetime": "2022-03-24T12:54:20.446+00:00",
"probability": 0.82,
"vessel_imo_number": 9461477
},
{
"un_location_code": "USSEA",
"eta_datetime": "2022-03-27T10:23:23.334+00:00",
"probability": 0.16,
"vessel_imo_number": 9461477
}
]
}
Provides predictions for which vessels are having the requested port as their next port call.
import json
import requests
request_data = {"user_id": "username", "password": "passWORD1234##"}
data_json = json.dumps(request_data)
response_auth = requests.post(
"https://api-demo.oceanio.com/authentication/login",
headers={
"content-type": "application/json",
"X-Api-Key": "LVQEGHrM0P5CceeUbGWSO5gX0kZlOG877Kr.....",
},
data=data_json,
)
result = json.loads(response_auth.content)
response = requests.get(
"https://api-demo.oceanio.com/nextport/port/USLAX/predictions",
headers={
"content-type": "application/json",
"X-Api-Key": "LVQEGHrM0P5CceeUbGWSO5gX0kZlOG877Kr.....",
"Authorization": f"Bearer {result.get('token')}",
},
)
print(json.loads(response.content))
{
"predictions": [
{
"un_location_code": "DEHAM",
"eta_datetime": "2023-05-12T17:26:47.906721+00:00",
"probability": 0.017,
"vessel_imo_number": 1458176
},
{
"un_location_code": "DEHAM",
"eta_datetime": "2023-05-08T04:11:37.857758+00:00",
"probability": 0.049,
"vessel_imo_number": 1803990
},
{
"un_location_code": "DEHAM",
"eta_datetime": "2023-05-10T02:02:29.135419+00:00",
"probability": 0.099,
"vessel_imo_number": 2325024
},
{
"un_location_code": "DEHAM",
"eta_datetime": "2023-05-08T12:22:04.736495+00:00",
"probability": 0.16,
"vessel_imo_number": 5011070
}
]
}
FAQ:
Q: Which Vessels are supported in the Next Port service?
A: All vessels with an IMO