# UK River Flow, Rainfall & Groundwater (EA Hydrology) (`denjino/uk-river-flow-rainfall-groundwater`) Actor

Official river flow, river level, rainfall and groundwater readings from about 9,500 Environment Agency stations across England. Filter by river, station or distance from a point; daily summaries or 15-minute data, back decades.

- **URL**: https://apify.com/denjino/uk-river-flow-rainfall-groundwater.md
- **Developed by:** [John Martinez](https://apify.com/denjino) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## UK River Flow, Level, Rainfall & Groundwater (Environment Agency Hydrology)

Pull official hydrology data from the Environment Agency's gauge network across England: **river flow**, **river level (stage)**, **rainfall** and **groundwater level**, as tidy rows ready for spreadsheets, models and dashboards. No API key, no scraping of web pages: it uses the EA's open Hydrology API.

### What you can do

- Get daily mean/min/max river flow for any river (e.g. River Thames, River Severn) or near any point.
- Get daily rainfall totals or 15-minute rainfall from EA rain gauges.
- Track groundwater levels (metres above Ordnance Datum) at about 3,600 boreholes, with daily mean/min/max.
- List stations with WISKI IDs, catchment area, NRFA station ID and flood-info links.
- Go back years: many stations have decades of qualified history.

### Who uses this

Flood-risk and insurance analysts, hydrologists, environmental consultants, farmers and water-resource planners, anglers and paddlers, hydropower and drought monitoring, and data journalists.

### Input examples

- Daily flow on the Thames: `{"dataType": "waterFlow", "riverName": "River Thames", "maxStations": 5}`
- Rainfall near Oxford, 15-minute: `{"dataType": "rainfall", "latitude": 51.75, "longitude": -1.25, "radiusKm": 10, "resolution": "15min"}`
- Groundwater for a date range: `{"dataType": "groundwaterLevel", "stationIds": ["SP50_75"], "startDate": "2025-01-01", "endDate": "2025-12-31"}`
- Station directory: `{"mode": "stations", "dataType": "waterFlow", "riverName": "River Severn"}`

### Output

One row per station and day (or 15-minute reading): `stationId`, `stationName`, `riverName`, `latitude`, `longitude`, `distanceKm`, `catchmentAreaKm2`, `dataType`, `date`, `dateTime`, `value` / `mean` / `min` / `max` / `total`, `unit`, `quality`, `completeness`, `sourceUrl`, `licence`.

### Notes

- Recent data is often marked "Unchecked" until the EA quality-checks it; some daily min/max series lag behind the mean.
- Covers England (EA). Scotland (SEPA) and Wales (NRW) are not included.

### Pricing

Pay per event: a small start fee plus a fraction of a cent per row. Use `maxResults` and `maxStations` to control cost.

### Licence

Contains Environment Agency information licensed under the [Open Government Licence v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).

# Actor input Schema

## `mode` (type: `string`):

Readings, or only the station directory (to find station IDs).

## `dataType` (type: `string`):

Which Environment Agency hydrology measurement to fetch.

## `resolution` (type: `string`):

Daily summaries or raw 15-minute readings. Groundwater daily rows are computed from the logged readings.

## `riverName` (type: `string`):

Optional exact river name, e.g. 'River Thames', 'River Severn'.

## `search` (type: `string`):

Optional text search on station name, e.g. 'Oxford'.

## `stationIds` (type: `array`):

Optional EA station references (WISKI IDs) like '1490TH' or station GUIDs. Use mode 'stations' to find them.

## `latitude` (type: `number`):

Optional. With longitude, finds stations within the radius, nearest first.

## `longitude` (type: `number`):

Optional longitude for the near-a-point search.

## `radiusKm` (type: `integer`):

Search radius around the point.

## `startDate` (type: `string`):

YYYY-MM-DD. Default: 30 days before the end date (2 days for 15-minute data).

## `endDate` (type: `string`):

YYYY-MM-DD. Default: yesterday. Records go back decades at many stations.

## `includeInactive` (type: `boolean`):

By default only active stations are used.

## `maxStations` (type: `integer`):

How many stations with data to include.

## `maxResults` (type: `integer`):

Cap on total rows (0 = no cap). You pay per row.

## Actor input object example

```json
{
  "mode": "readings",
  "dataType": "waterFlow",
  "resolution": "daily",
  "riverName": "River Thames",
  "radiusKm": 10,
  "includeInactive": false,
  "maxStations": 5,
  "maxResults": 1000
}
```

# Actor output Schema

## `results` (type: `string`):

One row per station and period.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "riverName": "River Thames"
};

// Run the Actor and wait for it to finish
const run = await client.actor("denjino/uk-river-flow-rainfall-groundwater").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "riverName": "River Thames" }

# Run the Actor and wait for it to finish
run = client.actor("denjino/uk-river-flow-rainfall-groundwater").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "riverName": "River Thames"
}' |
apify call denjino/uk-river-flow-rainfall-groundwater --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,denjino/uk-river-flow-rainfall-groundwater"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/wL5p91E8HzWmEUQ0o/builds/ofef2uDcpvJggilYL/openapi.json
