Forecast accuracy at a place
GET /api/forecast-accuracyHow accurate the weather forecast is at a place: over up to 92 past days, the day-ahead high, low and rain against the reanalysis, with bias, mean error...
Details
How accurate the weather forecast is at a place: over up to 92 past days, the day-ahead high, low and rain against the reanalysis, with bias, mean error, share within 2 degrees and rain hit rate. ?place=Chicago. Weather data by Open-Meteo.com (CC BY 4.0). Contains modified Copernicus Climate Change Service information. Neither the European Commission nor ECMWF is responsible for any use that may be made of the Copernicus information or data it contains.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
lat | number | no | Latitude, -90 to 90 (with lon; wins over place) The example sends 41.8781. |
lon | number | no | Longitude, -180 to 180 (with lat) The example sends -87.6298. |
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. |
start | string | no | First day, YYYY-MM-DD, 2022-01-01 or later (default 30 days before end) The example sends 2025-06-01. |
end | string | no | Last day, YYYY-MM-DD, at least 6 days ago (the default); at most 92 days in all The example sends 2025-06-30. |
units | string | no | celsius (default) or fahrenheit; rain in mm |
Example request
curl -i "https://agent402.tools/api/forecast-accuracy?lat=41.8781&lon=-87.6298&start=2025-06-01&end=2025-06-30"
Watch a call get paid
GET /api/forecast-accuracy$0.004 USDCPAYMENT-SIGNATUREon 14 chains200 OKAgent402-ReceiptEd25519Example response
{
"lat": 41.8781,
"lon": -87.6298,
"start": "2025-06-01",
"end": "2025-06-30",
"units": "°C",
"high": {
"days": 30,
"bias": -0.45,
"mae": 1.24,
"withinTolerancePercent": 80
},
"low": {
"days": 30,
"bias": -1.41,
"mae": 1.5,
"withinTolerancePercent": 80
},
"rain": {
"days": 30,
"hits": 6,
"misses": 6,
"falseAlarms": 0,
"correctNegatives": 18,
"accuracyPercent": 80,
"hitRatePercent": 50,
"falseAlarmPercent": 0
},
"days": [
{
"date": "2025-06-04",
"forecastHigh": 20.6,
"observedHigh": 23.5,
"forecastLow": 12,
"observedLow": 12.6,
"forecastRain": 3.8,
"observedRain": 31.8
}
],
"method": "Forecast: the stitched day-ahead forecast archive of the high-resolution models. Observed: the ERA5 reanalysis. Bias = mean (forecast - observed); within tolerance = |forecast - observed| at most 2 °C (3.6 °F). A rain day is 1 mm or more.",
"source": "historical-forecast-api.open-meteo.com and archive-api.open-meteo.com (CC BY 4.0)",
"credit": "Contains modified Copernicus Climate Change Service information. Neither the European Commission nor ECMWF is responsible for any use that may be made of the Copernicus information or data it contains.",
"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 | 41.8781 |
lon | number | yes | -87.6298 |
start | string | yes | 2025-06-01 |
end | string | yes | 2025-06-30 |
units | string | yes | °C |
high | object | yes | 4 fields: days, bias, mae and 1 more |
low | object | yes | 4 fields: days, bias, mae and 1 more |
rain | object | yes | 8 fields: days, hits, misses, falseAlarms, correctNegatives and 3 more |
days | array of objects | yes | 1 item in the example |
method | string | yes | Forecast: the stitched day-ahead forecast archive of the high-resolution mode... |
source | string | yes | historical-forecast-api.open-meteo.com and archive-api.open-meteo.com (CC BY ... |
credit | string | yes | Contains modified Copernicus Climate Change Service information. Neither the ... |
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-accuracy",
"params": {
"lat": 41.8781,
"lon": -87.6298,
"start": "2025-06-01",
"end": "2025-06-30"
}
}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.004 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.004" }); // 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-accuracy?lat=41.8781&lon=-87.6298&start=2025-06-01&end=2025-06-30");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-accuracy?lat=41.8781&lon=-87.6298&start=2025-06-01&end=2025-06-30", 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