Food Hygiene API Reference
Food Standards Agency hygiene ratings for establishments across the UK.
Base URL: https://api.govdata.dev/v1
Search Establishments
Returns paginated FSA establishment records for consumer apps, procurement teams, and local publishers. Power a postcode-level food safety widget, find caterers awaiting inspection, or screen suppliers by hygiene rating and business type.
/v1/food-hygiene
Waiting for request...
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
q |
string | No | — | Case-insensitive partial match on business_name. |
postcode |
string | No | — | Full UK postcode; spacing and case are normalised. |
authority |
string | No | — | Case-insensitive partial local-authority name. |
rating |
string | No | — | Exact FHRS or FHIS rating_value, including textual values. |
business_type |
string | No | — | Exact FSA business-type label. |
new_rating_pending |
boolean | No | — | true or false. |
page |
integer | No | 1 | One-based result page. |
per_page |
integer | No | 25 | Results per page; minimum 1, maximum 100. |
curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.govdata.dev/v1/food-hygiene?q=Alex&postcode=ZE1%200HJ&authority=Shetland&rating=Improvement%20Required&business_type=Retailers%20-%20other&new_rating_pending=false&per_page=5"
uri = URI("https://api.govdata.dev/v1/food-hygiene") uri.query = URI.encode_www_form(q: "Alex", postcode: "ZE1 0HJ", authority: "Shetland", rating: "Improvement Required", business_type: "Retailers - other", new_rating_pending: false, per_page: 5) req = Net::HTTP::Get.new(uri, "Authorization" => "Bearer YOUR_API_KEY") res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
response = requests.get( "https://api.govdata.dev/v1/food-hygiene", headers={"Authorization": "Bearer YOUR_API_KEY"}, params={"q": "Alex", "postcode": "ZE1 0HJ", "authority": "Shetland", "rating": "Improvement Required", "business_type": "Retailers - other", "new_rating_pending": False, "per_page": 5} )
const url = new URL("https://api.govdata.dev/v1/food-hygiene"); url.search = new URLSearchParams({ q: "Alex", postcode: "ZE1 0HJ", authority: "Shetland", rating: "Improvement Required", business_type: "Retailers - other", new_rating_pending: "false", per_page: "5" }); const response = await fetch(url, { headers: { Authorization: "Bearer YOUR_API_KEY" } });
Response
{ "data": [{ "fhrsid": 1022651, "business_name": "Alex Morrisons", "business_type": "Retailers - other", "address": ["5&9 Browns Buildings", "Burgh Road", "Lerwick"], "postcode": "ZE1 0HJ", "rating_value": "Improvement Required", "rating_date": "2025-04-03", "scheme_type": "FHIS", "new_rating_pending": false, "scores": { "hygiene": null, "structural": null, "confidence_in_management": null }, "local_authority": { "code": "789", "name": "Shetland Islands" }, "geocode": { "latitude": 60.15646362, "longitude": -1.15153301 } }], "meta": { "api_version": "v1", "licence": "Open Government Licence v3.0", "source": "Food Standards Agency", "source_url": "https://ratings.food.gov.uk/open-data" }, "pagination": { "total": 1, "page": 1, "per_page": 5, "total_pages": 1 } }
rating_value is deliberately textual. Scotland's FHIS returns values such as Pass and Improvement Required; FHRS returns 0–5 and status labels. FHIS records normally have null component scores. FHRSID 1022651 is a real record in the bundled FSA development fixture.
Error responses
Search has no endpoint-specific 400, 404, or 422 branch. Unknown or incompatible filters return an empty data array with HTTP 200.
Get Establishment
Returns one complete FSA record by FHRSID for profile pages, audit trails, or enriching a supplier record after search. The stable FSA identifier makes this the preferred endpoint for refreshing a previously selected establishment.
/v1/food-hygiene/:fhrsid
Waiting for request...
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
fhrsid |
integer | Yes | — | Food Standards Agency establishment identifier. |
curl -H "Authorization: Bearer YOUR_API_KEY" "https://api.govdata.dev/v1/food-hygiene/1022651"
uri = URI("https://api.govdata.dev/v1/food-hygiene/1022651") req = Net::HTTP::Get.new(uri, "Authorization" => "Bearer YOUR_API_KEY") res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
response = requests.get("https://api.govdata.dev/v1/food-hygiene/1022651", headers={"Authorization": "Bearer YOUR_API_KEY"})
const response = await fetch("https://api.govdata.dev/v1/food-hygiene/1022651", { headers: { Authorization: "Bearer YOUR_API_KEY" } });
Response
{ "data": { "fhrsid": 1022651, "business_name": "Alex Morrisons", "business_type": "Retailers - other", "address": ["5&9 Browns Buildings", "Burgh Road", "Lerwick"], "postcode": "ZE1 0HJ", "rating_value": "Improvement Required", "rating_date": "2025-04-03", "scheme_type": "FHIS", "new_rating_pending": false, "scores": { "hygiene": null, "structural": null, "confidence_in_management": null }, "local_authority": { "code": "789", "name": "Shetland Islands" }, "geocode": { "latitude": 60.15646362, "longitude": -1.15153301 } }, "meta": { "api_version": "v1", "licence": "Open Government Licence v3.0", "source": "Food Standards Agency", "source_url": "https://ratings.food.gov.uk/open-data" } }
The object is identical to a search result, but the response has no pagination member.
Error responses
404 — no establishment has that FHRSID. There are no endpoint-specific 400 or 422 branches.
{"error":{"code":"not_found","message":"Resource not found","documentation_url":"https://docs.govdata.dev/errors/not_found"}}
Data notes
Coverage and cadence: FSA open-data records cover England, Wales, Northern Ireland, and Scotland. GovData refreshes authority feeds daily, but a local authority controls when a rating is submitted or changed.
Licence and attribution: source Food Standards Agency open data, reused under the Open Government Licence v3.0. Attribute the Food Standards Agency and the relevant local authority when publishing ratings.
FHRS in England, Wales and Northern Ireland stores 0–5 plus non-numeric forms such as AwaitingInspection, AwaitingPublication, and concatenated variants. Scotland's FHIS stores spaced forms such as Pass and Eat Safe and Improvement Required. The rating filter accepts both stored concatenated FHRS forms and spaced forms. Do not parse rating_value as a number or compare FHIS and FHRS as one scale.
Addresses, coordinates, component scores, and rating dates may be null because the source omits them. new_rating_pending means the establishment reports a more recent rating is pending publication; it does not predict the result.