# UK Food Hygiene Ratings Scraper — FSA Establishments (`devilscrapes/uk-food-hygiene-ratings-scraper`) Actor

Export UK Food Standards Agency hygiene ratings — business name, type, rating, rating date, full address, postcode, phone and local authority — as clean JSON, CSV or Excel.

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

## Pricing

Pay per event

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

<div align="center">
  <img src=".actor/icon.svg" width="160" alt="Devil Scrapes mark" />

## UK Food Hygiene Ratings Scraper — FSA Establishments

**💰 $2.05 / 1 000 results**  ·  pay only for results  ·  no credit card to try

*We do the dirty work so your dataset stays clean.* 😈

Export UK Food Standards Agency hygiene ratings — business name, type, rating, rating date, full address, postcode, phone and local authority — as clean JSON, CSV or Excel.

</div>

***

### 🎯 What this scrapes

The FSA publishes a hygiene rating for every food business in the UK, which makes it one of the few open datasets with a name, an address and a phone number for hundreds of thousands of hospitality venues. The API is fussy — it needs a version header, refuses unfiltered queries outright, and splits the address across four numbered fields. This Actor handles all three and hands back one clean row per establishment.

### 🔥 What we handle for you

sends the `x-api-version` header the API requires, avoiding its misleading 404
joins the FSA's four numbered address lines into one readable field
keeps Scotland's non-numeric FHIS ratings instead of dropping them on a numeric filter

### 💡 Use cases

- Build a hospitality prospect list with names, addresses and phone numbers by council area.
- Screen suppliers or franchise sites against their current hygiene rating.
- Track rating changes across a chain or a town over time.
- Map food businesses in a catchment area using the published coordinates.

### ⚙️ How to use it

1. Click **Try for free** at the top of the page.
2. Fill in the input form — most fields have sensible defaults.
3. Click **Start**. Output streams into the run's dataset.
4. Export from **Storage → Dataset** as JSON, CSV, or Excel — or fetch via the API.

### 📥 Input

| Field | Type | Required | Default | Notes |
|---|---|:--:|---|---|
| `businessName` | `string` | no | 'cafe' | Match establishments whose name contains this text. Leave empty to filter by authority or town instead. |
| `localAuthorityId` | `string` | no | '—' | FSA local authority ID, e.g. <code>413</code>. Use this to pull a whole council area. |
| `address` | `string` | no | '—' | Match on address text — a town, street or postcode fragment. |
| `minRating` | `integer` | no | 0 | Only establishments rated at least this (0-5). Leave at 0 for every rating. Non-numeric ratings (Scotland's… |
| `maxResults` | `integer` | no | 100 | Stop after this many establishments. Each one is one billed result row. |
| `proxyConfiguration` | `object` | no | {'useApifyProxy': False} | The FSA API is public and does not need a proxy. Leave this off unless your account requires egress through Apify Proxy. |

#### Example input

```json
{
  "businessName": "cafe",
  "maxResults": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

### 📤 Output

Every row is one dataset item.

| Field | Type | Notes |
|---|---|---|
| `fhrs_id` | `integer` | FSA establishment identifier. |
| `business_name` | `string` | Trading name. |
| `business_type` | `string` | FSA business category. |
| `rating_value` | `string` | Hygiene rating: `0`-`5`, or `Pass` / `Improvement Required` in Scotland. |
| `rating_date` | `string` | Date of the rating inspection. |
| `address` | `string` | Street address, joined from the FSA's four address lines. |
| `postcode` | `string` | Postcode. |
| `phone` | `string` | Registered phone number, when published. |
| `local_authority` | `string` | Local authority name. |
| `local_authority_website` | `string` | Local authority website. |
| `latitude` | `number` | Latitude, when geocoded. |
| `longitude` | `number` | Longitude, when geocoded. |
| `scheme_type` | `string` | `FHRS` (England/Wales/NI) or `FHIS` (Scotland). |

#### Example output

```json
{}
```

### 💰 Pricing

Pay-Per-Event — you pay only when these events fire:

| Event | USD | What it is |
|---|---:|---|
| `actor-start` | $0.05 | One-off warm-up charge per run |
| `result` | $0.002 | Per dataset item |

Example: 1 000 results at the rates above ≈ **$2.05**. No subscription, no minimum, no card to start — Apify gives every new account $5 of free credit.

### 🚧 Limitations

- Returns the current rating only — the API does not expose full inspection history.
- Phone numbers and coordinates are published for most but not all establishments.

### ❓ FAQ

**Do I need an API key?**

No. The FSA API is open. The Actor sends the version header the API requires, which is the usual reason a hand-rolled request gets a confusing 404.

**Why must I set a filter?**

The API rejects an unfiltered query with a 403 explaining it is CPU intensive. Give it a name, an authority or an address and it answers immediately.

**What about Scottish ratings?**

Scotland uses FHIS (`Pass` / `Improvement Required`) rather than 0-5. Those rows come through unchanged and are never dropped by the minimum-rating filter.

### 💬 Your feedback

Spotted a bug, hit a weird edge case, or need a new field? Open an
issue on the Actor's **Issues** tab on Apify Console — we ship
fixes weekly and we read every report.

***

<div align="center">

Built by **[Devil Scrapes](https://apify.com/DevilScrapes)** 😈 — a small fleet of
opinionated public-data Actors. Honest pricing, real engineering, zero fine print.

</div>

# Actor input Schema

## `businessName` (type: `string`):

Match establishments whose name contains this text. Leave empty to filter by authority or town instead.

## `localAuthorityId` (type: `string`):

FSA local authority ID, e.g. <code>413</code>. Use this to pull a whole council area.

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

Match on address text — a town, street or postcode fragment.

## `minRating` (type: `integer`):

Only establishments rated at least this (0-5). Leave at 0 for every rating. Non-numeric ratings (Scotland's Pass/Improvement Required) are kept regardless.

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

Stop after this many establishments. Each one is one billed result row.

## `proxyConfiguration` (type: `object`):

The FSA API is public and does not need a proxy. Leave this off unless your account requires egress through Apify Proxy.

## Actor input object example

```json
{
  "businessName": "cafe",
  "minRating": 0,
  "maxResults": 100,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `datasetItems` (type: `string`):

All dataset items as JSON.

## `datasetItemsCsv` (type: `string`):

Same data exported to CSV.

## `datasetView` (type: `string`):

Open the run dataset in the Console.

# 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 = {
    "businessName": "cafe",
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("devilscrapes/uk-food-hygiene-ratings-scraper").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 = {
    "businessName": "cafe",
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("devilscrapes/uk-food-hygiene-ratings-scraper").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 '{
  "businessName": "cafe",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call devilscrapes/uk-food-hygiene-ratings-scraper --silent --output-dataset

```

## MCP server setup

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

```

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/5EK3Jappe4U9zGXTf/builds/Hd70qVbtvMSCokcmv/openapi.json
