# Scottish Ombudsman (SPSO) Decision Watchdog (`hllerdgn80/spso-decision-watchdog`) Actor

Watch the Scottish Public Services Ombudsman's public decision reports the moment they publish — by organisation, sector (NHS, councils, housing associations, colleges, universities, prisons) or outcome (upheld/not upheld). Official free register, no login, no scraping tricks.

- **URL**: https://apify.com/hllerdgn80/spso-decision-watchdog.md
- **Developed by:** [Halil Erdogan](https://apify.com/hllerdgn80) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 1,000 results

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

## Scottish Ombudsman (SPSO) Decision Watchdog

Watches the **Scottish Public Services Ombudsman's** public Decision Report register
(spso.org.uk) — the official record of complaint findings against NHS boards, local
councils, housing associations, colleges, universities, prisons and the Scottish
Government. The SPSO is Scotland's separate ombudsman body (distinct from the
England & Wales Charity Commission / Local Government Ombudsman): it publishes every
decision report it issues, with the organisation, sector, subject, outcome and date, on
a free, public, keyless search page.

No login, no API key, no scraping tricks — this actor reads the same public HTML pages
a visitor's browser would, respecting `robots.txt` (which explicitly allows this path).

### What you get

One row per decision report matching your filters:

| Field | Description |
|---|---|
| `case_ref` | SPSO case reference number |
| `organisation` | The body complained about (NHS board, council, etc.) |
| `subject` | Complaint subject/category |
| `outcome` | e.g. "Upheld, recommendations", "Not upheld, no recommendations" |
| `report_date` | Month/year the report was published |
| `report_url` | Link to the full report on spso.org.uk |
| `summary` | Full case summary text (only when "Fetch full summary text" is on) |
| `recommendations` | What SPSO asked the organisation to do (same toggle) |
| `watch_label` | Your own tag, copied onto every row |
| `status` | `ok`, `invalid_input`, `http_error`, `network_error` or `parse_error` |

### Input

- **Organisation name contains** — free text matched against "Body complained about" (e.g. `NHS Lothian`, `Glasgow City Council`). Leave empty for all.
- **Sector** — one of Colleges, Health, Health and Social Care, Housing Associations, Local Government, Prisons, Scottish Government and Devolved Administration, Universities, Water.
- **Outcome contains** — free text matched against the outcome label (e.g. `Upheld`, `Not upheld`).
- **Report date from / to** — `YYYY-MM-DD`, filters on the report's publication date.
- **Fetch full summary text** — when on (default), the actor also opens each report's own page for the case summary and recommendations (one extra request per row). Turn off for a faster, list-only run.
- **Label for this watch** — a tag copied onto every row, useful when several scheduled watches share one dataset.
- **Maximum reports to return** — stops paging once this many rows are collected (default 50, max 1000).

### Example uses

- Track every new SPSO finding against a specific health board or council for a local newsroom or watchdog site.
- Monitor "Upheld" decisions across all NHS boards to spot recurring patterns.
- Build a compliance/PR alert feed for a housing association or university.

### Notes

- Leave every filter empty to pull the newest decision reports across all of Scotland.
- The SPSO's own outcome list uses ~19 exact wordings (e.g. "Some upheld, action taken by
  body to remedy, recommendations"); this actor matches on a loose *contains* search
  against that label rather than an internal numeric ID, since those IDs are not part of
  any published, stable API.
- This actor covers **Scotland only**. It does not cover the separate Local Government
  and Social Care Ombudsman (England) or Public Services Ombudsman for Wales.

# Actor input Schema

## `organisation` (type: `string`):

Free text matched against the 'Body complained about' field, e.g. 'NHS Lothian', 'Glasgow City Council', 'Edinburgh'. Leave empty to include every organisation.

## `sector` (type: `string`):

Restrict to one sector.

## `outcome` (type: `string`):

Free text matched against the outcome label, e.g. 'Upheld' or 'Not upheld'. Leave empty for every outcome (SPSO's own outcome list mixes several exact wordings — a loose text match is more reliable than the site's dropdown IDs, which are not guaranteed stable).

## `dateFrom` (type: `string`):

YYYY-MM-DD. Only reports published on or after this date.

## `dateTo` (type: `string`):

YYYY-MM-DD. Only reports published on or before this date.

## `fetchSummary` (type: `boolean`):

When on, the actor opens each decision report's own page to also collect the case summary and the recommendations text (one extra request per row). When off, only the list fields (case ref, organisation, sector, subject, outcome, date) are returned, which is faster and lighter.

## `watchLabel` (type: `string`):

Just a tag copied onto every output row (e.g. 'NHS Lothian watch') so several scheduled watches can be told apart in one dataset or across runs.

## `maxItems` (type: `integer`):

Stops paging through the SPSO register once this many rows have been collected.

## Actor input object example

```json
{
  "sector": "",
  "fetchSummary": true,
  "maxItems": 50
}
```

# Actor output Schema

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

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("hllerdgn80/spso-decision-watchdog").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("hllerdgn80/spso-decision-watchdog").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 '{}' |
apify call hllerdgn80/spso-decision-watchdog --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hllerdgn80/spso-decision-watchdog"
        }
    }
}
```

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/1Kcqtv3NbGq5MJRpX/builds/Z7qO00to4llArbKXp/openapi.json
