# UK Food Hygiene Ratings - 614K Establishments (FSA) (`j0401/uk-food-hygiene`) Actor

Every food establishment on the FSA register across the UK: name, address, postcode, local authority, business type, inspection date, hygiene/structural/management scores and the published rating. Search by name, council, postcode, rating or business type; aggregate ratings.

- **URL**: https://apify.com/j0401/uk-food-hygiene.md
- **Developed by:** [Wenhao Yang](https://apify.com/j0401) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.03 / 1,000 uk food establishment records

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

## UK Food Hygiene Ratings - 614K Establishments (FSA)

Every food establishment on the Food Standards Agency register: **614,356
establishments across 363 local authorities** as of **19 October 2026**.
Restaurants, takeaways, pubs, hotels, retailers, schools, hospitals, mobile
caterers and manufacturers, with their published rating and the three
inspection scores behind it.

### Low cost

**From $0.00005 per record, down to $0.00003 at Gold.** Pay only for the
records you receive - the whole register stays searchable, you are never
billed for the scan behind it.

### What you get per establishment

| field | meaning |
|---|---|
| `fhrsId` | FSA establishment identifier |
| `businessName`, `businessType` | trading name and category |
| `address`, `postcode`, `postcodeArea` | full address and postal area |
| `localAuthority`, `localAuthorityCode` | council responsible for the inspection |
| `ratingValue` | `5`-`0`, `Awaiting Inspection`, `Pass`, `Improvement Required`, `Exempt`, ... |
| `ratingNumeric` | the 0-5 score, blank for non-numeric ratings |
| `ratingDate` | date of the published inspection |
| `ratingPending` | whether a new rating is pending |
| `schemeType` | `FHRS` (England, Wales, NI) or `FHIS` (Scotland) |
| `hygieneScore`, `structuralScore`, `managementScore` | the three inspection scores |
| `latitude`, `longitude` | coordinates where published |
| `rightToReply` | the operator's published reply, where present |
| `refreshedDate`, `sourceUrl` | snapshot date and source |

### Search it

- **Name** - `name="Tesco"` (substring, case-insensitive).
- **Postcode** - `postcode="SW1A"` (prefix; spaces are ignored).
- **Local authority** - `localAuthority="Westminster"` (exact).
- **Business type** - `businessType="Restaurant/Cafe/Canteen"` (exact).
- **Rating** - `rating="5"`, `"Awaiting Inspection"`, `"Improvement Required"`.
- **Rating range** - `ratingFrom=0`, `ratingTo=2` for the lowest-rated sites.
- **Scheme** - `scheme="FHRS"` or `"FHIS"`.

### Example inputs

**One brand**

```json
{ "name": "Tesco", "maxResults": 50 }
```

**One council's best-rated restaurants**

```json
{ "localAuthority": "Westminster", "businessType": "Restaurant/Cafe/Canteen",
  "rating": "5", "maxResults": 50 }
```

**A postcode area**

```json
{ "postcode": "SW1A", "maxResults": 50 }
```

**The compliance watch-list**

```json
{ "ratingFrom": 0, "ratingTo": 2, "maxResults": 100 }
```

**Awaiting inspection**

```json
{ "rating": "Awaiting Inspection", "maxResults": 50 }
```

**Counts by rating** - `mode=aggregate`.

```json
{ "mode": "aggregate", "groupBy": "rating" }
```

**Counts by council** - `groupBy=localAuthority`, `businessType`, `scheme` or
`postcodeArea`.

```json
{ "mode": "aggregate", "groupBy": "localAuthority",
  "rating": "5" }
```

### Example output

```json
{
 "fhrsId": "1177669",
 "businessName": "% Arabica",
 "businessType": "Restaurant/Cafe/Canteen",
 "address": "BASEMENT AND GROUND FLOOR 5 KING STREET, COVENT GARDEN, LONDON",
 "postcode": "WC2E 8HN",
 "postcodeArea": "WC",
 "localAuthority": "Westminster",
 "localAuthorityCode": "533",
 "localAuthorityBusinessId": "19/00376/COMM",
 "ratingValue": "4",
 "ratingNumeric": "4",
 "ratingDate": "2024-02-28",
 "ratingPending": "False",
 "schemeType": "FHRS",
 "hygieneScore": "0",
 "structuralScore": "5",
 "managementScore": "10",
 "latitude": "51.5117021",
 "longitude": "-0.1240205",
 "refreshedDate": "Mon, 19 Oct 2026 01:08:47 GMT",
 "sourceUrl": "https://safhrsprodstorage.blob.core.windows.net/opendatafileblobstorage/FHRS_All_en-GB.csv"
}
```

### Owner maintenance

`mode=warm` rebuilds the snapshot from the FSA source and writes it to this
actor's private key-value store, then refreshes the public summary. It is a
maintenance path for the owner, not a user query: a warm run takes about two
minutes and returns one summary row. The default (empty) run never triggers
it.

```json
{ "mode": "warm" }
```

### Notes on the data, from the source

- **Row limit per run.** `maxResults` is capped at 5,000 records; narrow the
  filters rather than requesting the whole register in one run.
- **Two rating scales.** England, Wales and Northern Ireland use FHRS (0-5
  plus `Awaiting Inspection` / `Exempt`); Scotland uses FHIS (`Pass`,
  `Improvement Required`, `Awaiting Inspection`). `schemeType` tells you
  which scale a row is on.
- **One spelling for awaiting inspections.** The FSA file mixes
  `AwaitingInspection` and `Awaiting Inspection`; both are normalised to
  `Awaiting Inspection`.
- **Postcode gaps.** 17% of establishments have no postcode in the source
  (509,200 of 614,356 do). Those rows are still searchable by name, council
  and business type.
- **Weekly snapshot.** The FSA replaces the CSV every day; this actor's
  owner-warm snapshot is rebuilt weekly and carries the source publication
  date in `refreshedDate`.
- **Licence.** Open Government Licence v3 - commercial reuse is permitted,
  with attribution to the Food Standards Agency.

Data source: `safhrsprodstorage.blob.core.windows.net` - FHRS_All_en-GB.csv
(Food Standards Agency).

# Actor input Schema

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

search = filter the register. aggregate = one row per group. warm = owner maintenance: rebuild the snapshot from the FSA source and upload it (no filters). Leave blank to auto-route: filters -> search, no filters -> aggregate.

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

Business name substring, case-insensitive (e.g. "Tesco").

## `address` (type: `string`):

Address substring, case-insensitive.

## `postcode` (type: `string`):

Postcode or prefix; spaces are ignored (e.g. "SW1A" or "SW1A 1AA").

## `localAuthority` (type: `string`):

Exact council name, case-insensitive (e.g. "Westminster").

## `businessType` (type: `string`):

Exact category, e.g. "Restaurant/Cafe/Canteen", "Takeaway/sandwich shop", "Retailers - other".

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

Exact rating: 0-5, Awaiting Inspection, Awaiting Publication, Pass, Pass and Eat Safe, Improvement Required or Exempt.

## `scheme` (type: `string`):

FHRS = England, Wales and NI; FHIS = Scotland.

## `ratingFrom` (type: `integer`):

Inclusive lower bound on numeric ratings 0-5. Rows with a non-numeric rating are excluded when a range is set.

## `ratingTo` (type: `integer`):

Inclusive upper bound on numeric ratings 0-5.

## `groupBy` (type: `string`):

rating -> the published rating; localAuthority -> the 363 councils; businessType -> category; scheme -> FHRS vs FHIS; postcodeArea -> postal area. Blank defaults to rating.

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

Cap the number of search records pushed (0 = the default 50, maximum 5000). Aggregate returns every group.

## Actor input object example

```json
{
  "maxResults": 50
}
```

# Actor output Schema

## `recordsUrl` (type: `string`):

UK food establishment records - as JSON

## `datasetUrl` (type: `string`):

No description

## `runUrl` (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("j0401/uk-food-hygiene").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("j0401/uk-food-hygiene").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 j0401/uk-food-hygiene --silent --output-dataset

```

## MCP server setup

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

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/KXi2RhdmGLVkWpyrE/builds/tfY14QsgtOyMyYTJ1/openapi.json
