# UK Food Hygiene Ratings – FSA Establishments API (`loudtzu/uk-food-hygiene-ratings`) Actor

UK Food Standards Agency FHRS ratings for restaurants, takeaways and other food businesses: rating, address, authority, inspection date. Official open data.

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

## Pricing

$1.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

## UK Food Hygiene Ratings – FSA Establishments API

### What it does

Queries the UK Food Standards Agency **Food Hygiene Rating Scheme (FHRS)** JSON API and returns establishment ratings across England, Wales and Northern Ireland (FHIS where published): business name, type, address, rating, rating date, inspection sub-scores and local authority.

Unfiltered runs **walk every local authority** because FSA rejects bare `/Establishments` queries with HTTP 403 (“CPU intensive query”). Prefer `name`, `localAuthorityId`, `businessTypeId` or `ratingValue` for faster pulls.

Source: [FSA open data / API](https://ratings.food.gov.uk/open-data) · endpoint `https://api.ratings.food.gov.uk/Establishments` (`x-api-version: 2`).

### Who it's for

Food-safety researchers, journalists, compliance tooling and map apps that need live FHRS rows with private-residence names withheld.

### Input

| Key | Notes |
|---|---|
| `name` | Server-side name search |
| `nameContains` | Extra client-side name filter (uses raw name before privacy withhold) |
| `businessType` / `businessTypeId` | Type contains / FSA id |
| `localAuthority` / `localAuthorityId` | Authority contains / FSA id |
| `ratingValue` | `0`–`5`, `Exempt`, … |
| `postcode` | contains (spaces ignored) |
| `ratingDateFrom` / `ratingDateTo` | YYYY-MM-DD |
| `maxItems` | default 100, max 50,000 |

Example: `{"name": "Pizza", "ratingValue": "5", "maxItems": 50}`

### Output

Includes `hygieneScore`, `structuralScore`, `confidenceScore`, `nameWithheld`, `privatePremises`. `localAuthorityWebsite` is always null. Phone and authority email from the API are never exported.

### Privacy

FSA states that for private addresses, address and geocoding may be withheld ([open data notes](https://ratings.food.gov.uk/open-data)). When street address/geocode are absent, this Actor sets `privatePremises=true`, clears address/geo fields, and replaces `businessName` with `[name withheld]` (`nameWithheld=true`). Person-like operator names on truncated private addresses are also withheld. Unit tests use **synthetic** names only.

### Competitors (checked 2026-11-05, America/Halifax; price updated same day)

| Rival | URL | Price (as listed) | What it returns |
|---|---|---|---|
| ryanclinton/uk-food-hygiene | https://apify.com/ryanclinton/uk-food-hygiene | $0.002/result + $0.00005 start | National EWNI FHRS; inspection sub-scores; radius search; **max ~500 rows/run** |
| j0401/uk-food-hygiene | https://apify.com/j0401/uk-food-hygiene | FREE $0.00005 → DIAMOND $0.00003/result (tiered); no start listed | Full UK snapshot (**dated 19 Oct 2026** in listing), scores, FHIS, aggregate mode |
| scrapersdelight/fhrs-food-hygiene-scraper | https://apify.com/scrapersdelight/fhrs-food-hygiene-scraper | $0.0005/result, no start | New/changed businesses by date window; scores; dedup |

**Measured comparison:**

- **Price (ours $0.001/result, no start fee):** cheaper than ryanclinton ($0.002 + $0.00005 start). Still **pricier** than scrapersdelight ($0.0005) and j0401’s tiered $0.00003–$0.00005. At 50 results: ours $0.050; ryanclinton ≈ $0.10005; scrapersdelight $0.025; j0401 FREE ≈ $0.0025.
- **Fields:** hygiene/structural/confidence sub-scores exported (parity with ryanclinton/j0401 on score fields). No radius search (ryanclinton has it).
- **Volume:** unfiltered/authority-walk runs are **not** hard-capped at 500 (ryanclinton lists a ~500 row cap).
- **Freshness:** live FSA API (updates as authorities publish) vs j0401’s dated bulk snapshot listing (19 Oct 2026).
- **Privacy:** names withheld for FSA private-premises patterns; rival READMEs checked 2026-11-05 do not advertise that behaviour.

### Licence and terms

[Open Government Licence v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/). Ratings imagery/branding has separate FSA conditions; this Actor does not export images. Independent; not endorsed by the FSA.

### Pricing

**$0.001 per result, no start fee** (pay-per-event `apify-default-dataset-item`).

### Limits

Unfiltered walks are slower (363 authorities). Sparse client-only filters still pull server pages before filtering.

# Actor input Schema

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

Passed to FSA name parameter (e.g. Pizza).

## `nameContains` (type: `string`):

Extra case-insensitive filter on business name.

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

e.g. Restaurant, Takeaway, School.

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

FSA BusinessTypeID if known.

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

e.g. Leeds, Camden.

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

FSA LocalAuthorityId if known.

## `ratingValue` (type: `string`):

Exact published rating.

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

e.g. SW1A or LS1 (spaces ignored).

## `ratingDateFrom` (type: `string`):

YYYY-MM-DD

## `ratingDateTo` (type: `string`):

YYYY-MM-DD

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

Stop after this many establishments.

## Actor input object example

```json
{
  "maxItems": 100
}
```

# Actor output Schema

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

All items returned by the run.

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

```

## MCP server setup

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

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/a7ZKa8rnnzFXH8yiR/builds/3VeAgF9krD93u3Ryd/openapi.json
