# Food Standards Agency API

> Food Standards Agency returns UK food hygiene ratings and inspection details as a workflow and API.

Food Standards Agency (FSA) finds food hygiene ratings by business name and town, street, or postcode. Get hygiene rating returns matching businesses, ratings, addresses, inspection dates, and available food safety standards.

- Page: https://fous.com/workflows/food-standards-agency
- Handle: `@food-standards-agency`
- Category: [Food](https://fous.com/workflows/category/food)
- Source website: https://ratings.food.gov.uk
- Last verified: Sep 29, 2026
- Fous is not affiliated with Food Standards Agency.

## Methods

### Get hygiene rating

Operation `get_hygiene_rating`, version 1. 1 credit per call.

Find UK food hygiene ratings by business name and town, street, or postcode. Results include inspection dates and plain-language scores when available; Scottish ratings generally have no component scores.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `business` | string | yes | `"Pret A Manger"` | Name of the restaurant, cafe, takeaway, or shop, for example Pret A Manger. |
| `location` | string | yes | `"Leeds"` | Town, street, or postcode, for example Leeds or LS1 4DT. |
| `max_results` | integer | no | `3` | Maximum number of matching businesses to return, for example 10. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "business",
    "location"
  ],
  "properties": {
    "business": {
      "type": "string",
      "minLength": 1,
      "description": "Name of the restaurant, cafe, takeaway, or shop, for example Pret A Manger.",
      "examples": [
        "Pret A Manger",
        "McDonalds",
        "No Such Imaginary Restaurant ZXYQ987"
      ]
    },
    "location": {
      "type": "string",
      "minLength": 1,
      "description": "Town, street, or postcode, for example Leeds or LS1 4DT.",
      "examples": [
        "Leeds",
        "Edinburgh",
        "LS1 4DT"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 10,
      "maximum": 50,
      "minimum": 1,
      "description": "Maximum number of matching businesses to return, for example 10.",
      "x-fous-developer": true,
      "examples": [
        3,
        2
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "business": "Pret A Manger",
      "location": "Leeds"
    },
    {
      "business": "McDonalds",
      "location": "Edinburgh",
      "max_results": 3
    },
    {
      "business": "Pret A Manger",
      "location": "LS1 4DT",
      "max_results": 2
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `businesses` | array |  | Matching food businesses, best match first. |
| `businesses[].rating` | string or null | `"5"` | Food hygiene rating, or Scottish inspection outcome. |
| `businesses[].fhrs_id` | integer | `877764` | Official FHRS establishment identifier. |
| `businesses[].hygiene` | string or null | `"Very good"` | Food handling standard in words. |
| `businesses[].postcode` | string or null | `"LS1 4DT"` | Business postcode. |
| `businesses[].structure` | string or null | `"Good"` | Premises and facilities standard in words. |
| `businesses[].full_address` | string | `"New Station Street, Leeds, LS1 4DT"` | Full street address including postcode. |
| `businesses[].business_name` | string | `"Pret A Manger"` | Name of the business. |
| `businesses[].business_type` | string or null | `"Other catering premises"` | Type of food business. |
| `businesses[].rating_meaning` | string or null | `"5 - Very good"` | Rating and its meaning in words. |
| `businesses[].local_authority` | string or null | `"Leeds"` | Authority that inspected the business. |
| `businesses[].rating_page_url` | string | `"https://ratings.food.gov.uk/business/877764"` | Official business rating page. |
| `businesses[].last_inspection_date` | string or null | `"2021-07-14"` | Date of the latest published inspection. |
| `businesses[].confidence_in_management` | string or null | `"Good"` | Food safety management standard in words. |

**Example input**

```json
{
  "business": "Pret A Manger",
  "location": "Leeds"
}
```

**Example output**

```json
{
  "businesses": [
    {
      "rating": "5",
      "fhrs_id": 877764,
      "hygiene": "Very good",
      "postcode": "LS1 4DT",
      "structure": "Good",
      "full_address": "New Station Street, Leeds, LS1 4DT",
      "business_name": "Pret A Manger",
      "business_type": "Other catering premises",
      "rating_meaning": "5 - Very good",
      "local_authority": "Leeds",
      "rating_page_url": "https://ratings.food.gov.uk/business/877764",
      "last_inspection_date": "2021-07-14",
      "confidence_in_management": "Good"
    },
    {
      "rating": "5",
      "fhrs_id": 937212,
      "hygiene": "Very good",
      "postcode": "LS2 7AR",
      "structure": "Good",
      "full_address": "Unit 20 Victoria Gate, Harewood Street, Leeds, LS2 7AR",
      "business_name": "Pret A Manger",
      "business_type": "Restaurant/Cafe/Canteen",
      "rating_meaning": "5 - Very good",
      "local_authority": "Leeds",
      "rating_page_url": "https://ratings.food.gov.uk/business/937212",
      "last_inspection_date": "2026-07-22",
      "confidence_in_management": "Very good"
    },
    {
      "rating": "5",
      "fhrs_id": 1685030,
      "hygiene": "Good",
      "postcode": "LS1 6AW",
      "structure": "Good",
      "full_address": "6 Lands Lane, Leeds, LS1 6AW",
      "business_name": "Pret A Manger Lands Lane",
      "business_type": "Restaurant/Cafe/Canteen",
      "rating_meaning": "5 - Very good",
      "local_authority": "Leeds",
      "rating_page_url": "https://ratings.food.gov.uk/business/1685030",
      "last_inspection_date": "2026-08-26",
      "confidence_in_management": "Very good"
    }
  ]
}
```

## Quick start

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@food-standards-agency",
  "visibility": "public",
  "operation": "get_hygiene_rating",
  "version": 1,
  "input": {
    "business": "Pret A Manger",
    "location": "Leeds"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

body = json.loads("{\n  \"api\": \"@food-standards-agency\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_hygiene_rating\",\n  \"version\": 1,\n  \"input\": {\n    \"business\": \"Pret A Manger\",\n    \"location\": \"Leeds\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=120) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_000),
  body: JSON.stringify({
  "api": "@food-standards-agency",
  "visibility": "public",
  "operation": "get_hygiene_rating",
  "version": 1,
  "input": {
    "business": "Pret A Manger",
    "location": "Leeds"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

Or describe the data in plain language: send `{"api":"@food-standards-agency","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## Use cases

- Compare restaurant ratings across a town
- Check a takeaway’s latest published inspection date
- Find a food shop’s rating and address
- Review available food handling and safety management standards

## FAQ

### Is Fous affiliated with Food Standards Agency?

No. Fous is not affiliated with Food Standards Agency. This workflow reads the public ratings.food.gov.uk website and returns its data.

### How much does it cost?

Each run costs 1 credit. With pay-as-you-go, a credit costs 1¢; monthly plans cost less per credit.

### Do I need a Food Standards Agency account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from ratings.food.gov.uk when you run it; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check on Sep 29, 2026.

### What is a food business’s hygiene rating?

Get hygiene rating finds a business by name and location and returns its rating or Scottish inspection outcome.

### When was a business last inspected?

Get hygiene rating returns the latest published inspection date when available.

### What food safety standards were assessed?

Get hygiene rating returns available food handling, premises and facilities, and food safety management standards.

## Related

- [Open Food Facts API](https://fous.com/workflows/open-food-facts.md): Open Food Facts provides public packaged-food information, including ingredients, allergens, nutrition, and product classifications; coverage varies, and search results favor popular products.
- [Companies House API](https://fous.com/workflows/companies-house.md): Companies House returns UK public-register company details, officers, people with significant control and recent filings; records may be incomplete, and ceased entries are optional.
- [Uber Eats API](https://fous.com/workflows/uber-eats.md): Uber Eats shows restaurants and delivery options, with menus, prices, ratings, and delivery details; fees may reflect guest promotions and rating counts may be rounded.
- [McDonald's API](https://fous.com/workflows/mcdonalds.md): McDonald’s provides menu-item food information for US, UK and Canadian items, plus nearby US restaurants and listed hours today, which may miss unexpected closures.
- [BBC Good Food API](https://fous.com/workflows/bbc-good-food.md): BBC Good Food returns searchable web recipes, excluding app-only recipes, and full recipe ingredients, steps, and per-serving nutrition when available.
- [NHS API](https://fous.com/workflows/nhs.md): NHS provides condition and medicine guidance, with condition dates reflecting the latest pages used, and nearby England service listings ordered by distance; availability details may be missing.
- [FDA API](https://fous.com/workflows/fda.md): FDA provides drug safety data, latest matching drug labels, common reported side effects, and newest-first drug, food, and device recalls; recent drug and device recalls may be missing, and weekly food statuses may lag.
- [Tripadvisor API](https://fous.com/workflows/tripadvisor.md): Tripadvisor provides traveler-ranked first-page city listings of attractions, restaurants and hotels, plus latest reviews; hotel prices and booking sites depend on supplied stay dates and availability.
- [All Food workflows](https://fous.com/workflows/category/food)
