# UK Food Hygiene Ratings Scraper (FSA FHRS) (`treesap_1127/uk-food-hygiene-ratings-scraper`) Actor

Returns UK food businesses with hygiene ratings, scores, addresses and coordinates from the official FSA Food Hygiene Rating Scheme API. Search by local authority, postcode, city, business type, rating or name. Find new businesses awaiting inspection. No API key, browser or proxy.

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

## Pricing

from $2.00 / 1,000 food businesses

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 Scraper (FSA FHRS)

Get UK Food Hygiene Ratings for restaurants, takeaways, pubs, shops and other food businesses from the official Food Standards Agency (FSA) Food Hygiene Rating Scheme API. Search by local authority, postcode, city or business name and download clean rows with rating, rating date, inspection scores, address and coordinates as JSON, CSV or Excel. No API key and no proxy are needed.

### What you get

- One row per food business, straight from the FSA open data.
- Ratings from England, Wales and Northern Ireland (FHRS, `0` to `5`) and Scotland (FHIS, `Pass` / `Improvement Required`).
- Special states such as `AwaitingInspection` (new businesses), `AwaitingPublication` and `Exempt`.
- Hygiene, structural and confidence-in-management scores (lower is better, `0` is the best score).
- Address, postcode, local authority and, where the FSA has them, latitude and longitude.
- A `ratingPageUrl` that links to the official FSA page for the business.

#### Who uses it

- B2B sales teams that look for new food businesses (`awaitingInspection`) or businesses with poor ratings.
- Suppliers and franchise owners who monitor chains such as a brand name across the UK.
- Local market research, site selection and food safety analysis.

#### Example uses

- Restaurants in Leeds: locations `Leeds`, business type `Restaurant/Cafe/Canteen`.
- New businesses every week: a location, rating `Awaiting inspection`, and an Apify Schedule.
- A chain across the UK: leave locations empty and set the business name to `Greggs`.

### Input

| Field | Description |
|---|---|
| `locations` | Local authority names or postcodes, addresses and cities. A text that exactly matches an FSA local authority name (case-insensitive, for example `Leeds`, `Westminster`, `City of London Corporation`) searches that authority. Anything else (`SW1A`, `M1 1AE`, `Bristol`) is an address search. Up to 50 entries. |
| `businessName` | Word(s) in the business name. The FSA matches whole words. With no locations this searches the whole UK. |
| `businessTypes` | Optional FSA business types, for example `Restaurant/Cafe/Canteen` or `Takeaway/sandwich shop`. |
| `rating` | `any` (default), `5` to `0`, `lowRated` (0 to 2), `awaitingInspection`, `awaitingPublication`, `pass`, `improvementRequired` (Scotland), `exempt`. |
| `maxItems` | Total limit of businesses (1 to 100,000, default 100). |

You must give at least one location or a business name. Each location is combined with each business type, one search per pair.

Example input:

```json
{
  "locations": ["Leeds"],
  "businessTypes": ["Restaurant/Cafe/Canteen"],
  "rating": "any",
  "maxItems": 20
}
```

### Output

Each item has these fields: `fhrsId`, `businessName`, `businessType`, `businessTypeId`, `addressLine1` to `addressLine4`, `postcode`, `localAuthorityName`, `localAuthorityCode`, `localAuthorityWebsite`, `schemeType`, `ratingValue`, `ratingKey`, `ratingDate`, `newRatingPending`, `hygieneScore`, `structuralScore`, `confidenceInManagementScore`, `latitude`, `longitude`, `ratingPageUrl`, `searchLocation` and `extractDate`.

```json
{
  "fhrsId": 1417349,
  "businessName": "1915",
  "businessType": "Restaurant/Cafe/Canteen",
  "businessTypeId": 1,
  "addressLine1": "Sir William Henry Bragg Building",
  "addressLine2": "University Of Leeds",
  "addressLine3": "Woodhouse Lane",
  "addressLine4": "Woodhouse",
  "postcode": "LS2 9JT",
  "localAuthorityName": "Leeds",
  "localAuthorityCode": "413",
  "localAuthorityWebsite": "http://www.leeds.gov.uk/",
  "schemeType": "FHRS",
  "ratingValue": "5",
  "ratingKey": "fhrs_5_en-gb",
  "ratingDate": "2025-10-23T00:00:00",
  "newRatingPending": false,
  "hygieneScore": 5,
  "structuralScore": 5,
  "confidenceInManagementScore": 5,
  "latitude": 53.8089268,
  "longitude": -1.5539093,
  "ratingPageUrl": "https://ratings.food.gov.uk/business/1417349",
  "searchLocation": "Leeds",
  "extractDate": "2026-11-11T15:05:03.8300205+00:00"
}
```

Notes on the data:

- `ratingDate` is `null` when the FSA has no date (for example awaiting inspection in England). Coordinates are `null` when the FSA has none.
- Business names are kept as published, including quotes and capitals.
- Results come in the FSA default order (alphabetical for location searches, relevance for name searches). The same business is never saved twice in one run.
- Phone numbers, local authority e-mail addresses and right-to-reply texts are not collected.

### How it works

- The Actor calls the public FSA API with one request at a time and at least one second between requests.
- It reads up to 200 businesses per page and saves each page as soon as it arrives.
- Failed requests are retried up to 3 times with growing waits. If the FSA answers HTTP 403 (rate limit), the Actor stops without retrying and keeps what it already saved.
- If one search fails, the others are still saved. The run fails only when every search fails or nothing could be read.
- If a rating filter is ignored by the API, that search is reported as failed instead of returning unfiltered rows.
- Speed: about 3 seconds per 200 businesses (a 450-business run takes about 13 seconds). 100,000 businesses take roughly 25 minutes.
- If your Apify spending limit for the run is reached, the Actor stops cleanly and the run still succeeds.

### Pricing

This Actor is intended for pay-per-event pricing: one result is one business row in the default dataset. The planned price is about $2 per 1,000 results, but the price you see on the Actor page in Apify Console is the one that applies. Empty runs and failed searches store no rows and cost nothing for results. Platform usage is included in the event price.

### Legal / FAQ

#### Where does the data come from?

From the official FSA Food Hygiene Rating Scheme API at api.ratings.food.gov.uk. The FSA API documentation says developers can use the FSA data to provide their own services and websites, and that no sign-up, API key or login is required. The FSA terms say use of the food hygiene ratings information is subject to the Open Government Licence (OGL).

Source: Food Standards Agency – Food Hygiene Rating Scheme (ratings.food.gov.uk).
Contains public sector information licensed under the Open Government Licence v3.0 (https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).

#### Is this affiliated with the FSA?

No. This Actor is independent. It is not endorsed by the Food Standards Agency, it does not use FSA logos or rating stickers, and you must not present the data in a way that suggests FSA endorsement.

#### Are the ratings current?

Ratings change after new inspections. Each row has `ratingDate` and `extractDate`. Before you display or promote a rating, check the current rating on the official page in `ratingPageUrl`: the FSA terms say displaying an invalid or inaccurate rating may constitute a criminal offence.

#### Is it legal to use?

You are responsible for using the data in line with the FSA terms, the OGL and applicable laws, including data protection rules. This README is not legal advice.

#### Why did my business name search return near matches?

The FSA searches whole words, not substrings, and may match related words. Results are passed on as the FSA returns them.

#### Why is a location treated as an address search?

Only an exact FSA local authority name selects that authority. `City of London` is not an authority name (use `City of London Corporation`), so it is an address search.

# Actor input Schema

## `locations` (type: `array`):

Local authority names (e.g. `Leeds`, `Westminster`, `City of London Corporation`) or postcodes, addresses and cities (e.g. `SW1A`, `M1 1AE`, `Bristol`). A text that exactly matches an FSA local authority name searches that authority; anything else is an address search. Up to 50 entries. Leave empty only if you set a business name.

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

Word(s) in the business name, e.g. `Greggs`. FSA matches whole words. If Locations is empty this searches the whole UK.

## `businessTypes` (type: `array`):

Only return these FSA business types. Leave empty for all types.

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

Filter by hygiene rating. Numeric ratings 0-5 apply to England, Wales and Northern Ireland (FHRS). `pass` and `improvementRequired` apply to Scotland (FHIS).

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

Maximum number of businesses returned in total (cost and load limit).

## Actor input object example

```json
{
  "locations": [
    "Leeds"
  ],
  "businessTypes": [
    "Restaurant/Cafe/Canteen"
  ],
  "rating": "any",
  "maxItems": 20
}
```

# 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 = {
    "locations": [
        "Leeds"
    ],
    "businessTypes": [
        "Restaurant/Cafe/Canteen"
    ],
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("treesap_1127/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 = {
    "locations": ["Leeds"],
    "businessTypes": ["Restaurant/Cafe/Canteen"],
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("treesap_1127/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 '{
  "locations": [
    "Leeds"
  ],
  "businessTypes": [
    "Restaurant/Cafe/Canteen"
  ],
  "maxItems": 20
}' |
apify call treesap_1127/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,treesap_1127/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/3iDEuBDQdro36C1Fj/builds/QIxJgtuc5V9pOnOa2/openapi.json
