Developer documentation · v1.0.0
AllergenQR API
UK statutory allergen registers, QR menus and PPDS (Natasha's Law) validation.
UK statutory allergen registers, QR menus and PPDS (Natasha's Law) validation. The AllergenQR API is a HTTP/JSON API with predictable resource URLs, Bearer or API-key authentication and published rate limits on every response. All monetary values are in pence; all times are UTC.
Base URL & versioning
All endpoints are relative to https://allergenqr.co.uk. The API version is in the path
(/api/v1/) so breaking changes are introduced under a new prefix.
Authentication
FREE endpoints may be called anonymously. Paid endpoints require either
Authorization: Bearer <token> or X-API-Key: <key>.
Keys are scoped to a plan and carry their own quota; never expose them in client-side code.
API keys & Bearer tokens
Create and revoke keys in your account dashboard. A rotated key takes effect immediately. Sending both headers is supported; the Bearer token takes precedence.
Plans & quotas
| Tier | Rate limit | Monthly quota | Includes |
|---|---|---|---|
| FREE | 20 requests/minute | 100 requests/month | Allergen register and public menus |
| PRO | 300 requests/minute | 25,000 requests/month | Menu item CRUD and PPDS validation |
| SCALE | 1500 requests/minute | 150,000 requests/month | Multi-venue audit logs (GROUP plan) |
Rate-limit headers
Every 200 response includes X-RateLimit-Limit, X-RateLimit-Remaining,
X-RateLimit-Reset, X-Quota-Monthly-Limit and X-Quota-Monthly-Remaining.
On 429, read Retry-After (seconds) before retrying.
Errors & status codes
Errors use RFC 9457 application/problem+json: type, title,
status, detail and optionally instance.
| Status | Meaning |
|---|---|
| 400 | Invalid parameters or body |
| 401 | Missing or invalid credentials |
| 403 | Plan Upgrade Required |
| 429 | Rate limit exceeded — see Retry-After |
Plan Upgrade Required
A 403 response includes an upgrade_url and required_plan so tools can
direct the user to the correct tier.
Webhooks
Menu and allergen-change events are delivered as HTTPS POST requests with an X-Webhook-Signature header. GROUP plans may subscribe to venue audit events.
/api/v1/allergens/uk-statutoryList UK statutory allergens
Returns all 14 UK statutory allergens plus cereal sub-types, tree-nut sub-types and icon slugs for label rendering.
curl -X GET 'https://allergenqr.co.uk/api/v1/allergens/uk-statutory'
const res = await fetch('https://allergenqr.co.uk/api/v1/allergens/uk-statutory', {
method: 'GET',
});
const data = await res.json();
import { request } from 'undici';
const { statusCode, body } = await request('https://allergenqr.co.uk/api/v1/allergens/uk-statutory', {
method: 'GET',
});
console.log(statusCode, await body.json());
import requests
r = requests.get(
'https://allergenqr.co.uk/api/v1/allergens/uk-statutory',
)
print(r.status_code, r.json())
<?php
$ch = curl_init('https://allergenqr.co.uk/api/v1/allergens/uk-statutory');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$body = curl_exec($ch);
echo $body;
package main
import (
"fmt"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://allergenqr.co.uk/api/v1/allergens/uk-statutory", nil)
res, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer res.Body.Close()
fmt.Println(res.StatusCode)
}Sample 200 response
{
"count": 14,
"allergens": [
{
"slug": "gluten",
"name": "Gluten",
"statutory": true,
"icon_slug": "gluten-wheat",
"sub_types": [
"wheat",
"barley",
"rye",
"oats",
"spelt"
],
"bold_markup_required": true
},
{
"slug": "milk",
"name": "Milk",
"statutory": true,
"icon_slug": "milk",
"sub_types": [],
"bold_markup_required": true
}
]
}Sample 401 response
{
"type": "https://httpstatuses.com/401",
"title": "Unauthorized",
"status": 401,
"detail": "Provide a valid Bearer token or X-API-Key header.",
"instance": "/api/v1/"
}Sample 403 response — Plan Upgrade Required
{
"type": "https://httpstatuses.com/403",
"title": "Plan Upgrade Required",
"status": 403,
"detail": "This operation requires a higher plan tier.",
"instance": "/api/v1/",
"upgrade_url": "https://allergenqr.co.uk/pricing",
"required_plan": "PRO"
}Sample 429 response — problem+json
{
"type": "https://httpstatuses.com/429",
"title": "Too Many Requests",
"status": 429,
"detail": "Rate limit exceeded for the current window.",
"instance": "/api/v1/",
"retry_after_seconds": 30
}Try It Live
FREE endpoint — call it directly, no key needed.
/api/v1/validate/ppdsValidate PPDS allergen markup
Checks Natasha's Law PPDS labelling: statutory allergens must appear in bold on the label. Requires the PRO plan (GROUP for multi-venue).
Request body
| Field | Type | Default | Description | Constraints |
|---|---|---|---|---|
label_markup | string | — | required, minLength: 1 | |
allergens | array<string> | — | required, minItems: 1 |
curl -X POST 'https://allergenqr.co.uk/api/v1/validate/ppds' \
-H 'Authorization: Bearer $API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"label_markup": "Contains <strong>milk</strong> and <strong>gluten</strong>.", "allergens": ["milk", "gluten"]}'
const res = await fetch('https://allergenqr.co.uk/api/v1/validate/ppds', {
method: 'POST',
headers: { 'Authorization': `Bearer ${token}`, 'X-API-Key': key },
body: JSON.stringify({"label_markup": "Contains <strong>milk</strong> and <strong>gluten</strong>.", "allergens": ["milk", "gluten"]}),
});
const data = await res.json();
import { request } from 'undici';
const { statusCode, body } = await request('https://allergenqr.co.uk/api/v1/validate/ppds', {
method: 'POST',
headers: { authorization: `Bearer ${process.env.API_TOKEN}` },
body: JSON.stringify({"label_markup": "Contains <strong>milk</strong> and <strong>gluten</strong>.", "allergens": ["milk", "gluten"]}),
});
console.log(statusCode, await body.json());
import requests
r = requests.post(
'https://allergenqr.co.uk/api/v1/validate/ppds',
headers={'Authorization': f'Bearer {token}'},
json={"label_markup": "Contains <strong>milk</strong> and <strong>gluten</strong>.", "allergens": ["milk", "gluten"]},
)
print(r.status_code, r.json())
<?php
$ch = curl_init('https://allergenqr.co.uk/api/v1/validate/ppds');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"label_markup\": \"Contains <strong>milk</strong> and <strong>gluten</strong>.\", \"allergens\": [\"milk\", \"gluten\"]}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$body = curl_exec($ch);
echo $body;
package main
import (
"fmt"
"net/http"
)
func main() {
req, _ := http.NewRequest("POST", "https://allergenqr.co.uk/api/v1/validate/ppds", nil)
req.Header.Set("Authorization", "Bearer "+token)
res, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer res.Body.Close()
fmt.Println(res.StatusCode)
}Sample 200 response
{
"valid": true,
"missing_bold": [],
"group_id": "group_4Tp"
}Sample 401 response
{
"type": "https://httpstatuses.com/401",
"title": "Unauthorized",
"status": 401,
"detail": "Provide a valid Bearer token or X-API-Key header.",
"instance": "/api/v1/"
}Sample 403 response — Plan Upgrade Required
{
"type": "https://httpstatuses.com/403",
"title": "Plan Upgrade Required",
"status": 403,
"detail": "This operation requires a higher plan tier.",
"instance": "/api/v1/",
"upgrade_url": "https://allergenqr.co.uk/pricing",
"required_plan": "PRO"
}Sample 429 response — problem+json
{
"type": "https://httpstatuses.com/429",
"title": "Too Many Requests",
"status": 429,
"detail": "Rate limit exceeded for the current window.",
"instance": "/api/v1/",
"retry_after_seconds": 30
}Try It Live
Paid endpoint — paste a Bearer key below. It is used only in this browser session.
/api/v1/venues/{venueId}/audit-logGet a venue audit log
Returns the allergen-change audit trail for a venue across a group. Requires the GROUP plan.
Path & query parameters
| Name | In | Type | Description | Constraints |
|---|---|---|---|---|
venueId | path | string | Venue identifier. | required |
page | query | integer | Page number. | optional, minimum: 1, default: 1 |
curl -X GET 'https://allergenqr.co.uk/api/v1/venues/venue_9Kp2/audit-log' \
-H 'Authorization: Bearer $API_TOKEN'
const res = await fetch('https://allergenqr.co.uk/api/v1/venues/venue_9Kp2/audit-log', {
method: 'GET',
headers: { 'Authorization': `Bearer ${token}`, 'X-API-Key': key },
});
const data = await res.json();
import { request } from 'undici';
const { statusCode, body } = await request('https://allergenqr.co.uk/api/v1/venues/venue_9Kp2/audit-log', {
method: 'GET',
headers: { authorization: `Bearer ${process.env.API_TOKEN}` },
});
console.log(statusCode, await body.json());
import requests
r = requests.get(
'https://allergenqr.co.uk/api/v1/venues/venue_9Kp2/audit-log',
headers={'Authorization': f'Bearer {token}'},
)
print(r.status_code, r.json())
<?php
$ch = curl_init('https://allergenqr.co.uk/api/v1/venues/venue_9Kp2/audit-log');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer ' . $token]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$body = curl_exec($ch);
echo $body;
package main
import (
"fmt"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://allergenqr.co.uk/api/v1/venues/venue_9Kp2/audit-log", nil)
req.Header.Set("Authorization", "Bearer "+token)
res, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer res.Body.Close()
fmt.Println(res.StatusCode)
}Sample 200 response
{
"events": [
{
"at": "2026-06-01T10:00:00Z",
"actor": "user_1Qw",
"change": "allergen_added:nuts"
}
],
"page": 1
}Sample 401 response
{
"type": "https://httpstatuses.com/401",
"title": "Unauthorized",
"status": 401,
"detail": "Provide a valid Bearer token or X-API-Key header.",
"instance": "/api/v1/"
}Sample 403 response — Plan Upgrade Required
{
"type": "https://httpstatuses.com/403",
"title": "Plan Upgrade Required",
"status": 403,
"detail": "This operation requires a higher plan tier.",
"instance": "/api/v1/",
"upgrade_url": "https://allergenqr.co.uk/pricing",
"required_plan": "PRO"
}Sample 429 response — problem+json
{
"type": "https://httpstatuses.com/429",
"title": "Too Many Requests",
"status": 429,
"detail": "Rate limit exceeded for the current window.",
"instance": "/api/v1/",
"retry_after_seconds": 30
}Try It Live
Paid endpoint — paste a Bearer key below. It is used only in this browser session.