River flood outlook (GloFAS)
GET /api/flood-outlookRiver flood forecast, 1-30 days: GloFAS discharge at the main river near a point, rated against its own 2 to 50-year return levels...
Details
River flood forecast, 1-30 days: GloFAS discharge at the main river near a point, rated against its own 2 to 50-year return levels, with the peak's return period and an outlook word. Not an official warning. ?place=Cologne. Weather data by Open-Meteo.com (CC BY 4.0). Contains modified Copernicus Emergency Management Service information (GloFAS). 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 50.94. |
lon | number | no | Longitude, -180 to 180 (with lat) The example sends 6.96. |
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. |
days | number | no | Forecast days, 1-30 (default 30) The example sends 30. |
snap | boolean | no | Take the largest river cell within about 5 km of the point (default true); false reads the point's own cell |
Example request
curl -i "https://agent402.tools/api/flood-outlook?lat=50.94&lon=6.96&days=30"
Watch a call get paid
GET /api/flood-outlook$0.005 USDCPAYMENT-SIGNATUREon 14 chains200 OKAgent402-ReceiptEd25519Example response
{
"lat": 50.94,
"lon": 6.96,
"days": 30,
"river": {
"cell": {
"lat": 50.975,
"lon": 6.925
},
"distanceKm": 4.6,
"snapped": true,
"dischargeNow": 1184.8,
"unit": "m³/s"
},
"returnLevels": {
"2": 6006,
"5": 7683,
"10": 8792,
"20": 9857,
"50": 11235,
"years": 25,
"firstYear": 1997,
"lastYear": 2021
},
"peak": {
"date": "2026-12-29",
"median": 1357.3,
"max": 3889.5,
"returnPeriodYears": 1,
"returnPeriodYearsHighestMember": 1.1
},
"outlook": "normal",
"daily": [
{
"date": "2026-12-05",
"median": 971.8,
"p25": 967.3,
"p75": 976.2,
"min": 960.6,
"max": 992.1,
"returnPeriodYears": 1
}
],
"method": "Return levels: a Gumbel fit (method of moments) to the cell's annual maximum daily discharge in the GloFAS reanalysis (1984-2022, years with at least 300 days). Level: severe when the forecast median reaches the 20-year level; high at the 5-year level, or the highest member at the 20-year level; elevated at the 2-year level, or the highest member at the 5-year level; otherwise normal.",
"caveat": "GloFAS model output on a 5 km grid, not an official flood warning: the cell may not be the river you mean, and local defenses and small streams are not modeled. Follow your national hydrological service for warnings.",
"source": "computed from Open-Meteo flood data (GloFAS), flood-api.open-meteo.com (CC BY 4.0)",
"credit": "Contains modified Copernicus Emergency Management Service information (GloFAS). 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 | 50.94 |
lon | number | yes | 6.96 |
days | number | yes | 30 |
river | object | yes | 5 fields: cell, distanceKm, snapped, dischargeNow, unit |
returnLevels | object | yes | 8 fields: 2, 5, 10, 20, 50, years and 2 more |
peak | object | yes | 5 fields: date, median, max, returnPeriodYears and 1 more |
outlook | string | yes | normal |
daily | array of objects | yes | 1 item in the example |
method | string | yes | Return levels: a Gumbel fit (method of moments) to the cell's annual maximum ... |
caveat | string | yes | GloFAS model output on a 5 km grid, not an official flood warning: the cell m... |
source | string | yes | computed from Open-Meteo flood data (GloFAS), flood-api.open-meteo.com (CC BY... |
credit | string | yes | Contains modified Copernicus Emergency Management Service information (GloFAS... |
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": "flood-outlook",
"params": {
"lat": 50.94,
"lon": 6.96,
"days": 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.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/flood-outlook?lat=50.94&lon=6.96&days=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/flood-outlook?lat=50.94&lon=6.96&days=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