Weather

Forecast hazards along a route at each point's arrival time.

Changed on

Samples a caller-supplied path and returns the National Blend of Models forecast at each sample's estimated time of arrival (ETA), for up to three departure times, with hazard codes, crosswind, hazard segments, the National Weather Service alerts along the way, the Storm Prediction Center convective and Weather Prediction Center excessive rainfall outlooks at each sample, and the best departure.

Path

Exactly one of geometry (a GeoJSON LineString, [lon, lat]) or polyline (an encoded polyline; polyline_precision 5, the default, or 6, which most routing engines emit). The path has 2 to 10,000 vertices, is at most 5,000 km long and spans less than 180° of longitude. Samples are spaced evenly by distance, endpoints included: one every 10 km, from 2 up to 100 samples, so paths over 990 km are sampled more sparsely (about 50.5 km apart at 5,000 km). The samples are the same for every departure; only their ETAs differ.

Arrival times

With times (one RFC 3339 instant per vertex, non-decreasing), a sample's ETA is interpolated by distance between the vertex times, and each departure shifts the whole schedule by departure - times[0]. A wait (a repeated vertex) is not travel: it never counts as hazard time, and the last sample's ETA is the first arrival at the end, while arrival is the last vertex time. Without times, ETAs are distance over speed. departures defaults to times[0], else to now. Each departure is between 1 hour ago and 168 hours ahead, the departures are within 24 hours of each other, and the trip takes at most 72 hours.

Local times

Times are UTC. The times of the trip listed below also have a _local sibling: the same instant in a local time zone, with that zone's UTC offset at that instant (RFC 3339), so time zone lines and daylight saving changes along the way are already applied. best (it equals one departure's departure, next to its departure_local), valid_time and meta.sources[].run are UTC only. Zones are known only at samples inside coverage, and each local time uses the zone of the nearest such sample:

  • a sample has eta_local and its IANA timezone; a sample outside coverage has neither;
  • a segment has start_local and end_local, in the zones of its first and last samples;
  • an alert crossing has enter_time_local and exit_time_local, in the zones of the covered samples nearest where you enter and leave it, and onset_local and expiration_local in the zone where you enter it;
  • a departure has departure_local and arrival_local, in the zones of the first and last samples inside coverage, named in origin_timezone and destination_timezone. For a path that starts or ends outside coverage, that is the zone where it enters or leaves coverage, not the zone at the endpoint.

Samples

Each sample takes the forecast hour nearest its ETA, echoed as valid_time, with no interpolation, by the rule of POST /v1/series/batch path: the nearest hour within half the product's catalog time.max_step (6 hours for the NBM: later in the forecast the steps are 3- or 6-hourly), so valid_time may sit up to 3 hours from eta, before or after it (an early ETA of a departure in the past hour can take the first forecast hour, and an ETA up to 3 hours past the last forecast hour read takes it); a tie takes the earlier hour. A sample whose nearest forecast hour is farther away is unavailable while the forecast run goes on, and beyond_horizon past the run's end. A field missing at that hour is omitted. heading is the direction of travel over a 1 km baseline; crosswind and crosswind_gust are the wind components across it.

status is ok; partial (a forecast whose inputs cannot rule out every hazard, which unevaluated_hazards lists; for example the hourly precipitation amount is not forecast everywhere at every hour); outside_coverage (outside the 50 US states and DC); beyond_horizon (the ETA is more than 3 hours past the last forecast hour of a run that has ended); unavailable (no forecast for that sample, for example when part of the forecast could not be loaded, for one region or one hour, or not yet ingested). Only ok and partial samples carry weather fields and hazards; the outlook fields are on every sample inside coverage. If coverage along the route cannot be checked in time, the request returns 503 with Retry-After; a retry is usually answered.

Hazards

Fixed thresholds, listed worst first. This order ranks worst_hazard and best.

  1. freezing_rain: a freezing-rain precipitation type probability of 30% or more with a precipitation probability of 30% or more, or 0.01 in (0.25 mm) or more of freezing rain in the hour.
  2. snow: a snow precipitation type probability of 50% or more with a precipitation probability of 40% or more, or 0.1 in (2.5 mm) or more of snowfall in the hour.
  3. thunderstorms: a thunderstorm probability of 30% or more.
  4. low_visibility: a probability of visibility under 1 mile of 30% or more, or visibility under 1 mile (1,609 m).
  5. high_wind: a gust of 40 mph (17.9 m/s) or more, or a crosswind gust of 30 mph (13.4 m/s) or more.
  6. heavy_rain: 0.30 in (7.6 mm) or more of precipitation in the hour.

Consecutive samples with the same code merge into segments; a sample can carry several codes. Each sample owns the travel time from the midpoint with its previous sample to the midpoint with its next one, on the travel clock (waits left out), and hazard_minutes totals it over the samples with any code. best ranks the departures by data completeness first (the fewest missing_samples, so missing forecast hours never look like calm weather), then by the fewest severe_alert_minutes, then by the fewest hazard_minutes, then by the less severe worst_hazard, then by the fewest alert_minutes, then by the earlier arrival.

Alerts

Each departure lists the active National Weather Service alerts the path crosses while they are in effect at your ETA there, with where and when you enter and leave each one. An alert issued for a later period counts from its onset. Alerts issued after the request, and alerts that have already ended, cannot be known, even for a departure in the past. Marine-zone and surf and beach alerts are left out: the alerts are the nws_alerts crossings of POST /v1/series/batch path with filter ["marine == false", "event != Rip Current Statement", "event != Beach Hazards Statement", "event != High Surf Advisory", "event != High Surf Warning"] (the route_weather query's call). A route that crosses more than 500 alerts, or whose alerts read runs over its time budget, answers 422 (send a shorter route); alerts that change while they are read answer 503 with Retry-After.

An alert counts while its window, from onset to expiration, overlaps the time from enter_time to exit_time. An alert the path crosses twice is listed twice with the same id; fetch its text with GET /v1/alerts/{id}. alert_minutes is the wall-clock time spent inside any listed alert while it is in effect, a wait included, with overlapping alerts counted once; severe_alert_minutes is the same over the Severe and Extreme ones. Alerts are not hazard codes: they never add to segments or hazard_minutes. Both alert minute counts are rounded up, so a brief pass through a warning still counts. If the alerts cannot be loaded, the request fails (502, or 504 on a timeout) rather than answering without them.

Outlooks

convective_outlook is the Storm Prediction Center categorical convective outlook band at the sample's place, in effect at its ETA: TSTM (general thunderstorms), MRGL, SLGT, ENH, MDT, HIGH, from least to most severe. excessive_rainfall_outlook is the Weather Prediction Center excessive rainfall outlook band: MRGL, SLGT, MDT, HIGH. An outlook counts from the start of its period up to, not including, its end; an outlook already in effect when you ask also covers earlier ETAs, such as those of a departure in the past hour. When outlooks for different days cover the same time, the one for the nearest day (the most recent forecast) is used, and within it the most severe band the place sits in. That day is chosen over the whole route: where the most recent outlook draws an area somewhere along the route, an older outlook's band is not shown at the places it leaves out. If the most recent outlook draws nothing along the route, an older outlook for a later day can still be shown for that time. worst_convective_outlook and worst_excessive_rainfall_outlook are the most severe bands over the departure's samples.

A field is absent when no band of that kind covers the place at the ETA: no area is drawn there; the ETA is past the last outlook period (about three days out); or the place is in Alaska or Hawaii, which these outlooks do not cover.

Known gap. For a request made between about 06:00 and 12:00 UTC (08:30 and 12:00 UTC for excessive rainfall), samples whose ETA is before 12:00 UTC that day have no band even where one is in effect: the overnight outlook still valid until 12:00 UTC is not served during those hours. A missing band there does not mean no risk; the alerts along the route still apply.

Outlooks are day-scale area risk, not conditions at the ETA: they never change best, hazard_minutes or segments. If the outlooks cannot be loaded, the request fails (502, or 504 on a timeout) rather than answering without them. A route that crosses more than 500 areas of one outlook product, or whose outlook reads run over their time budget, answers 422 (send a shorter route); outlook areas that change while they are read answer 503 with Retry-After.

A path over 2,000 vertices is simplified for the alerts and outlook lookups (the stretches of the path inside each alert and outlook area), moving it by at most 1 km; the distances and times are still on your path. A path that cannot be simplified to 2,000 vertices within 1 km (one that folds back on itself thousands of times) returns 400.

A path with no sample inside the 50 US states and DC returns 404 outside-coverage with next_steps. A body over 1 MiB returns 413; an unknown field or a broken limit returns 400 naming it.

Auth and cost

Standard sw-api Bearer auth and rate limits apply. Cost class compute, weight 2 per call: the departures, samples and path length never change it.

Experimental (x-stability: experimental): excluded from the 90-day breaking-change commitment. Not yet enabled for every API key; a key without access gets 403 with problem type flag-disabled. If access cannot be checked, the API returns 503 service-unavailable; retry with backoff.

post/v1/weather/route

Request

  • Base URL
    https://api.smarterweather.com
  • Auth
    HTTP bearer

Request body

RouteWeatherRequest required

Exactly one of geometry or polyline.

geometry, object

A GeoJSON LineString of 2 to 10,000 [lon, lat] positions (RFC 7946). An altitude, if present, is ignored. The positions must span less than 180° of longitude.

polyline, string

An encoded polyline of 2 to 10,000 vertices. The positions must span less than 180° of longitude.

polyline_precision, 5 | 6

Decimal places the polyline was encoded with. Only with polyline.

times, string[]

One RFC 3339 instant per path vertex (after decoding a polyline), non-decreasing. Sets the ETAs; speed is then ignored.

departures, string[]

1 to 3 distinct departure instants, each between 1 hour ago and 168 hours ahead and all within 24 hours of each other. Default: times[0] with times, else now.

speed, number double

Average speed in the selected units: 5 to 100 mph (default 55) or 8 to 160 kph (default 89). Ignored with times.

units, 'imperial' | 'metric'

Response

The forecast along the path for each departure.

RouteWeatherResponse required

Values are in the selected units: imperial is °F, mph, miles and inches; metric is °C, kph, kilometres and millimetres. Probabilities are percent and directions are degrees clockwise from north.

units, 'imperial' | 'metric' required
path, object required
best, string date-time required

The departure of the best departure (the ranking is in the operation description).

departures, RouteDeparture[] required
meta, object required
truncated, boolean

true when the forecast read was incomplete (part of it could not be loaded): some values or samples may be missing (missing hazard inputs make a sample partial, a frame without the forecast makes it unavailable), and each affected departure's notes says so; retry for them. Absent on a complete read. When nothing at all can be served (no forecast sample, no alert, no outlook band), the request answers 503 with Retry-After instead.

Example response

{
  "departures": [
    {
      "departure_local": "2026-11-02T07:00:00-06:00",
      "origin_timezone": "America/Chicago",
      "arrival_local": "2026-11-02T21:30:00-07:00",
      "destination_timezone": "America/Denver",
      "alerts": [
        {
          "event": "Winter Storm Warning"
        }
      ],
      "samples": [
        {
          "timezone": "America/Chicago",
          "eta_local": "2026-11-02T09:15:00-06:00"
        }
      ]
    }
  ],
  "meta": {
    "sources": [
      {
        "product": "nbm_conus"
      }
    ]
  }
}

Changes

    • info

      added the optional property alternatives to the response with the status

    • info

      added the optional property alternatives to the response with the status

    • info

      added the optional property alternatives to the response with the status

    8 more changes in this revision