# Scotland River Levels, Flow, Rainfall & Tides (SEPA) (`denjino/scotland-river-levels-rainfall-sepa`) Actor

Official SEPA hydrometric data for Scotland: river level and flow, rainfall, groundwater and tidal level from about 750 stations. Filter by river, catchment, station or distance; daily summaries or 15-minute data, decades back. No API key.

- **URL**: https://apify.com/denjino/scotland-river-levels-rainfall-sepa.md
- **Developed by:** [John Martinez](https://apify.com/denjino) (community)
- **Categories:** Integrations
- **Security:** Limited permissions
- **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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Scotland River Levels, Flow, Rainfall & Tides (SEPA)

River levels, flow, rainfall, groundwater and tides for Scotland, from about 750 official SEPA stations, as 15-minute or daily rows. Name a river or give a point and radius.

Official hydrometric data from the **Scottish Environment Protection Agency (SEPA)** time series service, as clean rows. No API key, no account.

- **River level (stage)** at ~400 gauges, **river flow** at ~320, **rainfall** at ~380 gauges, **groundwater level** at ~58 boreholes and **tidal level** at 22 coastal gauges.
- **Daily** mean/min/max (rainfall: daily total) or **15-minute** readings (hourly for groundwater; hourly totals for rainfall).
- Records go back decades at many sites.
- Filter by **river**, **catchment**, **station name**, **station IDs** or **distance from a point** (nearest first).
- A **station directory** mode lists stations with coordinates, river, catchment, catchment area, gauge datum and record coverage.

Pairs with our England tool, *UK River Flow, Rainfall & Groundwater (EA Hydrology)*, for GB-wide coverage.

### Uses

Flood and drought analysis, hydropower and distillery water planning, fishing and paddling conditions, insurance and property risk, agriculture, research and dashboards.

### Example input

```json
{ "dataType": "riverLevel", "riverName": "Tay", "maxStations": 3, "maxResults": 100 }
```

### Output (one row per station and period)

`stationId, stationName, riverName, catchment, latitude, longitude, distanceKm, catchmentAreaKm2, gaugeDatumMaOD, dataType, resolution, date, dateTime, unit, value | mean | min | max | total, qualityCode, sourceUrl, licence, scrapedAt`. Rows are newest first.

### Run it on a schedule

Save your input as a task and add it to Apify Schedules (for example, daily at 07:00) to get a fresh table every day. Each run can be pushed to Google Sheets, a webhook, Slack or your database through Apify integrations.

### Pricing

**$1.00 per 1,000 rows** on the Free and Bronze plans, $0.90 per 1,000 on Silver and $0.80 per 1,000 on Gold, plus a start fee of $0.005 per GB of run memory. A typical run of a few hundred rows costs well under $1.

### Notes

- Recent data is provisional and may be revised by SEPA. `qualityCode` is SEPA's own code, passed through as published.
- SEPA limits how much data any one user can download per day. Very large pulls may be cut short; split them by date.
- If SEPA's service is down the run finishes with a single `UPSTREAM_OUTAGE` row (not charged) instead of failing.

### Licence

Contains SEPA data © Scottish Environment Protection Agency, licensed under the [Open Government Licence v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/). Not affiliated with SEPA.

### Like this? See my other UK data Actors

- [UK EV charging stations – live status & prices](https://apify.com/denjino/uk-ev-chargepoints-open-data)
- [NHS GP practices, pharmacies & dentists list](https://apify.com/denjino/nhs-ods-organisations)
- [UK water quality & sewage data (EA)](https://apify.com/denjino/uk-water-quality-archive)
- [UK air quality – live DEFRA readings](https://apify.com/denjino/uk-air-quality-defra)
- [UK product recalls & MHRA alerts monitor](https://apify.com/denjino/uk-safety-alerts-recalls)
- [England river levels, flow & rainfall (EA)](https://apify.com/denjino/uk-river-flow-rainfall-groundwater)
- [Ireland river levels & flow (OPW)](https://apify.com/denjino/ireland-river-levels-flow-opw)

# Actor input Schema

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

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

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

Which SEPA hydrometric measurement to fetch.

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

Daily summaries or sub-daily readings.

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

Optional, partial match, e.g. 'Tay', 'Clyde', 'Spey'.

## `catchment` (type: `string`):

Optional catchment name, partial match, e.g. 'Tweed', 'Forth'.

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

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

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

Optional SEPA station numbers like '234150'. 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 sub-daily data).

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

YYYY-MM-DD. Default: today. Many stations go back to the 1970s-1990s.

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

How many matching stations to pull readings for.

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

Stop after this many rows (0 = no limit). You pay per row.

## Actor input object example

```json
{
  "mode": "readings",
  "dataType": "riverLevel",
  "resolution": "daily",
  "riverName": "Tay",
  "radiusKm": 20,
  "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": "Tay"
};

// Run the Actor and wait for it to finish
const run = await client.actor("denjino/scotland-river-levels-rainfall-sepa").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": "Tay" }

# Run the Actor and wait for it to finish
run = client.actor("denjino/scotland-river-levels-rainfall-sepa").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": "Tay"
}' |
apify call denjino/scotland-river-levels-rainfall-sepa --silent --output-dataset

```

## MCP server setup

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

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/Ux9JVJd60TdieJbVi/builds/DxGK5mj2VWHNUREai/openapi.json
