Weather

Consecutive hours that meet activity criteria.

Changed on

Returns runs of forecast hours that satisfy the caller's criteria, the REST twin of an MCP get_data window read (where and windows). The scan is deterministic: the criteria are where expressions on the window search GET /v1/series serves (windows), over the location's forecast that serves every variable the criteria test. An optional activity string may attach a favorability rating and limiting_factor to one window when activity rating is enabled for the service. When rating is off, or the scorer does not return a usable verdict, rating and limiting_factor are omitted and the windows stay in chronological order.

When a rating lands, the rated window is first and the remaining windows follow by duration (longer first).

Location selectors match GET /v1/weather: exactly one of lat+lon, zip, or location.

A location outside the 50 US states and DC returns 404 outside-coverage with next_steps, as on GET /v1/weather. An empty scan inside coverage may return windows: [] with message when no forecast series is available.

activity does not change the metered weight of the call.

get/v1/windows

Request

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

Query parameters

lat, number double

Latitude (WGS84 decimal degrees). Give it with lon. On a route that also takes zip or location, give only one location form.

lon, number double

Longitude (WGS84 decimal degrees). Give it with lat. On a route that also takes zip or location, give only one location form.

zip, string

5-digit US ZIP code. Mutually exclusive with lat/lon and location.

location, string

Free-text location name. Examples: "Boston, MA", "94043", "Denver", "KSLC". Resolved by the Smarter Weather geocoder (a station id resolves as on /v1/geocode/search). Mutually exclusive with lat/lon and zip.

units, 'imperial' | 'metric'

Unit system for numeric response fields. imperial (default) uses °F, mph, inHg, mi, in; metric uses °C, kph, hPa, km, mm. See the Units schema returned with every response for the exact label set.

hours, integer

How far ahead to search, in hours.

activity_duration_hours, integer

Minimum consecutive hours that must meet the criteria.

daylight_only, boolean

When true (the default), hours outside sunrise–sunset are excluded when sun times are available. In polar night no hour is daylight, so windows is empty; under midnight sun every hour is. If sun times cannot be loaded, the daylight filter is skipped.

max_precipitation_probability, number double

Drop hours whose precipitation probability exceeds this percent.

min_temperature, number double

Drop hours colder than this, in the selected units.

max_temperature, number double

Drop hours warmer than this, in the selected units.

max_wind_speed, number double

Drop hours with sustained wind above this, in the selected units.

max_wind_gust, number double

Drop hours with a gust above this, in the selected units.

min_visibility, number double

Drop hours with visibility below this, in the selected units.

min_ceiling, number double

Drop hours with a cloud ceiling below this, in the selected units.

activity, string

Free-text activity used only when activity rating is enabled. At most 200 characters. Accepted and ignored when rating is off.

Response

Windows that meet the criteria, possibly empty.

WindowsResponse required
location, Location required

Resolved location.

units, 'imperial' | 'metric' required
windows, WeatherWindow[] required
criteria_applied, WindowCriteria required

Criteria echoed back in the requested units. Omitted fields were not set.

daylight_only, boolean required
activity_duration_hours, integer required
sun_times, object[]

Present when daylight filtering used sunrise and sunset. Polar dates (midnight sun, polar night) have neither and are left out.

message, string

Set when windows is empty because the point is outside NBM coverage or no forecast series was available.

Example response

{
  "location": {
    "name": "Boston",
    "region": "MA",
    "country": "US",
    "timezone": "America/New_York",
    "county": "Suffolk",
    "zip": "02108"
  }
}

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

    6 more changes in this revision