Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Insights is an API-based service that provides actionable weather outcomes for specific use cases. The Maritime Insights endpoints combine weather forecast data with vessel characteristics and domain knowledge to deliver direct operational guidance.

Endpoints

MethodEndpointDescription
POST/insights/maritime/route?type=riskGet vessel risk assessment along a route
POST/insights/maritime/route?type=efficiencyGet vessel efficiency forecast along a route

Vessel Risk Insight

POST /insights/maritime/route?type=risk

Assess weather-related risk to the vessel, cargo, and crew along a planned route. The result uses a traffic-light system (Red, Amber, Green) for each leg of the voyage, with explanations of the risk factors.

Query Parameters

ParameterTypeRequiredDescription
typestringYesMust be risk

Request Body

{
  "route": {
    "waypoints": [
      {
        "lat": 23.25,
        "lon": -62.10,
        "time": "2024-01-15T03:00:00"
      },
      {
        "lat": 23.32,
        "lon": -62.11,
        "time": "2024-01-15T04:00:00"
      },
      {
        "lat": 23.36,
        "lon": -62.13,
        "time": "2024-01-15T05:00:00"
      },
      {
        "lat": 23.42,
        "lon": -62.16,
        "time": "2024-01-15T06:00:00"
      }
    ]
  },
  "vessel": {
    "vessel_type": "container_ship",
    "vessel_state": "low_gm"
  },
  "configuration": "default"
}

Request Body Fields

FieldTypeRequiredDescription
routeobjectYesRoute definition
route.waypointsarrayYesArray of waypoints (max 120)
vesselobjectYesVessel configuration
vessel.vessel_typestringYesType of vessel (see table below)
vessel.vessel_statestringYesLoading state of vessel (see table below)
configurationstringNoCustom threshold configuration name

Vessel Configurations

Vessel TypeAvailable States
container_shiplow_gm, medium_gm, high_gm
bulk_carrierin_ballast, loaded_small, loaded_half, loaded_full
tankerin_ballast, loaded
general_cargolow_gm, medium_gm, high_gm

Response

Each leg of the route receives risk assessments for vessel, cargo, and crew. By default all legs start as “green” — if any risky weather condition is detected along the leg, it is escalated to “amber” or “red” with an explanation.

{
  "meta": {},
  "data": [
    {
      "start": {
        "time": "2024-01-15T03:00:00",
        "lat": 23.25,
        "lon": -62.10
      },
      "end": {
        "time": "2024-01-15T04:00:00",
        "lat": 23.32,
        "lon": -62.11
      },
      "combined_risk": "red",
      "risk_factors": {
        "vessel": {},
        "cargo": {
          "humidity": {
            "risk": "red",
            "reasons": [
              "relative humidity is greater than 60 %"
            ]
          }
        },
        "crew": {}
      }
    },
    {
      "start": {
        "time": "2024-01-15T04:00:00",
        "lat": 23.32,
        "lon": -62.11
      },
      "end": {
        "time": "2024-01-15T05:00:00",
        "lat": 23.36,
        "lon": -62.13
      },
      "combined_risk": "green",
      "risk_factors": {
        "vessel": {},
        "cargo": {},
        "crew": {}
      }
    }
  ]
}

Risk Categories

Risk factors are classified into three categories:

CategoryWeather Factors Considered
VesselVisibility, wind (general), ice accretion, wind gusts, wind waves, waves, swell
CargoDew point, temperature, humidity, wind, wind gusts, wind waves, waves, swell
CrewWind (general), wind gusts, wind waves, waves, swell, functional temperature

Risk Levels

LevelMeaning
greenNo significant weather risk
amberModerate weather risk — caution advised
redHigh weather risk — conditions may be hazardous

Customized Thresholds

Spire provides default thresholds for risk classification, but custom threshold configurations can be created. A customer can maintain multiple configurations (e.g., “conservative” vs. “risk-tolerant”) and specify which to use per request via the configuration field.

Contact Spire for configuration of custom threshold settings.


Vessel Efficiency Insight

POST /insights/maritime/route?type=efficiency

Forecast the expected efficiency of a planned route based on weather conditions. Uses a five-color ranking from worst to best conditions for vessel efficiency.

Query Parameters

ParameterTypeRequiredDescription
typestringYesMust be efficiency

Request Body

Uses the same request body structure as the Risk insight (route + vessel configuration).

Response

Each leg receives an overall efficiency rating and per-parameter breakdowns:

{
  "meta": {},
  "data": [
    {
      "start": {
        "time": "2024-01-15T03:00:00",
        "lat": 23.25,
        "lon": -62.10
      },
      "end": {
        "time": "2024-01-15T09:00:00",
        "lat": 23.50,
        "lon": -62.30
      },
      "combined_efficiency": "orange",
      "efficiency_factors": {
        "ocean_currents": {
          "efficiency": "red"
        },
        "mean_waves": {
          "efficiency": "light green"
        },
        "wind_waves": {
          "efficiency": "orange"
        },
        "swell_waves": {
          "efficiency": "light green"
        },
        "winds_10m": {
          "efficiency": "orange"
        },
        "winds_50m": {
          "efficiency": "orange"
        }
      }
    }
  ]
}

Efficiency Levels

Ranked from worst to best:

LevelMeaning
redWorst efficiency — strong adverse conditions
orangePoor efficiency
greyNeutral conditions
light greenGood efficiency
greenBest efficiency — favorable conditions

Weather Factors

The efficiency calculation considers the following factors, weighted by vessel type, load, and heading relative to the weather:

FactorDescription
winds_10m10-meter wind speed and direction
winds_50m50-meter wind speed and direction
ocean_currentsOcean current speed and direction
mean_wavesTotal (combined wind + swell) wave height and direction
swell_wavesSwell wave height and direction
wind_wavesWind wave height and direction

Time Alignment

For both insight types, when requested waypoint times do not align with available forecast times, the response uses the nearest available time. The response includes both times:

{
  "times": {
    "issuance_time": "2024-01-13T12:00:00+00:00",
    "valid_time": "2024-01-15T12:00:00+00:00",
    "requested_valid_time": "2024-01-15T13:10:00+00:00"
  }
}

Example Request

Shell
Python
Node.js
curl -X POST \
  'https://api.wx.spire.com/insights/maritime/route?type=risk' \
  -H 'spire-api-key: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "route": {
      "waypoints": [
        {"lat": 0.0, "lon": 0.0, "time": "2024-01-15T22:00:00"},
        {"lat": 0.5, "lon": 0.5, "time": "2024-01-16T04:00:00"},
        {"lat": 1.0, "lon": 1.0, "time": "2024-01-16T10:00:00"},
        {"lat": 1.5, "lon": 1.5, "time": "2024-01-16T16:00:00"},
        {"lat": 2.0, "lon": 2.0, "time": "2024-01-16T22:00:00"}
      ]
    },
    "vessel": {
      "vessel_type": "container_ship",
      "vessel_state": "low_gm"
    }
  }'

Python Example

Compare risk and efficiency for a voyage:

import requests

headers = {
    'spire-api-key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
}

route_data = {
    "route": {
        "waypoints": [
            {"lat": 0.0, "lon": 0.0, "time": "2024-01-15T22:00:00"},
            {"lat": 0.5, "lon": 0.5, "time": "2024-01-16T04:00:00"},
            {"lat": 1.0, "lon": 1.0, "time": "2024-01-16T10:00:00"},
            {"lat": 1.5, "lon": 1.5, "time": "2024-01-16T16:00:00"},
            {"lat": 2.0, "lon": 2.0, "time": "2024-01-16T22:00:00"}
        ]
    },
    "vessel": {
        "vessel_type": "bulk_carrier",
        "vessel_state": "loaded_full"
    }
}

# Get risk assessment
risk_response = requests.post(
    'https://api.wx.spire.com/insights/maritime/route?type=risk',
    headers=headers,
    json=route_data
)
risk_data = risk_response.json()['data']

print("=== Risk Assessment ===")
for i, leg in enumerate(risk_data):
    print(f"Leg {i+1}: {leg['combined_risk'].upper()}")
    for category in ['vessel', 'cargo', 'crew']:
        factors = leg['risk_factors'].get(category, {})
        if factors:
            for factor, detail in factors.items():
                print(f"  {category}/{factor}: {detail['risk']} - {', '.join(detail['reasons'])}")

# Get efficiency forecast
efficiency_response = requests.post(
    'https://api.wx.spire.com/insights/maritime/route?type=efficiency',
    headers=headers,
    json=route_data
)
efficiency_data = efficiency_response.json()['data']

print("\n=== Efficiency Forecast ===")
for i, leg in enumerate(efficiency_data):
    print(f"Leg {i+1}: {leg['combined_efficiency']}")
    for factor, detail in leg['efficiency_factors'].items():
        print(f"  {factor}: {detail['efficiency']}")