PUBLIC DATA API

GET-only

Base path: /api • JSON responses include attribution • Rate limit: 200/hour and 50/minute per IP.

Attribution: Data provided by the Food Standards Agency under Open Government License. Include this attribution when reusing data.
Endpoints
  • /api/analytics/summary – Overview statistics
  • /api/analytics/councils – Council performance (top councils)
  • /api/analytics/alerts?min_rating=1&max_results=20 – Critical establishments
  • /api/analytics/trends?months=12 – Historical trends
  • /api/health – Health check with BigQuery status
  • /api/security-notice – API usage and attribution

Notes: All endpoints are read-only. Query parameters are validated and sanitized; only safe numeric and short string values are accepted.

Examples
cURL
curl -s https://YOUR_HOST/api/analytics/summary | jq
Python
import requests
r = requests.get('https://YOUR_HOST/api/analytics/summary', timeout=10)
print(r.json())
JavaScript
const res = await fetch('/api/analytics/summary');
const json = await res.json();
console.log(json);
Try it out
            
Rate Limiting

Each IP is limited to 200 requests per hour and 50 requests per minute. On exceeding the limit, a 429 Too Many Requests error is returned.

Public Data & Attribution

This is a public read-only API based on open data from the Food Standards Agency. Please include the following attribution when presenting or redistributing data:

Data provided by the Food Standards Agency under Open Government License.