# UK Food Hygiene Ratings — New & Changed Alerts (`magnova/uk-food-hygiene-monitor`) Actor

UK food hygiene ratings: search the official Food Standards Agency register by council, business name or type, or watch an area and get alerts only for new establishments and rating changes. Pay per record, no start fee.

- **URL**: https://apify.com/magnova/uk-food-hygiene-monitor.md
- **Developed by:** [Magnova](https://apify.com/magnova) (community)
- **Categories:** Automation, Lead generation
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.50 / 1,000 establishment records

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

## UK Food Hygiene Ratings — New & Changed Alerts

Search the UK's official food hygiene ratings, or **watch an area, a chain or a business type and get told only when a new establishment appears or a rating changes**.

Every record is a real rated food business from the Food Standards Agency's official register — business name and type, the hygiene rating (0–5 in England, Wales and Northern Ireland; Pass / Improvement Required in Scotland), the rating date, the inspection sub-scores for hygiene, structural compliance and confidence in management, the published address and postcode, the inspecting council and the map coordinates. The register covers over 600,000 establishments and is updated live as councils publish inspections. Run the same filters in **watch mode** on a schedule and the actor remembers what it has seen: later runs deliver only `NEW` establishments and rating changes (`RATING_UP`, `RATING_DOWN`, `RATING_CHANGED` — with the previous rating on the record).

Built for AI agents and automations: pay per record, no start fee, and a server mode that answers a POST with the records in the response — no run to start, no dataset to poll.

### Two modes

**Search** — returns the matching establishments for your filters.

**Watch** — the first run stores the current matching set and returns it as a baseline. Later runs return only new establishments and rating changes. Schedule it daily and you hear about a council area again only when a business opens or gets re-inspected. Watch state is kept per filter set (local authority + name + business type + rating filter + sinceDate), in a named key-value store in the account running the actor.

### Example input

```json
{
  "localAuthorityId": 120,
  "mode": "search",
  "maxResults": 20
}
```

### Example output

One `ESTABLISHMENT` record (a real record from the live register, Westminster):

```json
{
  "recordType": "ESTABLISHMENT",
  "changeType": "SEARCH",
  "fhrsid": 641285,
  "businessName": "28-50 Wine Workshop and Kitchen",
  "businessType": "Restaurant/Cafe/Canteen",
  "businessTypeId": 1,
  "ratingValue": "2",
  "ratingKey": "fhrs_2_en-gb",
  "rating": 2,
  "ratingDate": "2026-10-03",
  "previousRatingValue": null,
  "scoresHygiene": 5,
  "scoresStructural": 15,
  "scoresConfidenceInManagement": 10,
  "addressLine1": "15-17 MARYLEBONE LANE",
  "addressLine2": null,
  "addressLine3": "LONDON",
  "addressLine4": null,
  "postcode": "W1U 2NE",
  "localAuthorityName": "Westminster",
  "localAuthorityCode": "533",
  "latitude": 51.5163484,
  "longitude": -0.1504508,
  "schemeType": "FHRS",
  "newRatingPending": false,
  "source": "UK food hygiene ratings via the Food Standards Agency FHRS API (Open Government Licence)"
}
```

Each run also ends with a free `SUMMARY` record (matches found, records delivered, watch check count). A failed check produces a free `ERROR` record instead of charging you for nothing.

### Filters

At least one of the first three is required — the FSA API refuses unfiltered queries.

- **localAuthorityId** — the council's FSA ID (120 = Westminster, 93 = Camden, 374 = Birmingham, 180 = Manchester, 197 = Aberdeen City; 363 authorities in total).
- **name** — only businesses whose name contains this text; the way to track a chain ("Greggs", "Costa") across the whole UK.
- **businessTypeId** — 1 = Restaurant/Cafe/Canteen, 7844 = Takeaway/sandwich shop, 7843 = Pub/bar/nightclub, 7842 = Hotel/bed & breakfast/guest house, 7840 = supermarkets/hypermarkets, and the rest of the FSA type list.
- **rating** + **ratingOperator** — e.g. rating `2` with `LessThanOrEqual` lists every establishment rated 2, 1 or 0 in the area. `AwaitingInspection` finds newly registered businesses that have not been inspected yet — the new-openings feed. Numeric filters match nothing in Scotland (FHIS outcomes), and Pass / Improvement Required match nothing in FHRS areas.
- **sinceDate** — a caller-held cursor: only establishments rated on or after this date are delivered.
- **maxResults** — cap on delivered records per run (1–1000). In watch mode it caps the baseline delivery and the alerts per check; a check scans the whole matching set (up to 10,000 establishments) for changes.

Scotland note: FHIS ratings are carried exactly as published (`Pass` / `Improvement Required`) and are never converted onto the 0–5 scale — the `rating` field stays null for them and `ratingValue` carries the real outcome. Scottish records publish no inspection sub-scores, so the three score fields are null there.

### Pricing

Pay per event, no start fee. You never pay for ERROR or SUMMARY records.

| Event | What you get | Price (FREE/BRONZE) | SILVER | GOLD and above |
|---|---|---|---|---|
| Establishment record | One establishment record, in search mode or as a watch baseline row | $0.005 | $0.00425 | $0.0035 |
| Rating change alert | One NEW establishment or rating change delivered by a watch check | $0.01 | $0.0085 | $0.007 |

That is **$5 per 1,000 establishment records** and $10 per 1,000 alerts. Worked example: watching one council area with a 400-establishment baseline costs $2.00 once; after that, a daily check that finds 3 new openings and 2 rating changes costs $0.05 — about **$1.50 a month** for a typical area, and quiet days with no changes cost nothing.

`maxTotalChargeUsd` optionally caps a run's total charge.

**Not charged:**

- ERROR records (a failed check)
- SUMMARY records (one per run)
- Establishments beyond your maxResults or maxTotalChargeUsd
- Watch checks that find no new establishments and no rating changes

### Server mode

The actor is server-callable (Apify Standby, single-tenant): POST the same JSON input to the actor's server URL and get `{"records": [...], "summary": {...}}` back in the response — no run to start, no dataset to poll. Watch mode works over the server too; state persists in the caller's own storage, so repeated calls track the same watches. Server requests deliver at most 100 records per request.

### API / MCP quickstart

Run it from code with the Apify API (your own token), or attach it to an AI agent through Apify's MCP server:

```bash
curl -X POST "https://api.apify.com/v2/acts/magnova~uk-food-hygiene-monitor/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"localAuthorityId": 120, "rating": "2", "ratingOperator": "LessThanOrEqual", "maxResults": 50}'
```

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=magnova/uk-food-hygiene-monitor"
    }
  }
}
```

### Data source

Food hygiene ratings published by the UK Food Standards Agency through its FHRS API, under the Open Government Licence. The data is read from the FSA's public API — no account, no API key, nothing scraped from a login. Records are whitelist-parsed from the register's business fields only: the register's contact fields are never read into a record, and no personal data is collected or delivered. Ratings are the FSA's published ratings as at the moment of the run; the FSA remains the authoritative source.

⭐ Finding this useful? A rating on the Apify Store helps other users discover this Actor — thank you!

# Actor input Schema

## `businessTypeId` (type: `integer`):

The FSA business type ID: 1 = Restaurant/Cafe/Canteen, 7844 = Takeaway/sandwich shop, 7843 = Pub/bar/nightclub, 7842 = Hotel/bed & breakfast/guest house, 7840 = Retailers - supermarkets/hypermarkets, 4613 = Retailers - other, 7846 = Mobile caterer, 7841 = Other catering premises, 7845 = School/college/university, 5 = Hospitals/Childcare/Caring Premises, 7839 = Manufacturers/packers, 7838 = Farmers/growers, 7 = Distributors/Transporters, 14 = Importers/Exporters. Works alone (whole UK) or combined.

## `localAuthorityId` (type: `integer`):

The FSA local authority (council) ID to search: 120 = Westminster, 93 = Camden, 374 = Birmingham, 180 = Manchester, 197 = Aberdeen City. One of the 363 authorities in the FSA register. Combine with name or businessTypeId to narrow further, or leave unset and filter by name or type alone.

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

Maximum establishment records delivered per run (1-1000). Extra matching establishments beyond this are not delivered or charged. On a watch's first check this is also the baseline delivery size (the full matching set is still remembered); later checks deliver at most this many new/change alerts.

## `maxTotalChargeUsd` (type: `number`):

Optional hard cap on the total charge for this run, in USD, shared across establishment records and rating-change alerts. The run stops delivering charged records before the cap would be exceeded; ERROR and SUMMARY records are always free.

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

Search returns every matching establishment now. Watch stores the current matching set in the actor's storage: the first watch run returns it as a baseline, later runs return only establishments that are NEW or whose rating CHANGED since the previous check. Run watch mode on a schedule (or call the server URL) to track a council area, a chain name, or a business type.

## `name` (type: `string`):

Only establishments whose business name contains this text (case-insensitive), e.g. a chain name like Greggs or Costa. Up to 100 characters. Works alone (searches the whole UK) or combined with a local authority or business type.

## `rating` (type: `string`):

Only establishments with this rating. 0-5 are the FHRS ratings for England, Wales and Northern Ireland; Pass / ImprovementRequired are Scotland's FHIS outcomes (a numeric filter matches nothing in Scotland, and vice versa). AwaitingInspection finds newly registered businesses that have not been inspected yet. Leave unset for all ratings.

## `ratingOperator` (type: `string`):

How the rating filter compares: Equal (default), LessThanOrEqual (e.g. rating 2 = every establishment rated 2, 1 or 0 — the low-rated list), or GreaterThanOrEqual. Only applies when a rating is set, and comparisons only rank the numeric 0-5 FHRS ratings.

## `sinceDate` (type: `string`):

Caller-held cursor: only establishments whose rating date is on or after this date (YYYY-MM-DD) are delivered. Establishments with no rating date yet (awaiting inspection) are left out while a cursor is set. Applied on top of the other filters, in both modes.

## Actor input object example

```json
{
  "businessTypeId": 1,
  "localAuthorityId": 120,
  "maxResults": 100,
  "maxTotalChargeUsd": 1,
  "mode": "search",
  "name": "Greggs",
  "rating": "5",
  "ratingOperator": "Equal",
  "sinceDate": "2026-01-01"
}
```

# 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 = {
    "localAuthorityId": 120,
    "maxResults": 20,
    "mode": "search",
    "ratingOperator": "Equal"
};

// Run the Actor and wait for it to finish
const run = await client.actor("magnova/uk-food-hygiene-monitor").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 = {
    "localAuthorityId": 120,
    "maxResults": 20,
    "mode": "search",
    "ratingOperator": "Equal",
}

# Run the Actor and wait for it to finish
run = client.actor("magnova/uk-food-hygiene-monitor").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 '{
  "localAuthorityId": 120,
  "maxResults": 20,
  "mode": "search",
  "ratingOperator": "Equal"
}' |
apify call magnova/uk-food-hygiene-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,magnova/uk-food-hygiene-monitor"
        }
    }
}
```

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/rNrMFXdLqNsX70j9n/builds/pqXamg2oglxaaFMnA/openapi.json
