---
title: "Forecast hazards along a route at each point's arrival time."
method: POST
path: "/v1/weather/route"
tags: ["Weather"]
---

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

`POST /v1/weather/route`

## Request

- Base URL: `https://api.smarterweather.com`
- URL: `https://api.smarterweather.com/v1/weather/route`
- Auth: HTTP bearer

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.

## Request body

- RouteWeatherRequest: 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.
    - `type` 'LineString', required
    - `coordinates` array[], required
      - number[]
    - `bbox` number[]
  - `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 `200`

The forecast along the path for each departure.

- RouteWeatherResponse: 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
    - `length` number, required: Path length (mi or km).
    - `vertices` integer, required: Vertex count after decoding.
    - `samples` integer, required
    - `spacing` number, required: Distance between samples (mi or km).
  - `best` string, date-time, required: The `departure` of the best departure (the ranking is in the operation description).
  - `departures` RouteDeparture[], required
    - `notes` string[]: Present when the forecast read was incomplete for this departure's samples (part of the forecast failed to load); the answer is then `truncated`. Plain text, not a code.
    - `departure` string, date-time, required: The departure, in UTC.
    - `departure_local` string, date-time, required: The departure in `origin_timezone`, with its UTC offset.
    - `origin_timezone` string, required: The IANA time zone of the first sample inside coverage (the start of the path when it is inside coverage).
    - `arrival` string, date-time, required: The end of the trip. With `times`, the last vertex time, so a wait at the destination is included; the last sample's `eta` is the first arrival there.
    - `arrival_local` string, date-time, required: `arrival` in `destination_timezone`, with its UTC offset.
    - `destination_timezone` string, required: The IANA time zone of the last sample inside coverage (the end of the path when it is inside coverage).
    - `eta_source` 'speed' | 'times', required
    - `summary` object, required: Forecast fields are over the `ok` samples, alert fields over this departure's `alerts`, and outlook fields over the samples inside coverage; a value is `null` when none has it.
      - `missing_samples` integer, required: Samples inside coverage without a full forecast for this departure (`partial`, `beyond_horizon` or `unavailable`). `best` ranks on it first.
      - `hazard_minutes` integer, required
      - `worst_hazard` 'freezing_rain' | 'snow' | 'thunderstorms' | 'low_visibility' | 'high_wind' | 'heavy_rain', nullable, required
      - `max_wind_gust` number, nullable, required
      - `max_crosswind_gust` number, nullable, required
      - `min_visibility` number, nullable, required
      - `max_precipitation_probability` number, nullable, required
      - `worst_alert_severity` 'Extreme' | 'Severe' | 'Moderate' | 'Minor' | 'Unknown', nullable, required
      - `alert_minutes` integer, required: Wall-clock minutes inside any alert in `alerts` while it is in effect, overlaps counted once, rounded up (any time inside is at least 1).
      - `severe_alert_minutes` integer, required: The same as `alert_minutes`, over the Severe and Extreme alerts only.
      - `worst_convective_outlook` 'TSTM' | 'MRGL' | 'SLGT' | 'ENH' | 'MDT' | 'HIGH', nullable, required: Storm Prediction Center categorical convective outlook band, least to most severe: General thunderstorms, Marginal, Slight, Enhanced, Moderate, High.
      - `worst_excessive_rainfall_outlook` 'MRGL' | 'SLGT' | 'MDT' | 'HIGH', nullable, required: Weather Prediction Center excessive rainfall outlook band, least to most severe: Marginal, Slight, Moderate, High.
    - `alerts` RouteAlert[], required: The alerts the path crosses while they are in effect at this departure's ETA, by `enter_distance`, then severity (worst first), then `id`. Empty when none.
      - `id` string, required: The alert id for `GET /v1/alerts/{id}`.
      - `event` string, required
      - `severity` 'Extreme' | 'Severe' | 'Moderate' | 'Minor' | 'Unknown', required
      - `headline` string, required: The alert headline; may be empty.
      - `onset` string, date-time, nullable, required: When the alert takes effect (its effective time when no onset is given). `null` when neither is known.
      - `onset_local` string, date-time, nullable, required: `onset` in the time zone of the covered sample nearest `enter_distance`, with its UTC offset at `onset`. `null` with `onset`.
      - `expiration` string, date-time, required: The end of the alert's window for this crossing, the time the keep rule used. It is the event's end (the NWS event ending time, else the alert's `ends`); when neither is given, it is the product's expiry.
      - `expiration_local` string, date-time, required: `expiration` in the time zone of the covered sample nearest `enter_distance`, with its UTC offset at `expiration`.
      - `enter_distance` number, required: Distance from the start of the path where the crossing begins (mi or km); at most `exit_distance`.
      - `exit_distance` number, required: Distance from the start of the path where the crossing ends (mi or km).
      - `enter_time` string, date-time, required: ETA at `enter_distance`.
      - `enter_time_local` string, date-time, required: `enter_time` in the time zone of the covered sample nearest `enter_distance`, with its UTC offset.
      - `exit_time` string, date-time, required: ETA at `exit_distance`.
      - `exit_time_local` string, date-time, required: `exit_time` in the time zone of the covered sample nearest `exit_distance`, with its UTC offset.
    - `segments` object[], required: Runs of consecutive samples sharing a hazard, by start distance then severity.
      - `hazard` 'freezing_rain' | 'snow' | 'thunderstorms' | 'low_visibility' | 'high_wind' | 'heavy_rain', required
      - `from_distance` number, required
      - `to_distance` number, required
      - `start` string, date-time, required
      - `start_local` string, date-time, required: `start` in the time zone of the segment's first sample, with its UTC offset.
      - `end` string, date-time, required
      - `end_local` string, date-time, required: `end` in the time zone of the segment's last sample, with its UTC offset.
    - `samples` RouteSample[], required
      - `distance` number, required: Distance from the start of the path (mi or km).
      - `lat` number, required
      - `lon` number, required
      - `eta` string, date-time, required
      - `timezone` string: The IANA time zone at the sample. Absent outside coverage.
      - `eta_local` string, date-time: `eta` in `timezone`, with its UTC offset. Absent outside coverage.
      - `valid_time` string, date-time: The forecast hour used. Only on `ok` samples.
      - `heading` number, required: Direction of travel.
      - `status` 'ok' | 'partial' | 'outside_coverage' | 'beyond_horizon' | 'unavailable', required
      - `temperature` number
      - `apparent_temperature` number
      - `precipitation_probability` number
      - `precipitation` number: Precipitation in the hour.
      - `snowfall` number: Snowfall in the hour.
      - `freezing_rain` number: Freezing rain in the hour.
      - `precip_type_rain_prob` number
      - `precip_type_snow_prob` number
      - `precip_type_freezing_rain_prob` number
      - `precip_type_ice_pellets_prob` number
      - `visibility` number
      - `visibility_prob_below_1mi` number
      - `wind_speed` number
      - `wind_gust` number
      - `wind_direction` number: Direction the wind blows from.
      - `crosswind` number: Sustained wind across the direction of travel.
      - `crosswind_gust` number: Gust across the direction of travel.
      - `thunderstorm_probability` number
      - `convective_outlook` 'TSTM' | 'MRGL' | 'SLGT' | 'ENH' | 'MDT' | 'HIGH': Storm Prediction Center categorical convective outlook band, least to most severe: General thunderstorms, Marginal, Slight, Enhanced, Moderate, High.
      - `excessive_rainfall_outlook` 'MRGL' | 'SLGT' | 'MDT' | 'HIGH': Weather Prediction Center excessive rainfall outlook band, least to most severe: Marginal, Slight, Moderate, High.
      - `hazards` RouteHazard[], required: Hazard codes at this sample, worst first. Empty unless `status` is `ok` or `partial`.
      - `unevaluated_hazards` RouteHazard[]: On `partial` samples, the hazards the forecast at this hour cannot rule out because their inputs are missing, worst first.
  - `meta` object, required
    - `sources` object[], required: Each product used: the forecast products with the newest model run used, `nws_alerts` (alerts, `run` null), and each outlook product with a band in the answer (`run` is its issue time). No outlook product means no band was found at the samples' ETAs, not that there is no risk (see the known gap under Outlooks).
      - `product` string, required
      - `run` string, date-time, nullable, required
    - `data_age_seconds` integer, nullable, required: Age of the newest model run used, in seconds. `null` when unknown.
  - `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.

## Other responses

- `400`: Bad request.
- `401`: Missing or invalid API key. Carries a `WWW-Authenticate` challenge and a `next_steps` extension. `recommended` is `device_flow`: the object is a complete no-install mint recipe.
- `403`: API key lacks the required scope. Carries a `WWW-Authenticate` challenge with `error="insufficient_scope"` and a `next_steps` extension.
- `404`: Resource not found: a location that cannot be resolved (unknown ZIP, unrecognised free-text location), no upstream data for the location, or a missing resource. On a route that checks coverage (its description says so), a location outside the 50 US states and DC returns type `https://smarterweather.com/errors/outside-coverage`; that and the location-not-found problem carry `next_steps` (`recommended = coverage`).
- `413`: Payload too large. The request body exceeded the route's size cap (1 MiB on `POST /v1/pois/exposure` and `POST /v1/weather/route`).
- `422`: The read did not finish within its time budget (type `query-too-slow`, `reason` `query_too_slow`): narrow it, with a smaller area or box, fewer ids, a filter or a lower `limit`. A path that crosses more than 500 of a product's features, or a feature-door `where` read over more features than one read takes, is type `too-many-features`, `reason` `too_many_features`: send a shorter path, a smaller area or a filter. A `where` read whose product has no frame at its `at` is type `where-no-frame`, `reason` `where_no_frame`: send an `at` inside the product's served range (`GET /v1/catalog/{id}`: its horizon and history).
- `429`: Rate limit exceeded. Carries a `next_steps` extension (`recommended: upgrade`, plus `pricing` and `usage`) telling the caller how to lift the limit.
- `500`: Internal server error.
- `502`: Bad gateway. The service received an invalid response from an upstream data source. Transient; clients should retry with backoff.
- `503`: Service unavailable. An upstream dependency is unavailable or shedding load (type `service-unavailable`). Transient; retry with backoff and honor any `Retry-After` header.
- `504`: Gateway timeout. An upstream data source did not respond within the service's budget.

## Changes

- **2026-11-19** `208a31bf0fd1`: 11 info
  - added the optional property `alternatives` to the response with the `400` status
  - added the optional property `alternatives` to the response with the `401` status
  - added the optional property `alternatives` to the response with the `403` status
  - added the optional property `alternatives` to the response with the `404` status
  - …7 more
- **2026-11-12** `74fbde611e2f`: 11 info
  - added the optional property `unresolved` to the response with the `400` status
  - added the optional property `unresolved` to the response with the `401` status
  - added the optional property `unresolved` to the response with the `403` status
  - added the optional property `unresolved` to the response with the `404` status
  - …7 more
- **2026-11-03** `d916938b6f30`: 2 info
  - added the optional property `departures/items/notes` to the response with the `200` status
  - added the optional property `truncated` to the response with the `200` status
- **2026-11-02** `5595903acd06`: 1 info
  - added the non-success response with the status `422`
- **2026-10-30** `a87056cbda5f`: 140 info
  - added the optional property `cells` to the response with the `400` status
  - added the optional property `cells` to the response with the `401` status
  - added the optional property `cells` to the response with the `403` status
  - added the optional property `cells` to the response with the `404` status
  - …136 more

[Operation history](https://skmtc.dev/smarterweather/apis/smarter-weather-api/changes/v1/weather/route/post.md)

---

[API](https://skmtc.dev/smarterweather/apis/smarter-weather-api.md) - [All operations](https://skmtc.dev/smarterweather/apis/smarter-weather-api/llms.txt) - [OpenAPI document](https://skmtc.dev/smarterweather/apis/smarter-weather-api/revisions/77f615c16f80?raw)
