Forecast stability across runs
GET /api/forecast-skillHow the forecast for one date moved across the last 7 daily runs at any place: the high, low and precipitation each run forecast for that date...
Details
How the forecast for one date moved across the last 7 daily runs at any place: the high, low and precipitation each run forecast for that date, by lead time in days, with the spread across runs and the change from the oldest run to the newest. For dates from 2024-01-01 to 16 days ahead. By coordinates or place name. Cached for up to 15 minutes. ?place=New York&date=2026-12-05. 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) The example sends 40.7128. |
lon | number | no | Longitude, -180 to 180 (with lat) The example sends -74.006. |
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 Up to 100 characters. |
date | string | no | The forecast date, YYYY-MM-DD, 2024-01-01 to 16 days ahead (default today, UTC) |
units | string | no | celsius (default) or fahrenheit; precipitation in mm |
Example request
curl -i "https://agent402.tools/api/forecast-skill?lat=40.7128&lon=-74.006"
Watch a call get paid
GET /api/forecast-skill$0.005 USDCPAYMENT-SIGNATUREon 14 chains200 OKAgent402-ReceiptEd25519Example response
{
"lat": 40.7128,
"lon": -74.006,
"date": "2026-12-01",
"timezone": "America/New_York",
"units": "°C",
"runs": [
{
"leadDays": 0,
"issued": "2026-12-01",
"tempMax": 6.2,
"tempMin": 1.4,
"precipitation": 0
},
{
"leadDays": 3,
"issued": "2026-11-28",
"tempMax": 7.9,
"tempMin": 2.2,
"precipitation": 1.2
},
{
"leadDays": 7,
"issued": "2026-11-24",
"tempMax": 9.1,
"tempMin": 3.5,
"precipitation": 3.4
}
],
"spread": {
"tempMax": 2.9,
"tempMin": 2.1,
"precipitation": 3.4
},
"change": {
"fromLeadDays": 7,
"toLeadDays": 0,
"tempMax": -2.9,
"tempMin": -2.1,
"precipitation": -3.4
},
"method": "leadDays N is the run made N days before the date (0 is the newest). Each value is the day's high, low or total from that run's hourly forecast in the location's time zone. Raw model output at the grid point.",
"source": "previous-runs-api.open-meteo.com (CC BY 4.0)",
"attributionText": "Weather data by Open-Meteo.com (CC BY 4.0).",
"sourceUrl": "https://open-meteo.com/",
"licenseUrl": "https://creativecommons.org/licenses/by/4.0/"
}| Field | Type | Always present | In the example |
|---|---|---|---|
lat | number | yes | 40.7128 |
lon | number | yes | -74.006 |
date | string | yes | 2026-12-01 |
timezone | string | yes | America/New_York |
units | string | yes | °C |
runs | array of objects | yes | 3 items in the example |
spread | object | yes | 3 fields: tempMax, tempMin and 1 more |
change | object | yes | 5 fields: fromLeadDays, toLeadDays, tempMax, tempMin and 1 more |
method | string | yes | leadDays N is the run made N days before the date (0 is the newest). Each val... |
source | string | yes | previous-runs-api.open-meteo.com (CC BY 4.0) |
attributionText | string | yes | Weather data by Open-Meteo.com (CC BY 4.0). |
sourceUrl | string | yes | https://open-meteo.com/ |
licenseUrl | string | yes | https://creativecommons.org/licenses/by/4.0/ |
From an MCP client
catalog.call {
"slug": "forecast-skill",
"params": {
"lat": 40.7128,
"lon": -74.006
}
}Hosted connector (https://agent402.tools/mcp): paid in the call. Stdio package (npx -y agent402-mcp@0.19.2): pays from a wallet or AGENT402_CREDITS_KEY.
Errors and behavior
- Pay $0.005 per call over x402 or MPP. Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key (
Authorization: Bearer a402_...) also pays it. - Every field is optional; a rejected input answers 4xx with
error,tool,expected,requiredandexample. - On this route, a call ending in any status of 400 or above is not charged over x402, MPP or a credits key. A Tempo push credential pays before the call; a failure is a refund owed.
- A
POSTwith a JSON body is served as this GET. - An
Idempotency-Keyreplays the first 200 uncharged (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.005" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.AGENT_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/forecast-skill?lat=40.7128&lon=-74.006");Get a wallet or run npx -y agent402-mcp@0.19.2 wallet new.
The quote (Python)
import base64, json, urllib.error, urllib.request
req = urllib.request.Request("https://agent402.tools/api/forecast-skill?lat=40.7128&lon=-74.006", method="GET", headers={})
try:
urllib.request.urlopen(req)
except urllib.error.HTTPError as e:
quote = json.loads(base64.b64decode(e.headers["PAYMENT-REQUIRED"]))
print(e.code, [(a["network"], a["amount"]) for a in quote["accepts"]]) # the price, per chain, in base units