GET /v1/forecast/window

$0.02realtimetier: datacache 900sEngine B — Weather Intelligence

Summarizes a ≤12-hour window at a coordinate into decision-ready numbers (rain probability, expected precip, temp range in °C, max gust, comfort index) plus a one-sentence plain-English verdict. Built for agents planning events, deliveries, and travel.

Parameters

NameInTypeRequiredNotes
latquerynumberyes
lonquerynumberyes
startquerystringyes
endquerystringyes

Example

curl "https://x402-factory.com/v1/forecast/window?lat=40.7829&lon=-73.9654&start=2026-07-19T16%3A00%3A00Z&end=2026-07-19T22%3A00%3A00Z"

An evening event window in Central Park.

Example response

{
  "data": {
    "rain_probability": 0.12,
    "expected_precip_mm": 0,
    "temp_range": {
      "low": 18.1,
      "high": 20.6
    },
    "wind_max": 29.3,
    "comfort_index": 0.86,
    "severity_flags": [],
    "verdict": "Looks good: mild, highs near 69.1°F, low rain risk."
  },
  "meta": {
    "endpoint": "/v1/forecast/window",
    "version": "1.0.0",
    "generated_at": "2026-08-18T22:54:16.977Z",
    "freshness": "realtime",
    "sources": [
      "stub-model"
    ],
    "request_id": "req_00000000",
    "docs": "https://x402-factory.com/docs/weather.forecast-window",
    "data_mode": "live"
  }
}

Response schema (data payload)

{
  "type": "object",
  "properties": {
    "rain_probability": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
    },
    "expected_precip_mm": {
      "type": "number"
    },
    "temp_range": {
      "type": "object",
      "properties": {
        "low": {
          "type": "number"
        },
        "high": {
          "type": "number"
        }
      },
      "required": [
        "low",
        "high"
      ],
      "additionalProperties": false
    },
    "wind_max": {
      "type": "number"
    },
    "comfort_index": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
    },
    "severity_flags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "verdict": {
      "type": "string"
    }
  },
  "required": [
    "rain_probability",
    "expected_precip_mm",
    "temp_range",
    "wind_max",
    "comfort_index",
    "severity_flags",
    "verdict"
  ],
  "additionalProperties": false
}

The platform wraps every payload in an envelope: { "data": …, "meta": { endpoint, version, generated_at, freshness, sources, request_id, docs, data_mode } }.

Payment (x402)

Unpaid requests receive 402 with payment requirements (accepts). Pay $0.02 in USDC on Base per call via an X-PAYMENT header — see docs.x402.org. With PAYMENT_MODE=disabled (local dev) the endpoint is open.

Errors

StatusCodeMeaning
400INVALID_PARAMSInput failed validation; message lists the offending fields.
404NOT_FOUNDNo matching resource; suggestion may point to a sibling endpoint.
410RESOLVEDMarket/event settled; body includes a resolution summary.
503STALE_DATAUpstream feed down; stale data is never silently served beyond 2× cache TTL.
500INTERNALOur bug. The request_id helps us find it.