Weather probability (ensemble)
GET /api/weather-probabilityCached 10mProbability that a day's weather meets a condition, from up to 82 ensemble members (ECMWF IFS and NOAA GEFS): a high, low, rain total or wind past a threshold or inside a range. Send GET /api/weather-probability with no required fields (11 optional) and pay $0.01 per call over x402 or MPP (there is no free tier). It returns a JSON object with lat, lon, date, timezone, variable and 8 more.
Returns the member share, per-model counts and the spread. Any place by coordinates or name, up to 15 days ahead (all 82 to about 13 days, then NOAA's 31). Raw model output, not station-calibrated. ?place=Chicago&variable=temperature_max&units=fahrenheit&op=gte&value=40. Weather data by Open-Meteo.com (CC BY 4.0).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
lat | number | no | Latitude, -90 to 90 (with lon; wins over place) |
lon | number | no | Longitude, -180 to 180 (with lat) |
place | string | no | A city, town or region name instead of lat/lon, for example "Paris" or "Austin, TX" (not a street address); the answer echoes the place it resolved to |
date | string | no | Local date at the place, YYYY-MM-DD, up to 15 days ahead (default tomorrow, UTC); all 82 members reach about 13 days, the 31 NOAA members the rest |
variable | string | no | Daily value: temperature_max, temperature_min, temperature_mean, precipitation_sum, wind_speed_max (default temperature_max) |
units | string | no | celsius (default; wind in km/h) or fahrenheit (wind in mph); precipitation is always mm |
op | string | no | Threshold comparison: >=, >, <= or < (or gte, gt, lte, lt; default >=), with value |
value | number | no | Threshold in the variable's unit, with op |
min | number | no | Range lower end (included), instead of op/value |
max | number | no | Range upper end (included), instead of op/value |
rounding | string | no | none (default) or integer: round each member's value to a whole unit before counting, for brackets stated in whole degrees |
Example request
curl -i "https://agent402.tools/api/weather-probability?lat=41.8781&lon=-87.6298&variable=temperature_max&units=fahrenheit&op=%3E%3D&value=40"
Without payment this returns HTTP 402 Payment Required with the exact price for weather-probability; any x402 v2 or MPP client pays it and retries.
Example response
{
"lat": 41.8781,
"lon": -87.6298,
"date": "2026-11-18",
"timezone": "America/Chicago",
"variable": "temperature_max",
"unit": "°F",
"condition": {
"op": ">=",
"value": 40
},
"rounding": "none",
"probability": 0.7195,
"members": {
"total": 82,
"meeting": 59,
"byModel": [
{
"model": "ECMWF IFS ensemble",
"members": 51,
"meeting": 39,
"probability": 0.7647
},
{
"model": "NOAA GEFS ensemble",
"members": 31,
"meeting": 20,
"probability": 0.6452
}
]
},
"distribution": {
"min": 36.2,
"p10": 38.4,
"p25": 39.7,
"median": 41.3,
"p75": 42.8,
"p90": 44.1,
"max": 46.5,
"mean": 41.2,
"stdDev": 2.14
},
"method": "Each probability is the share of ensemble members whose value for the date meets the condition. Raw model output at the model grid point, not calibrated to a weather station.",
"source": "computed from Open-Meteo ensemble data, ensemble-api.open-meteo.com (CC BY 4.0)"
}| Field | Type | Always present | In the example |
|---|---|---|---|
lat | number | yes | 41.8781 |
lon | number | yes | -87.6298 |
date | string | yes | 2026-11-18 |
timezone | string | yes | America/Chicago |
variable | string | yes | temperature_max |
unit | string | yes | °F |
condition | object | yes | 2 fields: op, value |
rounding | string | yes | none |
probability | number | yes | 0.7195 |
members | object | yes | 3 fields: total, meeting, byModel |
distribution | object | yes | 9 fields: min, p10, p25, median, p75, p90 and 3 more |
method | string | yes | Each probability is the share of ensemble members whose value for the date me... |
source | string | yes | computed from Open-Meteo ensemble data, ensemble-api.open-meteo.com (CC BY 4.0) |
From an MCP client
catalog.call {
"slug": "weather-probability",
"params": {
"lat": 41.8781,
"lon": -87.6298,
"variable": "temperature_max",
"units": "fahrenheit",
"op": ">=",
"value": 40
}
}The hosted connector at https://agent402.tools/mcp needs a payment for weather-probability; the stdio package pays it from a wallet or from an AGENT402_CREDITS_KEY issued earlier. Local install: npx -y agent402-mcp@0.13.32.
Errors and behavior
- Every field is optional. An input the tool rejects returns an HTTP 4xx whose body carries
error,tool,expected,requiredandexample. - A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement runs after the tool and only on a successful response. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - Cached: an identical request within 10m is answered from cache with
X-Cache: hit. - A
POSTwith a JSON body to /api/weather-probability is served as this GET, with the body as the input. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.({ maxAmountPerPayment: "$0.01" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/weather-probability?lat=41.8781&lon=-87.6298&variable=temperature_max&units=fahrenheit&op=%3E%3D&value=40");Related tools
Weather market board (all cities)
One date, many cities: per city, the ensemble spread of a daily weather value (up to 82 members, ECMWF IFS and NOAA.
Weather market brackets (ensemble)
Forecast probability for every bracket of a weather market.
Current weather (global)
Current weather conditions for any location on Earth: temperature, feels-like, humidity, wind speed/direction/gusts.
Daily forecast (global)
7-day daily weather forecast for any location: high/low temp, precipitation sum and probability, max wind, UV index.
Weather forecast (US)
Multi-period weather forecast for a US location from api.weather.gov (NWS, public domain).
Hourly forecast (global)
48-hour hourly weather forecast for any location: temperature, precipitation probability and amount, wind, cloud cover.