Search Open menu

Routing API beta 

The Spire Routing API generates origin port to destination port or lat/lng point to port route and ETA predictions for specific vessel types.

 

API Endpoint

https://api.spire.com/graphql

The routing root query

The Routing API query is able to provide port to port or point to port routing solution which includes the calculated distance, ETA/duration and route between the two or more points. It can be called for one vessel at a time.

 

Example query

{
  routing(
    origin: { unlocode: "USNYC" }
    destination: { unlocode: "IRABD" }
    vessel: { imo: 9215696 }
  ) {
    journey {
      ...
    }
  }
}

Query arguments

In order to get a routing response, the required parameters are: origin, destination and vessel.

All arguments for the routing query:

predictedVesselRoute(
  canals: [WaterwayCanal!] = []
  destination: [RouteDestinationInput!]!
  departureTime: DateTime
  origin: RouteOriginInput!
  piracy: Boolean = false
  minimizeSeca: Boolean = false
  iceAreas: Boolean = false
  speed: Float
  vessel: RouteVesselInput!
  continuousCoordinates: Boolean = false
): RoutingResponse

vessel

Required for obtaining the predictedVesselRoute.

Specify mmsi, imo or both. At least one is required.

predictedVesselRoute(
  vessel: {
    imo: 9215696
  }
  ...
)

origin

The required origin may be specified by either UNLOCODE, or latitude and longitude.

Coordinates example:

predictedVesselRoute(
  origin: {
    coordinates: {
      latitude: 48.2133
      longitude: -123.2343
    }
  }
  ...
)

UNLOCODE example:
When using UNLOCODEs the center point for those ports or locations will be used. The center point will not always correspond to desired location for the specified vessel and it is recommended to use coordinates to specify the specific desired location e.g. a terminal for the vessel.

predictedVesselRoute(
  origin {
    unlocode: "USNYC"
  }
  ...
)

destination

The required destination may be specified by either UNLOCODE, or latitude and longitude.
Up to 19 destinations can be specified.

Coordinates example:

predictedVesselRoute(
  destinatino: {
    coordinates: {
      latitude: 48.2133
      longitude: -123.2343
    }
  }
  ...
)

UNLOCODE example:
When using UNLOCODEs the center point for those ports or locations will be used. The center point will not always correspond to desired location for the specified vessel and it is recommended to use coordinates to specify the specific desired location e.g. a terminal for the vessel.

predictedVesselRoute(
  destination {
    unlocode: "USNYC"
  }
  ...
)

speed

Optional average speed in knots which should be used for ETA calculation.

If not specified the speed is determined by known speed for the vessel

predictedVesselRoute(
  speed: 21.6
  ...
)

canals

Specifying this optional parameter will allow the routing algorithm to include the canals chosen in the route calculation. Note that this still depends on the selected vessel whether the canal can be passed or not. For example a vessel too large for the Panama Canal will not be routed through the canal, even if the paramater was set – only plausible routes are returned.

The canal values are enums, and therefore not quoted in the query.

Available canals: KIEL, PANAMA, SUEZ

Example including both PANAMA and SUEZ:

predictedVesselRoute(
  canals: [PANAMA, SUEZ]
  ...
)

piracy

Optionally set to flag to allow the route to go through Piracy Zones.

If true, predictedVesselRoute will include Piracy Zones.

If not set, the default is false.

predictedVesselRoute(
  piracy: true
)

minimize SECA

Optionally set to flag to minimize the distance of the route to go through SECA areas.

If true, routing will minimize the distance through SECA areas.

If not set, the default is false.

routing(
  minimizeEca: false
)

Ice Areas

Optionally set flag to allow or avoid routes passing through ice areas.

If true, routing will allow routes through ice areas.

If not set, the default is false.

routing(
  iceAreas: false
)

departureTime

Optionally, the departure date time can be set to calculate the ETA for future or past voyages.

The departure date and time is used to calculate the ETA for the voyage.

routing(
  departureTime: "2024-10-22T1100:00.000Z"
)

continuousCoordinates

Optionally set flag to select the way coordinates are handled when a route crosses the anti-meridian or international dateline.

If true, routing will return waypoints that continue past 180° to provide a single LINESTRING that can be visualised without artefacts.
When it is set to false, a MULTILINESTRING will be returned with the segments leading up to the anti-meridian and a segment past it.

routing(
  continuousCoordinates: false
)

Output

Example query and output specification (note, GraphQL fragments are used below):

query {
  routing(
    origin: {unlocode: "USNYC"}
    destination: {unlocode: "NLRTM"}
    vessel: {imo: 9215696}
  ) {
    journey {
      distance
      eta
      seca
      piracy

      origin {
        ... on Port {
          unlocode
          name
          centerPoint {
            longitude
            latitude
          }
        }
        ... on GeoPoint {
          longitude
          latitude
        }
      }

      destination {
        ... on Port {
          unlocode
          name
          centerPoint {
            longitude
            latitude
          }
        }
        ... on GeoPoint {
          longitude
          latitude
        }
      }

      duration {
        seconds
        iso
        text
      }

      waypoints {
        wkt
        geoJson
      }
    }
  }
}

RoutingResponse

The response contains two main objects: itinerary and journey

itinerary

This object contains one subobject: SeaRoute!

duration
type TimeDuration {
  iso: String!
  seconds: Float!
  text: String!
}
port
type Port {
  centerPoint: GeoPoint
  name: String!
  unlocode: UNLOCODE!
}
centerPoint
type GeoPoint {
  latitude: Float!
  longitude: Float!
}
journey
type SeaRoute {
  destination: RouteDestination!
  distance: Float!
  duration: TimeDuration!
  eta: DateTime!
  origin: RouteOrigin!
  seca: Float!
  waypoints: RouteWaypoints!
}
RouteWaypoints!

Provides waypoints in WKT or GeoJSONLinestring

type Waypoints {
  geoJson: JSONObject
  wkt: WKT!
}

Examples

Port-to-port route

Request

query {
	routing(
		vessel: { imo: 9321483 }
		origin: { unlocode: USHOU }
		destination: { unlocode: GIGIB }
	) {
		journey {
			destination {
				... on Port {
					unlocode
					name
				}
				... on GeoPoint {
					latitude
					longitude
				}
			}
			distance
			duration {
				iso
				seconds
			}
			eta
			waypoints {
				geoJson
			}
		}
	}
}

Response

{
	"data": {
		"routing": {
			"journey": {
				"destination": {
					"unlocode": "GIGIB",
					"name": "Gibraltar"
				},
				"distance": 4835.5,
				"duration": {
					"iso": "P1W6DT12H31M33S",
					"seconds": 1168293.0
				},
				"eta": "2024-11-05T00:35:01.465Z",
				"waypoints": {
					"geoJson": {
						"coordinates": [
							[
								[
									-95.34999847,
									29.75
								],
								[
									-95.28429572,
									29.74427836
								],
								[
									-95.27998905,
									29.73962495
								],
								[
									-95.27453392,
									29.72674383
								],
								[
									-95.26840887,
									29.72416741
								],
								[
									-95.25807285,
									29.72707627
								],
								[
									-95.25300054,
									29.72574652
								],
								[
									-95.24878957,
									29.7214247
								],
								[
									-95.24220245,
									29.71871361
								],
								[
									-95.23807073,
									29.7208429
								],
								[
									-95.23051012,
									29.7248323
								],
								[
									-95.22409796,
									29.72549718
								],
								[
									-95.21739868,
									29.7240843
								],
								[
									-95.20964667,
									29.7273256
								],
								[
									-95.20419154,
									29.73721506
								],
								[
									-95.19012307,
									29.74527549
								],
								[
									-95.16878109,
									29.74710354
								],
								[
									-95.15232002,
									29.73613474
								],
								[
									-95.1299253,
									29.73405718
								],
								[
									-95.11419041,
									29.73926723
								],
								[
									-95.10226469,
									29.74673539
								],
								[
									-95.09387447,
									29.7538823
								],
								[
									-95.0875072,
									29.76268541
								],
								[
									-95.08332804,
									29.76306583
								],
								[
									-95.07912942,
									29.76238177
								],
								[
									-95.0735183,
									29.76076004
								],
								[
									-95.06859574,
									29.75586865
								],
								[
									-95.06436174,
									29.74770758
								],
								[
									-95.05950354,
									29.74073297
								],
								[
									-95.05402115,
									29.7349448
								],
								[
									-95.04442509,
									29.73144639
								],
								[
									-95.03071536,
									29.73023775
								],
								[
									-95.0228736,
									29.72352136
								],
								[
									-95.02089982,
									29.71129722
								],
								[
									-95.01488546,
									29.70357341
								],
								[
									-95.00483051,
									29.70034992
								],
								[
									-94.99530392,
									29.69513233
								],
								[
									-94.98630569,
									29.68792064
								],
								[
									-94.97568814,
									29.66676356
								],
								[
									-94.96345128,
									29.63166109
								],
								[
									-94.94287464,
									29.59500739
								],
								[
									-94.91395821,
									29.55680246
								],
								[
									-94.897475,
									29.53525
								],
								[
									-94.893425,
									29.53035
								],
								[
									-94.88170576,
									29.51367475
								],
								[
									-94.86231728,
									29.48522425
								],
								[
									-94.83774714,
									29.44368221
								],
								[
									-94.80799534,
									29.38904862
								],
								[
									-94.78756668,
									29.35774539
								],
								[
									-94.77646114,
									29.3497725
								],
								[
									-94.75806607,
									29.34604047
								],
								[
									-94.73238146,
									29.3465493
								],
								[
									-94.69442413,
									29.33541581
								],
								[
									-94.64419409,
									29.31263998
								],
								[
									-94.57816213,
									29.26333151
								],
								[
									-94.49632827,
									29.18749039
								],
								[
									-94.4449816,
									29.14800007
								],
								[
									-94.42412214,
									29.14486055
								],
								[
									-94.39465139,
									29.14304811
								],
								[
									-94.35656937,
									29.14256275
								],
								[
									-94.0442294,
									29.03152778
								],
								[
									-93.45763148,
									28.8099432
								],
								[
									-92.8735348,
									28.58585048
								],
								[
									-92.29193935,
									28.35924962
								],
								[
									-91.71283115,
									28.13020854
								],
								[
									-91.13621019,
									27.89872723
								],
								[
									-90.56205843,
									27.66487327
								],
								[
									-89.99037587,
									27.42864666
								],
								[
									-89.42114062,
									27.19011454
								],
								[
									-88.85435268,
									26.94927692
								],
								[
									-88.28998658,
									26.70620045
								],
								[
									-87.72804232,
									26.46088513
								],
								[
									-87.16849107,
									26.21339705
								],
								[
									-86.61133282,
									25.96373621
								],
								[
									-86.05653561,
									25.71196809
								],
								[
									-85.50409943,
									25.45809268
								],
								[
									-84.95398939,
									25.2021748
								],
								[
									-84.4062055,
									24.94421444
								],
								[
									-83.86071017,
									24.6842757
								],
								[
									-83.31750339,
									24.42235857
								],
								[
									-82.69042654,
									24.28140192
								],
								[
									-81.97947962,
									24.26140576
								],
								[
									-81.53794299,
									24.2465459
								],
								[
									-81.36581664,
									24.23682233
								],
								[
									-81.2237651,
									24.23779541
								],
								[
									-81.11178837,
									24.24946514
								],
								[
									-80.99767531,
									24.27842725
								],
								[
									-80.88142592,
									24.32468174
								],
								[
									-80.73076897,
									24.38334759
								],
								[
									-80.54570445,
									24.45442479
								],
								[
									-80.43947959,
									24.5019655
								],
								[
									-80.41209438,
									24.52596973
								],
								[
									-80.38469869,
									24.54996901
								],
								[
									-80.35729253,
									24.57396334
								],
								[
									-80.32987586,
									24.59795271
								],
								[
									-80.30244868,
									24.62193711
								],
								[
									-80.27501098,
									24.64591654
								],
								[
									-80.24756274,
									24.66989099
								],
								[
									-80.22010395,
									24.69386044
								],
								[
									-80.19263459,
									24.7178249
								],
								[
									-80.16515465,
									24.74178436
								],
								[
									-80.13766413,
									24.7657388
								],
								[
									-80.11016299,
									24.78968823
								],
								[
									-80.08265124,
									24.81363262
								],
								[
									-80.05512886,
									24.83757199
								],
								[
									-80.02759583,
									24.86150631
								],
								[
									-80.00005213,
									24.88543558
								],
								[
									-79.97249777,
									24.9093598
								],
								[
									-79.94493272,
									24.93327895
								],
								[
									-79.91735697,
									24.95719304
								],
								[
									-79.90023651,
									24.98845518
								],
								[
									-79.89357134,
									25.02706539
								],
								[
									-79.88690198,
									25.0656753
								],
								[
									-79.88022841,
									25.10428492
								],
								[
									-79.87355062,
									25.14289424
								],
								[
									-79.86686861,
									25.18150325
								],
								[
									-79.86018236,
									25.22011197
								],
								[
									-79.85349187,
									25.25872038
								],
								[
									-79.84679712,
									25.2973285
								],
								[
									-79.84009811,
									25.33593631
								],
								[
									-79.83339481,
									25.37454382
								],
								[
									-79.82668724,
									25.41315102
								],
								[
									-79.81997537,
									25.45175792
								],
								[
									-79.81325919,
									25.49036451
								],
								[
									-79.80653869,
									25.5289708
								],
								[
									-79.79981387,
									25.56757678
								],
								[
									-79.79308471,
									25.60618246
								],
								[
									-79.78635121,
									25.64478782
								],
								[
									-79.77961334,
									25.68339288
								],
								[
									-79.77287111,
									25.72199763
								],
								[
									-79.76669669,
									25.74751428
								],
								[
									-79.76109007,
									25.75994285
								],
								[
									-79.75548227,
									25.77237119
								],
								[
									-79.7498733,
									25.78479933
								],
								[
									-79.74426316,
									25.79722725
								],
								[
									-79.73865183,
									25.80965495
								],
								[
									-79.73303933,
									25.82208244
								],
								[
									-79.72742566,
									25.83450971
								],
								[
									-79.7218108,
									25.84693677
								],
								[
									-79.71619476,
									25.85936361
								],
								[
									-79.71057754,
									25.87179023
								],
								[
									-79.70495914,
									25.88421664
								],
								[
									-79.69933956,
									25.89664283
								],
								[
									-79.69371879,
									25.90906881
								],
								[
									-79.68809684,
									25.92149456
								],
								[
									-79.68247371,
									25.93392011
								],
								[
									-79.67684939,
									25.94634543
								],
								[
									-79.67122388,
									25.95877054
								],
								[
									-79.66559718,
									25.97119543
								],
								[
									-79.65996929,
									25.9836201
								],
								[
									-79.65074988,
									26.00000863
								],
								[
									-79.63793893,
									26.02036102
								],
								[
									-79.62512354,
									26.04071229
								],
								[
									-79.6123037,
									26.06106242
								],
								[
									-79.59947941,
									26.08141142
								],
								[
									-79.58665066,
									26.10175929
								],
								[
									-79.57381744,
									26.12210602
								],
								[
									-79.56097975,
									26.14245161
								],
								[
									-79.54813759,
									26.16279607
								],
								[
									-79.53529094,
									26.18313938
								],
								[
									-79.52243981,
									26.20348156
								],
								[
									-79.50958419,
									26.22382259
								],
								[
									-79.49672407,
									26.24416248
								],
								[
									-79.48385945,
									26.26450122
								],
								[
									-79.47099032,
									26.28483882
								],
								[
									-79.45811668,
									26.30517527
								],
								[
									-79.44523851,
									26.32551057
								],
								[
									-79.43235583,
									26.34584472
								],
								[
									-79.41946862,
									26.36617771
								],
								[
									-79.40657687,
									26.38650956
								],
								[
									-79.39202325,
									26.53338161
								],
								[
									-79.37580775,
									26.80679387
								],
								[
									-79.33659684,
									26.96428988
								],
								[
									-79.27439051,
									27.00586964
								],
								[
									-79.21213812,
									27.04742202
								],
								[
									-79.14983967,
									27.08894702
								],
								[
									-79.08749499,
									27.1304445
								],
								[
									-79.02510408,
									27.17191447
								],
								[
									-78.96266676,
									27.21335678
								],
								[
									-78.90018304,
									27.25477143
								],
								[
									-78.83765274,
									27.29615829
								],
								[
									-78.77507586,
									27.33751735
								],
								[
									-78.71245224,
									27.37884847
								],
								[
									-78.64978186,
									27.42015166
								],
								[
									-78.58706457,
									27.46142677
								],
								[
									-78.52430035,
									27.5026738
								],
								[
									-78.46148904,
									27.54389262
								],
								[
									-78.39863064,
									27.58508321
								],
								[
									-78.33572498,
									27.62624545
								],
								[
									-78.27277205,
									27.66737932
								],
								[
									-78.20977169,
									27.70848469
								],
								[
									-78.1467239,
									27.74956156
								],
								[
									-77.7810614,
									27.85878783
								],
								[
									-77.11278421,
									28.0361635
								],
								[
									-76.44232916,
									28.21027755
								],
								[
									-75.76969624,
									28.38112997
								],
								[
									-75.09492406,
									28.54865254
								],
								[
									-74.41801264,
									28.71284523
								],
								[
									-73.73900663,
									28.8736412
								],
								[
									-73.05790603,
									29.03104044
								],
								[
									-72.37476164,
									29.18497764
								],
								[
									-71.68957344,
									29.33545279
								],
								[
									-71.0023984,
									29.48240231
								],
								[
									-70.3132365,
									29.62582619
								],
								[
									-69.62215084,
									29.76566277
								],
								[
									-68.92914143,
									29.90191204
								],
								[
									-68.23427749,
									30.03451442
								],
								[
									-67.53755902,
									30.16346991
								],
								[
									-66.8390613,
									30.28872121
								],
								[
									-66.13878435,
									30.41026833
								],
								[
									-65.43680941,
									30.52805641
								],
								[
									-64.73313647,
									30.64208547
								],
								[
									-63.509091,
									30.95346407
								],
								[
									-61.76467299,
									31.4621922
								],
								[
									-60.00184092,
									31.94666261
								],
								[
									-58.22059479,
									32.4068753
								],
								[
									-56.42188457,
									32.84143883
								],
								[
									-54.60571026,
									33.2503532
								],
								[
									-52.77340393,
									33.6323109
								],
								[
									-50.92496558,
									33.98731192
								],
								[
									-49.06211181,
									34.3141627
								],
								[
									-47.18484261,
									34.61286322
								],
								[
									-45.29524463,
									34.88236433
								],
								[
									-43.39331788,
									35.12266603
								],
								[
									-41.4814858,
									35.33289286
								],
								[
									-39.5597484,
									35.5130448
								],
								[
									-37.63081359,
									35.66244633
								],
								[
									-35.69468137,
									35.78109744
								],
								[
									-33.75427424,
									35.86854391
								],
								[
									-31.80959221,
									35.92478574
								],
								[
									-29.8636884,
									35.949605
								],
								[
									-27.9165628,
									35.94300167
								],
								[
									-26.49452735,
									35.9695638
								],
								[
									-25.59758206,
									36.02929139
								],
								[
									-24.69942647,
									36.08231883
								],
								[
									-23.80006059,
									36.12864611
								],
								[
									-22.89978592,
									36.16823459
								],
								[
									-21.99860247,
									36.20108425
								],
								[
									-21.09681781,
									36.22716754
								],
								[
									-20.19443195,
									36.24648446
								],
								[
									-19.29175648,
									36.25901873
								],
								[
									-18.38879141,
									36.26477036
								],
								[
									-17.48585029,
									36.2637345
								],
								[
									-16.58293311,
									36.25591114
								],
								[
									-15.68035329,
									36.24130688
								],
								[
									-14.7781108,
									36.21992173
								],
								[
									-13.87651679,
									36.19177369
								],
								[
									-12.97557124,
									36.15686275
								],
								[
									-12.07558093,
									36.11521819
								],
								[
									-11.17654586,
									36.06684002
								],
								[
									-10.27876646,
									36.01176854
								],
								[
									-9.38224273,
									35.95000377
								],
								[
									-8.86782285,
									35.91919875
								],
								[
									-8.73550683,
									35.91935347
								],
								[
									-8.60319077,
									35.91936302
								],
								[
									-8.47087469,
									35.9192274
								],
								[
									-8.33855954,
									35.91894661
								],
								[
									-8.20624533,
									35.91852065
								],
								[
									-8.07393303,
									35.91794953
								],
								[
									-7.94162265,
									35.91723325
								],
								[
									-7.80931514,
									35.91637182
								],
								[
									-7.67701052,
									35.91536525
								],
								[
									-7.54470975,
									35.91421354
								],
								[
									-7.41241283,
									35.9129167
								],
								[
									-7.28012074,
									35.91147475
								],
								[
									-7.14783346,
									35.9098877
								],
								[
									-7.01555198,
									35.90815557
								],
								[
									-6.88327629,
									35.90627836
								],
								[
									-6.75100736,
									35.90425611
								],
								[
									-6.61874519,
									35.90208881
								],
								[
									-6.48649075,
									35.89977651
								],
								[
									-6.35424403,
									35.8973192
								],
								[
									-6.26710238,
									35.89454214
								],
								[
									-6.20404749,
									35.88989691
								],
								[
									-6.0900236,
									35.89061544
								],
								[
									-5.98552685,
									35.8926953
								],
								[
									-5.89934797,
									35.89616148
								],
								[
									-5.74530809,
									35.90448018
								],
								[
									-5.61437419,
									35.91279785
								],
								[
									-5.52406875,
									35.93823395
								],
								[
									-5.47962649,
									35.95058855
								],
								[
									-5.46546524,
									35.96124125
								],
								[
									-5.43692711,
									36.00327493
								],
								[
									-5.42588215,
									36.01697014
								],
								[
									-5.41068464,
									36.04703495
								],
								[
									-5.40390004,
									36.06458769
								],
								[
									-5.40046251,
									36.07964995
								],
								[
									-5.40254312,
									36.10099283
								],
								[
									-5.41014188,
									36.12861634
								],
								[
									-5.40179652,
									36.14267466
								],
								[
									-5.37750705,
									36.14316777
								],
								[
									-5.36406933,
									36.14177572
								],
								[
									-5.36019039,
									36.13685989
								]
							]
						],
						"type": "MultiLineString"
					}
				}
			}
		}
	},
	"extensions": {
		"requestId": "eea13d63-8d8a-4dca-ba86-293a3a682d5f",
		"requestQuota": {
			"limit": "100000 req/m (burst 100000)",
			"remaining": 99998
		}
	}
}
 

Visualization of the response’s returned route

Point-to-port route

Request

query {
	routing(
		vessel: { imo: 9335173 }
		origin: {
			coordinates: {
				latitude: 46.320789077700056
				longitude: -7.835153291959443
			}
		}
		destination: { unlocode: ESVLC }
	) {
		journey {
			destination {
				... on Port {
					unlocode
					name
				}
				... on GeoPoint {
					latitude
					longitude
				}
			}
			distance
			duration {
				iso
				seconds
			}
			eta
			waypoints {
				geoJson
			}
		}
	}
}

Response

{
	"data": {
		"routing": {
			"journey": {
				"destination": {
					"unlocode": "ESVLC",
					"name": "Valencia"
				},
				"distance": 1229.4,
				"duration": {
					"iso": "P3DT10H30M30S",
					"seconds": 297030.0
				},
				"eta": "2024-10-25T22:35:22.309Z",
				"waypoints": {
					"geoJson": {
						"coordinates": [
							[
								[
									-7.8351531,
									46.32078934
								],
								[
									-7.83940629,
									46.31542717
								],
								[
									-7.84224137,
									46.31185232
								],
								[
									-7.84507609,
									46.3082774
								],
								[
									-7.84791044,
									46.30470241
								],
								[
									-7.85074442,
									46.30112735
								],
								[
									-7.85357802,
									46.29755222
								],
								[
									-7.85641126,
									46.29397702
								],
								[
									-7.85924413,
									46.29040174
								],
								[
									-7.86207662,
									46.2868264
								],
								[
									-7.86490875,
									46.28325099
								],
								[
									-7.86774051,
									46.27967551
								],
								[
									-7.8705719,
									46.27609996
								],
								[
									-7.87340292,
									46.27252434
								],
								[
									-7.87623356,
									46.26894865
								],
								[
									-7.87906384,
									46.26537289
								],
								[
									-7.88189376,
									46.26179706
								],
								[
									-7.8847233,
									46.25822116
								],
								[
									-7.88755247,
									46.25464519
								],
								[
									-7.89038127,
									46.25106915
								],
								[
									-8.00163192,
									46.10016213
								],
								[
									-8.2213044,
									45.80192411
								],
								[
									-8.46172925,
									45.47556542
								],
								[
									-8.72290647,
									45.12108606
								],
								[
									-8.91143169,
									44.86401914
								],
								[
									-9.02730491,
									44.70436468
								],
								[
									-9.30352031,
									44.33806728
								],
								[
									-9.95835666,
									43.47865678
								],
								[
									-10.10504579,
									43.28720031
								],
								[
									-10.09897809,
									42.84843744
								],
								[
									-10.09888844,
									42.70224189
								],
								[
									-10.09581955,
									42.31926351
								],
								[
									-10.08974153,
									41.65077046
								],
								[
									-10.08592035,
									41.1749562
								],
								[
									-10.08435602,
									40.89182073
								],
								[
									-10.08283079,
									40.69639418
								],
								[
									-10.08134467,
									40.58867655
								],
								[
									-10.08590955,
									40.12192676
								],
								[
									-10.09652542,
									39.29614483
								],
								[
									-10.10328015,
									38.8377139
								],
								[
									-10.10762051,
									38.701094
								],
								[
									-10.07362236,
									38.61130909
								],
								[
									-10.03072421,
									38.47822334
								],
								[
									-9.96759335,
									38.27190845
								],
								[
									-9.87642094,
									37.95086325
								],
								[
									-9.75720698,
									37.51508775
								],
								[
									-9.68312452,
									37.22861165
								],
								[
									-9.65417357,
									37.09143494
								],
								[
									-9.61998061,
									36.96518739
								],
								[
									-9.56082818,
									36.79220981
								],
								[
									-9.30619104,
									36.56811628
								],
								[
									-9.09887584,
									36.51742422
								],
								[
									-9.02451278,
									36.49840535
								],
								[
									-8.94299332,
									36.48474336
								],
								[
									-8.82952978,
									36.47009862
								],
								[
									-8.2491235,
									36.34750719
								],
								[
									-7.2017745,
									36.11696906
								],
								[
									-6.65996158,
									35.99583546
								],
								[
									-6.62368474,
									35.98410639
								],
								[
									-6.58801566,
									35.97396863
								],
								[
									-6.55295432,
									35.9654222
								],
								[
									-6.47359791,
									35.94488437
								],
								[
									-6.34994642,
									35.91235516
								],
								[
									-6.26710238,
									35.89454214
								],
								[
									-6.20404749,
									35.88989691
								],
								[
									-6.0900236,
									35.89061544
								],
								[
									-5.98552685,
									35.8926953
								],
								[
									-5.89934797,
									35.89616148
								],
								[
									-5.74530809,
									35.90448018
								],
								[
									-5.61437419,
									35.91279785
								],
								[
									-5.52406875,
									35.93823395
								],
								[
									-5.47962649,
									35.95058855
								],
								[
									-5.34943955,
									35.98271907
								],
								[
									-5.18425125,
									36.00588931
								],
								[
									-5.02401305,
									36.02272944
								],
								[
									-4.67349722,
									36.06472571
								],
								[
									-4.07929103,
									36.1374915
								],
								[
									-3.74752786,
									36.17892262
								],
								[
									-3.67820771,
									36.18901907
								],
								[
									-3.55516723,
									36.20393571
								],
								[
									-3.37840641,
									36.22367253
								],
								[
									-3.1163275,
									36.25448503
								],
								[
									-2.76893048,
									36.29637322
								],
								[
									-2.51432688,
									36.32731743
								],
								[
									-2.27161159,
									36.3573178
								],
								[
									-2.19274475,
									36.36476648
								],
								[
									-2.15925822,
									36.37665759
								],
								[
									-2.1272014,
									36.39676822
								],
								[
									-2.08541211,
									36.42906208
								],
								[
									-1.85963806,
									36.58975185
								],
								[
									-1.44987923,
									36.87883754
								],
								[
									-1.07073252,
									37.14843397
								],
								[
									-0.72219792,
									37.39854114
								],
								[
									-0.53424498,
									37.53679414
								],
								[
									-0.50687371,
									37.56319299
								],
								[
									-0.44315236,
									37.63454435
								],
								[
									-0.34308094,
									37.75084823
								],
								[
									-0.26740892,
									37.83785012
								],
								[
									-0.21613631,
									37.89555004
								],
								[
									-0.13539898,
									37.99068903
								],
								[
									-0.02519694,
									38.1232671
								],
								[
									0.0798896,
									38.2478226
								],
								[
									0.17986067,
									38.36435554
								],
								[
									0.26341675,
									38.46052124
								],
								[
									0.33055787,
									38.53631972
								],
								[
									0.37516877,
									38.5884511
								],
								[
									0.40828978,
									38.6311475
								],
								[
									0.45965579,
									38.69708067
								],
								[
									0.53736362,
									38.79260559
								],
								[
									0.54272401,
									38.82831271
								],
								[
									0.50163958,
									38.83604365
								],
								[
									0.47713728,
									38.84857476
								],
								[
									0.46921711,
									38.86590603
								],
								[
									0.46129308,
									38.88323676
								],
								[
									0.45336519,
									38.90056696
								],
								[
									0.44543342,
									38.91789663
								],
								[
									0.43749778,
									38.93522576
								],
								[
									0.42955826,
									38.95255434
								],
								[
									0.42161486,
									38.96988239
								],
								[
									0.41366757,
									38.98720991
								],
								[
									0.40571639,
									39.00453688
								],
								[
									0.39776131,
									39.02186331
								],
								[
									0.38980234,
									39.03918921
								],
								[
									0.38183945,
									39.05651456
								],
								[
									0.37387266,
									39.07383937
								],
								[
									0.36590196,
									39.09116363
								],
								[
									0.35792734,
									39.10848736
								],
								[
									0.3499488,
									39.12581054
								],
								[
									0.34196633,
									39.14313317
								],
								[
									0.33397994,
									39.16045527
								],
								[
									0.32598961,
									39.17777681
								],
								[
									0.25387165,
									39.21117632
								],
								[
									0.11762606,
									39.26065379
								],
								[
									0.03272985,
									39.31025494
								],
								[
									-0.00081699,
									39.35997979
								],
								[
									-0.08260502,
									39.39297892
								],
								[
									-0.21263423,
									39.40925235
								],
								[
									-0.28593824,
									39.42226513
								],
								[
									-0.30251704,
									39.43201728
								],
								[
									-0.31158937,
									39.43857992
								],
								[
									-0.31315522,
									39.44195306
								],
								[
									-0.31462036,
									39.44522992
								],
								[
									-0.31666699,
									39.45000076
								]
							]
						],
						"type": "MultiLineString"
					}
				}
			}
		}
	},
	"extensions": {
		"requestId": "c8e18854-2458-4f7c-b46a-ce7f2e55a225",
		"requestQuota": {
			"limit": "100000 req/m (burst 100000)",
			"remaining": 99998
		}
	}
}
 

Visualization of the response’s returned route

The predictedVesselRoute root query [deprecated]

The Predicted Vessel Route API query is able to provide port to port or point to port routing solution which includes the predicted distance, ETA/duration and route between the two points. It can be called for one vessel at a time.

 

Example query

{
  predictedVesselRoute(
    origin: { unlocode: "USNYC" }
    destination: { unlocode: "IRABD" }
    vessel: { imo: 9215696 }
  ) {
    journey {
      ...
    }
  }
}

Query arguments

In order to get a predictedVesselRoute response, the required parameters are: origin, destination and vessel.

All arguments for the predictedVesselRoute query:

predictedVesselRoute(
  canals: [WaterwayCanal!] = []
  destination: [RouteDestinationInput!]!
  origin: RouteOriginInput!
  piracy: Boolean = false
  speed: Float
  vessel: RouteVesselInput!
): VesselRouteResponse

vessel

Required for obtaining the predictedVesselRoute.

Specify mmsi, imo or both. At least one is required.

predictedVesselRoute(
  vessel: {
    imo: 9215696
  }
  ...
)

origin

The required origin may be specified by either UNLOCODE, or latitude and longitude.

Coordinates example:

predictedVesselRoute(
  origin: {
    coordinates: {
      latitude: 48.2133
      longitude: -123.2343
    }
  }
  ...
)

UNLOCODE example:
When using UNLOCODEs the center point for those ports or locations will be used. The center point will not always correspond to desired location for the specified vessel and it is recommended to use coordinates to specify the specific desired location e.g. a terminal for the vessel.

predictedVesselRoute(
  origin {
    unlocode: "USNYC"
  }
  ...
)

destination

The required destination is specified by a UNLOCODE:

predictedVesselRoute(
  destination: USNYC
  ...
)

speed

Optional average speed in knots which should be used for ETA calculation.

If not specified the speed is determined by known speed for the vessel

predictedVesselRoute(
  speed: 21.6
  ...
)

canals

Specifying this optional parameter will allow the routing algorithm to include the canals chosen in the route calculation. Note that this still depends on the selected vessel whether the canal can be passed or not. For example a vessel too large for the Panama Canal will not be routed through the canal, even if the paramater was set – only plausible routes are returned.

The canal values are enums, and therefore not quoted in the query.

Available canals: KIEL, PANAMA, SUEZ

Example including both PANAMA and SUEZ:

predictedVesselRoute(
  canals: [PANAMA, SUEZ]
  ...
)

piracy

Optionally set to flag to allow the route to go through Piracy Zones.

If true, predictedVesselRoute will include Piracy Zones.

If not set, the default is false.

predictedVesselRoute(
  piracy: true
)

Output

Example query and output specification (note, GraphQL fragments are used below):

query {
  predictedVesselRoute(
    origin: { unlocode: "USNYC" }
    destination: { unlocode: "IRABD" }
    vessel: { imo: 9215696 }
  ) {
    itinerary {
      ...routeDetails
    }
    journey {
      ...routeDetails
    }
  }
}

fragment routeDetails on VesselRoute {
  distance
  duration {
    seconds
    iso
    text
  }
  eta
  seca
  destinationPort {
    ...portDetails
  }
  origin {
    ...portDetails
  }
  waypoints {
    wkt
    geoJson {
      coordinates
      type
    }
  }
}

fragment portDetails on Port {
  name
  unlocode
  centerPoint {
    latitude
    longitude
  }
}

VesselRouteResponse

The response contains two main objects: itinerary and journey

itinerary

This object contains one subobject: VesselRoute

duration
type TimeDuration {
  iso: String!
  seconds: Float!
  text: String!
}
port
type Port {
  centerPoint: GeoPoint
  name: String!
  unlocode: UNLOCODE!
}
centerPoint
type GeoPoint {
  latitude: Float!
  longitude: Float!
}
journey
type VesselRoute {
  destinationPort: Port!
  distance: Float!
  duration: TimeDuration!
  eta: DateTime!
  origin: RouteOrigin!
  seca: Float!
  waypoints: Waypoints!
}
waypoints

Provides waypoints in WKT or GeoJSONLinestring

type Waypoints {
  geoJson: GeoJsonLineString
  wkt: WKT!
}