# Ofsted Children's Home Reports to Supabase (`alkausari_mujahid/ofsted-inspection-reports-to-supabase`) Actor

Send Ofsted children's home inspection reports straight into your Supabase table: ratings, provider, manager, inspectors, capacity and home type. One row per home, updated on every run, so nothing duplicates. Schedule it daily. No Make or Zapier needed.

- **URL**: https://apify.com/alkausari\_mujahid/ofsted-inspection-reports-to-supabase.md
- **Developed by:** [Alkausari M](https://apify.com/alkausari_mujahid) (community)
- **Stats:** 1 total users, 1 monthly users, 88.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 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

**Sync Ofsted inspection reports directly into your Supabase table — no Make, no Zapier, no glue code.** Powered by the [Ofsted Reports Data Scraper](https://apify.com/alkausari_mujahid/ofsted-reports-data-scraper), which extracts full inspection data from PDF files on the Ofsted website. This Actor takes those results and upserts them straight into your Supabase database on every run.

***

### ✦ Highlights

- 🏠  **Full PDF extraction** — powered by [Ofsted Reports Data Scraper](https://apify.com/alkausari_mujahid/ofsted-reports-data-scraper), which pulls structured data directly from Ofsted PDF files
- 📅  **Date-range filtering** — fetch only inspections published in a specific window
- 🔄  **Upsert, not overwrite** — new records are inserted; existing ones are updated by URN, no duplicates
- 🧹  **Auto-deduplication** — multiple results for the same provider are collapsed to one row before sync
- 📊  **Dual output** — data lands in both your Supabase table and the Apify dataset simultaneously
- 🖱  **Zero code** — fill in credentials, paste a search URL, click Start

***

### ⚙ How it works

1. **Paste an Ofsted search URL** — apply your filters on [reports.ofsted.gov.uk](https://reports.ofsted.gov.uk/search) first (provision type, status, region), then copy the URL.
2. **Connect Supabase** — provide your project URL and API key. Create the table in advance using the SQL below; the Actor upserts into it.
3. **Click Start** — the Actor calls the [Ofsted Reports Data Scraper](https://apify.com/alkausari_mujahid/ofsted-reports-data-scraper), deduplicates by URN, and syncs everything to Supabase.

Example input, syncing every report published in one week:

```json
{
    "start_urls": [
        { "url": "https://reports.ofsted.gov.uk/search?q=&level_1_types=3&level_2_types%5B0%5D=11&status%5B0%5D=1&start=0&rows=10" }
    ],
    "latest_report_date_start": "2026-09-21",
    "latest_report_date_end": "2026-09-25",
    "only_latest_inspection": true,
    "max_reports": 0,
    "apify_api_token": "apify_api_...",
    "ofsted_actor_id": "UNmCLFqfH6zXa3Mfc",
    "supabase_url": "https://xxxx.supabase.co",
    "supabase_api_key": "eyJ...",
    "supabase_table": "ofsted_inspections"
}
```

- **`latest_report_date_start` / `latest_report_date_end`** — optional publication-date filters (`YYYY-MM-DD`). Leave blank to fetch only reports published today.
- **`only_latest_inspection`** — `true` (default) gives one record per provider; useful for dashboards and monitoring.
- **`max_reports`** — stops after this many reports. The default of `10` keeps test runs short; **set it to `0` for scheduled syncs** so every report is synced.

***

### 📦 What you get back

Each record written to Supabase (and the Apify dataset):

```json
{
    "unique_reference_number": "SC012345",
    "registered_provider": "Bright Futures Care Ltd",
    "registered_provider_address": "12 Oak Street, Manchester, M1 1AB",
    "provision_sub_type": "Children's home",
    "home_type": "social and emotional difficulties",
    "home_capacity": "4",
    "responsible_individual": "Jane Smith",
    "registered_manager": "John Doe",
    "inspection_dates": "15 March 2024",
    "inspection_type": "Unannounced",
    "overall_experiences_and_progress": "Good",
    "help_and_protection": "Good",
    "leadership_and_management": "Outstanding",
    "date_of_last_inspection": "10 September 2023",
    "overall_judgement_at_last_inspection": "Good",
    "enforcement_action_since_last_inspection": "None",
    "inspectors": "[{\"name\": \"Sarah Jones\", \"role\": \"Social Care Regulatory Inspector\"}]",
    "pdf_url": "https://files.ofsted.gov.uk/v1/file/..."
}
```

Also downloadable as **JSON, CSV, Excel, or HTML** from the run's **Storage** tab — or live via the Apify API.

***

### 📋 Input

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `start_urls` | Array | Yes | — | One or more Ofsted search page URLs |
| `apify_api_token` | String | Yes | — | Your Apify API token (used to call the Ofsted scraper) |
| `ofsted_actor_id` | String | Yes | `UNmCLFqfH6zXa3Mfc` | Actor ID of the underlying Ofsted scraper |
| `supabase_url` | String | Yes | — | Your Supabase project URL (`https://xxxx.supabase.co`) |
| `supabase_api_key` | String | Yes | — | Supabase service role or anon key |
| `supabase_table` | String | Yes | `ofsted_inspections` | Target table name in Supabase |
| `latest_report_date_start` | String | No | Today | First publication date to include (`YYYY-MM-DD`) |
| `latest_report_date_end` | String | No | Today | Last publication date to include (`YYYY-MM-DD`) |
| `only_latest_inspection` | Boolean | No | `true` | Return only the most recent inspection per provider |
| `include_unsupported` | Boolean | No | `false` | Include providers with unsupported inspection types |
| `max_reports` | Integer | No | `10` | Stop after this many reports. `0` means no limit; use it for scheduled syncs. |

***

### 🗄 Supabase table setup

Run this SQL once in your Supabase SQL editor before the first run:

```sql
CREATE TABLE ofsted_inspections (
    unique_reference_number                  TEXT NOT NULL PRIMARY KEY,
    pdf_url                                  TEXT,
    registered_provider                      TEXT,
    registered_provider_address              TEXT,
    provision_sub_type                       TEXT,
    responsible_individual                   TEXT,
    registered_manager                       TEXT,
    inspection_dates                         TEXT,
    inspection_type                          TEXT,
    overall_experiences_and_progress         TEXT,
    help_and_protection                      TEXT,
    leadership_and_management                TEXT,
    date_of_last_inspection                  TEXT,
    overall_judgement_at_last_inspection     TEXT,
    enforcement_action_since_last_inspection TEXT,
    inspectors                               JSONB,
    home_capacity                            TEXT,
    home_type                                TEXT
);
```

The `unique_reference_number` primary key is what enables upserts — re-running updates existing rows instead of inserting duplicates.

***

### 💡 Use cases

- **Regulatory monitoring** — automatically track newly published inspection outcomes for children's homes and social care providers.
- **Quality dashboards** — sync Ofsted ratings into Supabase and power a live Metabase, Grafana, or Retool dashboard — no manual CSV imports.
- **Compliance alerting** — run on a schedule; query Supabase to detect rating changes or new enforcement actions since the last sync.
- **Research & due diligence** — aggregate inspection histories across hundreds of providers for SQL/BI analysis.
- **Replace Make/Zapier pipelines** — eliminate the middleware layer and per-operation costs by keeping the pipeline on Apify.

***

### ❓ FAQ

**Why do I need an Apify API token?**
The sync runs the [Ofsted scraper](https://apify.com/alkausari_mujahid/ofsted-reports-data-scraper) in your Apify account, so its usage is billed to you. The token is stored as a secret.

**Do I need to create the table?**
Yes, once, with the SQL above.

**Which Supabase key should I use?**
The `service_role` key. The `anon` key usually can't write when Row Level Security is on.

**How do I keep the table up to date?**
Schedule a daily run in the evening, with the dates empty and Max Reports set to 0.

**Why did I only get 10 reports?**
Max Reports defaults to 10. Set it to 0.

**Can I load older reports?**
Yes, a week or two per run. Longer ranges can hit the scraper's 1-hour time limit.

**Will re-running create duplicates?**
No. Rows are updated by reference number, so re-running a failed run is safe.

**Is it legal?**
The reports are public under the [Open Government Licence v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/). Handle any personal data in them under UK GDPR.

***

### 📮 Support

Bugs, feature requests, or custom database targets (PostgreSQL, BigQuery, Airtable) — open an issue on Apify or email **<alkausarimujahid@gmail.com>**.

***

<sub>Built by **Alkausari M**. This Actor is independent and not affiliated with, endorsed by, or sponsored by Ofsted or His Majesty's Government. Ofsted inspection data is published under the Open Government Licence v3.0.</sub>

# Actor input Schema

## `start_urls` (type: `array`):

A search URLs from reports.ofsted.gov.uk

## `latest_report_date_start` (type: `string`):

Only reports Ofsted published on or after this date. Leave empty for today.

## `latest_report_date_end` (type: `string`):

Only reports Ofsted published on or before this date. Leave empty for today.

## `only_latest_inspection` (type: `boolean`):

Returns only the latest inspection per URN

## `include_unsupported` (type: `boolean`):

Include unsupported inspection types in results for later processing.

## `max_reports` (type: `integer`):

Maximum number of inspection reports to save. The run stops as soon as this many records have been saved. Set to 0 for no limit.

## `apify_api_token` (type: `string`):

The Apify API token of your account where the Ofsted Data Scraper Scraper is installed

## `ofsted_actor_id` (type: `string`):

The actor ID for the Ofsted Reports Data scraper

## `supabase_url` (type: `string`):

Your Supabase project URL (e.g. https://xxxx.supabase.co)

## `supabase_api_key` (type: `string`):

Use the service\_role key if Row Level Security is enabled on your table (recommended); the anon key may block inserts.

## `supabase_table` (type: `string`):

Name of the table in your Supabase database to upsert into. Must exist before the run (see the README for the CREATE TABLE statement).

## Actor input object example

```json
{
  "start_urls": [
    {
      "url": "https://reports.ofsted.gov.uk/search?q=&level_1_types=3&level_2_types%5B0%5D=11&status%5B0%5D=1&start=0&rows=10"
    }
  ],
  "only_latest_inspection": true,
  "include_unsupported": false,
  "max_reports": 10,
  "ofsted_actor_id": "UNmCLFqfH6zXa3Mfc",
  "supabase_table": "ofsted_inspections"
}
```

# 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 = {
    "start_urls": [
        {
            "url": "https://reports.ofsted.gov.uk/search?q=&level_1_types=3&level_2_types%5B0%5D=11&status%5B0%5D=1&start=0&rows=10"
        }
    ],
    "max_reports": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("alkausari_mujahid/ofsted-inspection-reports-to-supabase").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 = {
    "start_urls": [{ "url": "https://reports.ofsted.gov.uk/search?q=&level_1_types=3&level_2_types%5B0%5D=11&status%5B0%5D=1&start=0&rows=10" }],
    "max_reports": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("alkausari_mujahid/ofsted-inspection-reports-to-supabase").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 '{
  "start_urls": [
    {
      "url": "https://reports.ofsted.gov.uk/search?q=&level_1_types=3&level_2_types%5B0%5D=11&status%5B0%5D=1&start=0&rows=10"
    }
  ],
  "max_reports": 10
}' |
apify call alkausari_mujahid/ofsted-inspection-reports-to-supabase --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,alkausari_mujahid/ofsted-inspection-reports-to-supabase"
        }
    }
}
```

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/uVuJdUlSIkBtL6tiB/builds/4cOaLgrR9ebEa7MF2/openapi.json
