# Flood & River Discharge API
> Global river-discharge and flood forecasting as an API, powered by the GloFAS (Global Flood Awareness System) model via Open-Meteo. For any coordinate on Earth, get a daily river-discharge forecast of up to 30 days — with the ensemble spread (mean, max and min across forecast members) so you can gauge uncertainty — plus up to 90 days of recent discharge history, and a quick current-situation summary with today's discharge and a 7-day outlook (peak day, max/min and rising/falling/stable trend). Discharge is reported in cubic metres per second. Ideal for flood early-warning and monitoring, insurance and reinsurance risk, agriculture and irrigation planning, hydropower, and environmental research. Data covers modelled rivers worldwide (none over open ocean). Open data via Open-Meteo / GloFAS.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/flood-api/..."
```

## Pricing
- **Free** (Free) — 3,630 calls/Mo, 2 req/s
- **Starter** ($4/Mo) — 48,600 calls/Mo, 8 req/s
- **Pro** ($13/Mo) — 241,000 calls/Mo, 20 req/s
- **Mega** ($35/Mo) — 1,196,000 calls/Mo, 50 req/s

## Endpoints

### Flood

#### `GET /v1/forecast` — River-discharge forecast (with ensemble)

**Parameters:**
- `lat` (query, required, string) — Latitude (-90..90) Example: `48.2`
- `lon` (query, required, string) — Longitude (-180..180) Example: `16.4`
- `days` (query, optional, string) — Forecast days (1-30, default 7)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/flood-api/v1/forecast?lat=48.2&lon=16.4"
```

**Response:**
```json
{
    "data": {
        "days": 7,
        "unit": "m³/s",
        "source": "GloFAS via Open-Meteo",
        "forecast": [
            {
                "date": "2026-05-31",
                "ensemble_max": 1237.8,
                "ensemble_min": 1232.11,
                "ensemble_mean": 1233.5,
                "river_discharge": 1232.11
            },
            {
                "date": "2026-06-01",
                "ensemble_max": 1184.77,
                "ensemble_min": 1165.81,
                "ensemble_mean": 1174.75,
                "river_discharge": 1173.9
            },
            {
                "date": "2026-06-02",
                "ensemble_max": 1269.57,
                "ensemble_min": 1176.61,
                "ensemble_mean": 1226.33,
                "river_discharge": 1226.44
            },
            {
                "date": "2026-06-03",
                "ensemble_max": 1478.11,
                "ensemble_min": 1255.03,
                "ensemble_mean": 1381.52,
                "river_discharge": 1398.59
            },
            {
                "date": "2026-06-04",
                "ensemble_max": 1736.8,
                "ensemble_min": 1308.18,
                "ensemble_mean": 1549.86,
                "river_discharge": 1598.56
            },
            {
                "date": "2026-06-05",
                "ensemble_max": 2151.78,
                "ensemble_min": 1398.59,
                "ensemble_mean": 1713.41,
                "river_discharge"
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/history` — Recent river-discharge history

**Parameters:**
- `lat` (query, required, string) — Latitude (-90..90) Example: `48.2`
- `lon` (query, required, string) — Longitude (-180..180) Example: `16.4`
- `days` (query, optional, string) — Past days (1-90, default 30)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/flood-api/v1/history?lat=48.2&lon=16.4"
```

**Response:**
```json
{
    "data": {
        "days": 30,
        "unit": "m³/s",
        "history": [
            {
                "date": "2026-05-01",
                "river_discharge": 1087.93
            },
            {
                "date": "2026-05-02",
                "river_discharge": 1095.48
            },
            {
                "date": "2026-05-03",
                "river_discharge": 1068.05
            },
            {
                "date": "2026-05-04",
                "river_discharge": 1029.39
            },
            {
                "date": "2026-05-05",
                "river_discharge": 996.7
            },
            {
                "date": "2026-05-06",
                "river_discharge": 978.49
            },
            {
                "date": "2026-05-07",
                "river_discharge": 987.55
            },
            {
                "date": "2026-05-08",
                "river_discharge": 1038.92
            },
            {
                "date": "2026-05-09",
                "river_discharge": 1087.93
            },
            {
                "date": "2026-05-10",
                "river_discharge": 1149.8
            },
            {
                "date": "2026-05-11",
                "river_discharge": 1152.45
            },
            {
                "date": "2026-05-12",
                "river_discharge": 1144.51
            },
            {
                "date": "2026-05-13",
                "river_discharge": 1217.99
        
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/point` — Current discharge + 7-day outlook

**Parameters:**
- `lat` (query, required, string) — Latitude (-90..90) Example: `48.2`
- `lon` (query, required, string) — Longitude (-180..180) Example: `16.4`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/flood-api/v1/point?lat=48.2&lon=16.4"
```

**Response:**
```json
{
    "data": {
        "point": {
            "note": "River discharge from the GloFAS hydrological model. No data over oceans or where no major river is modelled.",
            "unit": "m³/s",
            "location": {
                "lat": 48.2,
                "lon": 16.4
            },
            "outlook_7d": {
                "max": 1728.82,
                "min": 1173.9,
                "trend": "rising",
                "peak_date": "2026-06-06"
            },
            "current_date": "2026-05-31",
            "has_river_data": true,
            "current_discharge": 1232.11
        }
    },
    "meta": {
        "timestamp": "2026-05-31T15:05:34.830Z",
        "request_id": "aeca539e-9761-49cc-8864-101f892fdac2"
    },
    "status": "ok",
    "message": "Point summary retrieved",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Source, unit & options

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/flood-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "Daily river discharge for any coordinate. /v1/forecast = up to 30-day discharge forecast with ensemble spread (mean/max/min); /v1/history = up to 90 days of recent discharge; /v1/point = today's discharge plus a 7-day outlook (max/min/peak/trend). Pass lat & lon. Data exists for modelled rivers only (none over open ocean).",
        "unit": "m³/s (cubic metres per second)",
        "source": "Open-Meteo Flood API (GloFAS — Global Flood Awareness System)",
        "endpoints": [
            "/v1/forecast",
            "/v1/history",
            "/v1/point",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-05-31T15:05:34.902Z",
        "request_id": "bbe9d038-06e3-4f76-9349-7a91043abd5a"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/flood-api
OpenAPI spec: https://www.oanor.com/api/flood-api/openapi.json
