Port Dynamics API Docs
arrivals
list
arrivals by port
# Authentication
Scheme: Token
# using python
import requests
params
portname [string]: UN port code
** required
ship_types [string]: types of vessels to include
default: all
mindwt [integer]: minimum dwt to filter
default:10000
maxdwt [integer]: maximum dwt to filter
default: 300000
page_size [integer]: number of records per page
default: 40
page [integer]: page number to return
default=1
example api request
result = requests.get(
'https://port-dynamics.com/api/v1/arrivals/?page=2&portname=CA HAL&ship_types=bulk_carrier,general_cargo_ship',
headers={'Authorization': 'Token {}'.format(your token)}
)
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
page | A page number within the paginated result set. |
page_size | Number of results to return per page. |
portname required |
departures
list
departures by port
# Authentication
Scheme: Token
# using python
import requests
params
portname [string]: UN port code
** required
ship_types [string]: types of vessels to include
default: all
mindwt [integer]: minimum dwt to filter
default:10000
maxdwt [integer]: maximum dwt to filter
default: 300000
page_size [integer]: number of records per page
default: 40
page [integer]: page number to return
default=1
example api request
result = requests.get(
'https://port-dynamics.com/api/v1/departures/?page=2&portname=BR PNG&ship_types=bulk_carrier,general_cargo_ship',
headers={'Authorization': 'Token {}'.format(your token)}
)
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
page | A page number within the paginated result set. |
page_size | Number of results to return per page. |
portname required |
destinations
poi > list
Returns a dictionary that maps points of interest (poi) to the relevant port for routing and other purposes
# Authentication
Scheme: Token
# using python
import requests
result = requests.get('https://port-dynamics.com/api/v1/destinations/poi/',
headers={'Authorization': 'Token {}'.format(your token)})
result.json()
fields
poi point of interest
port_id Nisomar reference number for port
port_name
UN_code UNLCODE
facilities
statistics > list
statistics for each facility
# Authentication
Scheme: Token
params:
facilitynd: unqiue id for each facility
(contact for a full list of id's)
# using python
import requests
result = requests.get(
'https://port-dynamics.com/api/v1/facilities/statistics/?facilitynd=21836',
headers={'Authorization': 'Token {}'.format(your token)})
result.json()
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
facilitynd required |
openships
list
list of vessels that can make a lacan
# Authentication
Scheme: Token
# using python
import requests
result = requests.get(
'https://port-dynamics.com/api/v1/openships/?portname=haypoint&mindwt=20000&maxdwt=40000&startdate=2020-09-25&enddate=2020-10-30',
headers={'Authorization': 'Token {}'.format(your token)})
result.json()
params:
portname [string]: UN port code ** required
mindwt [integer]: minimum dwt ** required
maxdwt [integer]: maximum dwt ** required
startdate [%Y-%m-%d]: start date of the lacan ** required
enddate [%Y-%m-%d]: end date of the lacan ** required
shiptype [string]: type of vessel
default: bulk_carrier
options:
bulk_carrier
container_ship
gas_tanker
general_cargo_ship
oil_and_chemical_tanker
maxballastleg [integer]: maximum distance a vessel can travel in ballast
excludeloaded [boolean]: option to exclude laden vessels
default: False
maxvessels [integer]: no of vessels to include in the report
default: 10
exclude_non_discharging_loaded [boolean]: exclude laden vessels that are not yet discharging
heading to a load port
default: False
include_all_regions [boolean]: regions that typically source vessels for ballasting to target region
default=True
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
portname required | |
startdate required | |
enddate required | |
mindwt required | |
maxdwt required |
tonnage > report > list
tonnage report by region and dwt
# Authentication
Scheme: Token
# using python
import requests
result = requests.get(
'https://port-dynamics.com/api/v1/openships/tonnage/report/?region=W.AUS',
headers={'Authorization': 'Token {}'.format(your token)})
result.json()
params
region * required : short code for region example (W.Aus for west australia)
region must be capitalized before sending the request
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
region required |
ports
congestion > facility > list
returns congestion status for facilities in a port together with historical waiting time and current activity
# Authentication
Scheme: Token
# using python
import requests
result = requests.get('https://port-dynamics.com/api/v1/ports/congestion/facility/?portcode=BR PNG
headers={'Authorization': 'Token {}'.format(your token)})
result.json()
response: json
params
portcode: ** required
UNCODE for a port, eg NL RTM
verbose: ** optional
if true, congestion label will include description
fields
facility_name
congestion
NORMAL no congestion observed in last two weeks for nominated vessel category
PARTLY CONGESTED recent turnaround times are 20% greater than average
CONGESTED recent turnaround times are 40% greater than average
HEAVILY CONGESTED recent turnaround times are 80% greater than average
INACTIVE no port activity in the last two weeks
relative_congestion
ratio of turnaround_hrs_recent to turnaround_hrs_avg
turnaround_hrs_recent
average turnaround time including anchoring but excluding outliers
for vessels that departed in the last 2 weeks
turnaround_avg
average turnaround time including anchoring but excluding outliers
for vessels that departed in the last 52 weeks
example response for unladen dry bulk, 50-70,000dwt calling at paranagua (BR PNG)
[
{"facility_name": "",
"congestion": "NORMAL",
"relative_congestion": 0.7062945553335718,
"turnaround_hrs_recent": 154.51623923611126,
"turnaround_hrs_avg": 299.6344298421985,
},
{"facility_name": "",
"congestion": "NORMAL",
"relative_congestion": 0.7062945553335718,
"turnaround_hrs_recent": 154.51623923611126,
"turnaround_hrs_avg": 299.6344298421985,
},
...
]
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
imo required | |
portname required | |
shipgroup required | |
shipstatus required |
details > list
returns port and facility information for a given port
facilities are only returned if
the port has been validated and activity is above 12
activity: sum of load and discharge
json status tells you if the port has been validated
# Authentication
Scheme: Token
# using python
import requests
result = requests.get('https://port-dynamics.com/api/v1/ports/details/?portname=BR SSZ',
headers={'Authorization': 'Token {}'.format(your token)})
result.json()
response: json
params
uncode [string] ** required: un code for the port, eg NL RTM or NLRTM
shiptypes (optional): limit facilities by the ship type of visitors
options: bulk_carrier, general_cargo_ship, oil_and_chemical_tanker,
gas_tanker, other_tanker, containter_ship
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
portname required |
status > list
returns current vessels heading to, anchored off and in facilities of a port
# Authentication
Scheme: Token
# using python
import requests
result = requests.get('https://port-dynamics.com/api/v1/ports/status/?portcode=NL RTM',
headers={'Authorization': 'Token {}'.format(your token)})
result.json()
params
portcode: ** required
UNCODE for a port, eg NL RTM
mindwt: ** optional
minimum dwt of vessels to use for stats
maxdwt: ** optional
maximum dwt of vessels to use for stats
shiptype: ** optional
options:
bulk_carrier, general_cargo_ship, container_ship,
oil_and_chemical_tanker, gas_tanker, other_tanker
default: bulk_carrier
shipstatus: ** optional
options:
0 (unladen), 1 (laden), -1 (wet and dry bulk vessels)
default: -1
note: container ships are handled differently, 0 (feeder), 1 (mother)
commodity: ** optional NOT YET IMPLEMENTED
options:
grains, ore, coal, general, crude, product
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
portname required |
portvisits
history > list
Returns port calls for a vessel within a time period
# Authentication
Scheme: Token
params
imo [int]: imo for a vessel required
datefrom [string]: required
dateto [string]: required
example api request
result = requests.get(
'https://port-dynamics.com/api/v1/portvisits/history/?imo=123456&datefrom=2022-01-01&dateto=2022-08-28',
headers={'Authorization': 'Token {}'.format(your token)}
)
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
imo required | |
datefrom required | |
dateto required |
recent > list
Returns recent port calls for a vessel
# Authentication
Scheme: Token
params
imo [int]: imo for a vessel
n_calls [integer]: no of port calls to return
default: 10 port calls
example api request
result = requests.get(
'https://port-dynamics.com/api/v1/portvisits/recent/?imo=123456&n_calls=20',
headers={'Authorization': 'Token {}'.format(your token)}
)
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
imo required |
routes
details > list
Returns distance in nautical miles between two ports or two coordinates including areas_visited, load_line_zones, eca_distance, eca_zones and a list of route points
# Authentication
Scheme: Token
# using python
import requests
result = requests.get('https://port-dynamics.com/api/v1/routes/details/?fromport=NL RTM&toport=BR PNG',
headers={'Authorization': 'Token {}'.format(your token)})
result.json()
params
startdate [string]: journey start date
default: current date
speed [int]: optional speed for calculation of eta
fromport [string]: origin port (UN Code)
toport [string]: destination port (UN Code)
endpoint [options]: approaches (default), inport only used for port distances
fromname [string]: origin port (free text)
toname[string]: destination port (free text)
lat0 [float]: start latitude
lng0 [float]: start longitude
lat1 [float]: end latitude
lng1 [float]: end longitude
panamapenalty [float]: minimum advantage in nm saved for using canal as
opposed to travelling around South America.
default is 750nm
excludeareas [string]: comma separated string of areas to exclude
default excluded areas: 'piracy,torres strait,corinth canal'
other options include: 'suez canal,panama canal,sundra strait,
kiel canal,pentland firth,bering sea'
required parms
fromport [string] UN locode
or fromname [string] freetext
or lat0 [float], lng0 [float]
toport [string] UN locode
or toname [string] freetext
or lat1 [float], lng1 [float]
ships
details > list
return basic vessel details for a given imo
# Authentication
Scheme: Token
# params
imo [string]: vessel identification number (optional)
# using python
import requests
result = requests.get('https://port-dynamics.com/api/v1/ships/details/',
params={'imo': 9947081},
headers={'Authorization': 'Token {}'.format(your token)}
)
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
imo |
eta > list
returns eta to its next port or provided destination port
# Authentication
Scheme: Token
# using python
import requests
params
imo [int]: ** required
portcode [string]: UN code for a port
default : decoded from destination in ais message
speed [integer]: speed to be used for eta calculation
default: typical voyage speed as per nisomar
example api request
result = requests.get(
'https://port-dynamics.com/api/v1/ships/eta/?imo=1234',
headers={'Authorization': 'Token {}'.format(your token)}
)
note: eta's are reported in eta_timezone, ie local to destination
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
imo required | |
portname | |
speed |
information > list
returns current information about a vessel from its details, location, eta, zones etc
# Authentication
Scheme: Token
# using python
import requests
result = requests.get('https://port-dynamics.com/api/v1/ships/information/?imo=123456',
headers={'Authorization': 'Token {}'.format(your token)})
result.json()
params
imo [integer]: vessel identification ** required
note: eta's are reported in eta_timezone, ie local to destination
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
imo required |
location > list
returns current information about a vessel from its location, eta, zones etc
# Authentication
Scheme: Token
# using python
import requests
result = requests.get('https://port-dynamics.com/api/v1/ships/location/?imo=123456',
headers={'Authorization': 'Token {}'.format(your token)})
result.json()
params
imo [integer]: vessel identification ** required
note: eta's are reported in eta_timezone, ie local to destination
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
imo required |
marinegrowth > list
returns list of long stops (ie over a set duration) and identifies loadline zones for a vessel since the last identified dry dock visit
# Authentication
Scheme: Token
# using python
import requests
result = requests.get('https://port-dynamics.com/api/v1/ships/marinegrowth/?imo=123456&duration_days=10',
headers={'Authorization': 'Token {}'.format(your token)})
result.json()
params
imo [integer]: vessel identification ** required
duration_days [integer]: valid duration to be considered a long stop
min: 10 days
default: 10 days
period_mths [integer]: how many months data to be used
default: 6
fields
n_long_stops
number of observed stops in period_mths that have exceeded duration_days
note: brief (<3 hours) periods of movement do not interrupt the stop
in this determination
safe_steaming
DEPRECATED
last_shipyard_name
last shipyard with drydock facilities that was visited for extended
(>5 day) period
note: -1 indicates that data is unavailable
last_shipyard_exit
datetime when vessel left shipyard
note: '1980-01-01' indicates that data is unavailable
last_shipyard_duration
hours spent in shipyard
last_drydock_name
last confirmed visit to a drydock
last_drydock_exit
datetime when vessel left drydock
last_drydock_duration
hours spent in dry dock
long_stops list of long stops ending in the last period_mths
enter_timestamp
exit_timestamp
stop_days
lat
lng
port_name includes nearest port if stop is outside customary anchorage
loadline_zone winter, summer or tropical
example
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
imo required |
search > list
return vessel details for a given imo
# Authentication
Scheme: Token
# params
name [string]: 'search string'
n_vessels [integer]: no of vessels to return
default: 10
max: 100
ship_type [string]: comma separated ship types
example: 'bulk_carrier, general_cargo_ship'
default: 'bulk_carrier, general_cargo_ship'
options:
bulk_carrier
general_cargo_ship
oil_and_chemical_tanker
gas_tanker
container_ship
mindwt [integer]: smallest dwt of interest
default: 5000
maxdwt [integer]: largest dwt of interest
# using python
import requests
result = requests.get('https://port-dynamics.com/api/v1/ships/search/',
parms={'name':'union','n_vessels':50},
headers={'Authorization': 'Token {}'.format(your token)}
)
result.json()
response: json
{
"imo": vessel identity,
"ship_name": vessel name,
"dwt": -1,
"ship_type": "bulk_carrier",
"top_speed": 0,
}
stops > long > list
returns list of long stops (ie over a set duration) and identifies loadline zones for a vessel
# Authentication
Scheme: Token
# using python
import requests
result = requests.get('https://port-dynamics.com/api/v1/ships/stops/long/?imo=123456',
headers={'Authorization': 'Token {}'.format(your token)})
result.json()
params
imo [integer]: vessel identification ** required
duration_days [integer]: valid duration to be considered a long stop
min: 10 days
default: 10 days
period_mths [integer]: how many months data to be used
default: 6
fields
enter_timestamp
exit_timestamp
stop_days
lat
lng
port_name includes nearest port if stop is outside customary anchorage
loadline_zone winter, summer or tropical based on standard classification
example
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
imo required |
voyages
forecast > list
returns voyage forecast based on a given vessel, origin, destination etc
# Authentication
Scheme: Token
# using python
import requests
result = requests.get('https://port-dynamics.com/api/v1/voyages/forecast/?imo=123456&from=NL RTM&to=BR PNG
headers={'Authorization': 'Token {}'.format(your token)})
result.json()
response: json
params
imo: ** required
from: ** required
"current position" or port_name:UNCODE for a port, eg Rottderdam:NL RTM
to: ** required
port_name:UNCODE for a port, eg Paranagua:BR PNG
speed: selected speed type
options:
typ - vessel's typical speed (default)
top - vessel's top speed
spec - user specified speed
specifiedspeed [float]: expected speed in kn (only used in option=2)
fuelconsumption: selected fuel consumption type
options:
typ - typical consumption for speed / dwt / ship_type / cargo (default)
spec - user specified consumption
specifiedconsumption [float]: expected fuel consumption in t/d (only used in option 1)
fueltype: type of fuel used
options:
HSFO
MGO
VLSFO
"" unspecified
fuelprice: selected fuel price type
options:
onroute - lowest market price on route
typ - typical market price (default)
spec - user specified price
specifiedprice [float]: expected fuel price in US$/t (only used in option 2)
deviation [int]: distance in nm that a vessel will travel to refuel (default=150)
start_date: YYYY-MM-DD
start_time: HH:MM:SS
start_zone: timezone from list (eg UTC, Europe/London etc)
excludeareas [string]: comma separated string of areas to exclude
default excluded areas: 'piracy,torres strait,corinth canal'
other options include: 'suez canal,panama canal,sundra strait,
kiel canal,pentland firth,bering sea'
fields
from
full port name and UN_code
to
full port name and UN_code
voyage
label combining from and to
current_position:
lat
lng
timeReceived
speed
heading
draft
cargo
cargo_status
ship_details:
ship_name
ship_type
dwt
departure_date
ais_eta_local
forecast_speed
forecast_eta_local
forecast_etb_local
forecast_consumption
fuel_price
forecast_cost
route
distance_nm
areas_visited [list]
load_line_zones [list]
eca_dist_nm
eca_zones [list]
route_points [list {lat,lng}]
track [list {lat,lng,timeReceived,speed}]
agent
agent
company
email
mobile
pic
destination_info
approaches [list {lat, lng}]
facilities [list {facility, polygon [list {lat, lng}], colour}]
congestion
congestion_score
anchor_risk
anchor_hrs_min
anchor_hrs_max
facility_hrs
bunker locations [list {lat,lng,label}]
example response
{
}