# England & Wales Approved Food Establishment Change Signals (`starshaped_bullsnake/england-wales-approved-food-establishment-change-signals`) Actor

Monitor the official FSA daily master feed for meaningful changes to approved food establishments in England and Wales.

- **URL**: https://apify.com/starshaped\_bullsnake/england-wales-approved-food-establishment-change-signals.md
- **Developed by:** [Starshape Tools](https://apify.com/starshaped_bullsnake) (community)
- **Categories:** Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $15.00 / 1,000 approved food establishment change signals

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

## England & Wales Approved Food Establishment Change Signals

Monitor meaningful lifecycle and scope changes in the Food Standards Agency's official **Approved Food Establishments - Daily update**. This Actor is not a Food Hygiene Rating monitor and does not claim to determine an establishment's complete legal status.

### Signals

The Actor emits exactly one Dataset record for one establishment transition, even when several monitored fields change together. `changedFields`, `before`, and `after` preserve the combined transition.

- `ESTABLISHMENT_ADDED`
- `ESTABLISHMENT_NO_LONGER_LISTED`
- `APPROVED_ACTIVITY_CHANGED`
- `SPECIES_SCOPE_CHANGED`
- `COMPETENT_AUTHORITY_CHANGED`
- `TRADING_NAME_CHANGED`

It never labels disappearance as closure or revocation. A no-longer-listed signal requires absence from two consecutive clean England/Wales observations and states only that the approval number is no longer listed in this product scope.

### Source and geography

Every live run resolves and downloads the full official FSA daily master CSV from the [FSA data catalogue](https://data.food.gov.uk/catalog/datasets/954fb951-97a9-4953-9ebc-4fb30ddeb0d6). The source is normally updated daily at 7am with the status at close of business on the previous day.

The complete CSV is parsed and its raw geography profile is validated first. Only rows whose `Country` is `England` or `Wales` enter the business snapshot, diff, removal confirmation, or signals. Northern Ireland, Jersey, Isle of Man, and Guernsey remain visible only as aggregate source diagnostics. A blank or previously unknown Country fails the cycle without changing the snapshot.

### Baseline, duplicates, and safety

The first valid live run stores a full England/Wales baseline and emits zero signals (`BASELINE_INITIALIZED`). `maxItems` limits only Dataset emission; it never truncates acquisition, validation, or snapshot state.

`AppNo` is the stable key after trimming, Unicode normalization, and safe case normalization; internal whitespace is not rewritten. Blank or duplicate in-scope keys are quarantined per key. A duplicate cannot overwrite an accepted entity or advance its removal counter. When a duplicate becomes unique, its first clean observation is a silent per-key baseline. Up to the supplied historical high of four duplicate keys is treated as known small-source noise. Beyond that profile, an in-scope duplicate-key rate above 0.2%, or a blank-key rate above 0.1%, fails the complete cycle. The ratio guard is more than 2.6 times the supplied historical rate of four keys among roughly 5,300 rows.

HTTP, CSV, schema, geography, key-rate, or major row-count anomalies produce no business Dataset records and do not mutate the accepted snapshot. Dataset and `OUTPUT` persistence complete before snapshot commit.

### Privacy

V1 neither detects nor emits address changes. It stores no address or contact fields. When the source says `AddressWithheld = Yes`, the Actor never enriches, infers, or reconstructs the hidden address.

### Sample mode

Use `{ "mode": "sample", "maxItems": 30 }` for a deterministic non-empty demonstration through the production normalization and diff logic. Sample mode makes zero external HTTP requests, never opens the production named key-value store, and never mutates the production snapshot.

### Licence and attribution

Source: Food Standards Agency, **Approved Food Establishments - Daily update**. Contains Food Standards Agency information licensed under the [Open Government Licence v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/). No FSA rating image or logo is used.

# Actor input Schema

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

Live official comparison or isolated sample demonstration.

## `signalTypes` (type: `array`):

Optional signal-type filter.

## `approvalNumbers` (type: `array`):

Optional normalized FSA approval-number filter.

## `baselineOnly` (type: `boolean`):

Refresh the full validated baseline without emitting business signals.

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

Dataset output limit only; acquisition, validation, and the full snapshot are never truncated.

## Actor input object example

```json
{
  "mode": "sample",
  "baselineOnly": false,
  "maxItems": 30
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `OUTPUT` (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 = {
    "mode": "sample",
    "maxItems": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("starshaped_bullsnake/england-wales-approved-food-establishment-change-signals").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 = {
    "mode": "sample",
    "maxItems": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("starshaped_bullsnake/england-wales-approved-food-establishment-change-signals").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 '{
  "mode": "sample",
  "maxItems": 30
}' |
apify call starshaped_bullsnake/england-wales-approved-food-establishment-change-signals --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,starshaped_bullsnake/england-wales-approved-food-establishment-change-signals"
        }
    }
}
```

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/lZBrp5D4Uuk8Tul4H/builds/DnwXubmlFcUGb8Ctz/openapi.json
