Download OpenAPI specification:
UK-first food and nutrition data with gram weights on every serving.
Read-only API over the Kcalbase store. All routes are GET under /v1. Send your key as
Authorization: Bearer kb_live_.... Every response carries X-Request-Id, X-Kcalbase-Data-Version
and X-Kcalbase-Data-Updated; metered responses add the four X-Kcalbase-Quota-* headers.
Open-layer rows carry an attribution block your app must render (ODbL, Open Food Facts; OGL, CoFID).
| q required | string [ 1 .. 100 ] characters Search text. Trimmed; case-insensitive. |
| limit | integer [ 1 .. 25 ] Default: 10 Clamped into range. |
| cursor | string Opaque cursor from |
{- "query": "string",
- "matched": "exact",
- "results": [
- {
- "id": "string",
- "layer": "open",
- "food_type": "generic",
- "name": "string",
- "brand": "string",
- "barcode": "string",
- "categories": [
- "string"
], - "allergens": [
- "string"
], - "basis": "g",
- "per_100": {
- "energy_kcal": 0,
- "protein_g": 0,
- "carbs_g": 0,
- "sugars_g": 0,
- "fat_g": 0,
- "saturated_fat_g": 0,
- "fibre_g": 0,
- "salt_g": 0
}, - "servings": [
- {
- "id": "string",
- "label": "string",
- "quantity": 0,
- "unit": "string",
- "grams": 0,
- "grams_source": "published",
- "is_default": true,
- "nutrients": {
- "energy_kcal": 0,
- "protein_g": 0,
- "carbs_g": 0,
- "sugars_g": 0,
- "fat_g": 0,
- "saturated_fat_g": 0,
- "fibre_g": 0,
- "salt_g": 0
}
}
], - "images": {
}, - "quality": {
- "gate_status": "pass",
- "flags": [
- "string"
], - "completeness": 100
}, - "provenance": {
- "source": "string",
- "source_id": "string",
- "licence": "ODbL-1.0",
- "retrieved_at": "2019-08-24T14:15:22Z",
- "source_modified_at": "string"
}, - "updated_at": "2019-08-24T14:15:22Z"
}
], - "next_cursor": "string"
}| q required | string [ 2 .. 100 ] characters |
| limit | integer [ 1 .. 10 ] Default: 8 |
{- "query": "string",
- "suggestions": [
- {
- "id": "string",
- "name": "string",
- "brand": "string",
- "default_serving": "string"
}
]
}| code required | string^[0-9]{8}$|^[0-9]{12,14}$ 8, 12, 13 or 14 digits; normalised to GTIN-14. |
{- "id": "string",
- "layer": "open",
- "food_type": "generic",
- "name": "string",
- "brand": "string",
- "barcode": "string",
- "categories": [
- "string"
], - "allergens": [
- "string"
], - "basis": "g",
- "per_100": {
- "energy_kcal": 0,
- "protein_g": 0,
- "carbs_g": 0,
- "sugars_g": 0,
- "fat_g": 0,
- "saturated_fat_g": 0,
- "fibre_g": 0,
- "salt_g": 0
}, - "servings": [
- {
- "id": "string",
- "label": "string",
- "quantity": 0,
- "unit": "string",
- "grams": 0,
- "grams_source": "published",
- "is_default": true,
- "nutrients": {
- "energy_kcal": 0,
- "protein_g": 0,
- "carbs_g": 0,
- "sugars_g": 0,
- "fat_g": 0,
- "saturated_fat_g": 0,
- "fibre_g": 0,
- "salt_g": 0
}
}
], - "images": {
}, - "quality": {
- "gate_status": "pass",
- "flags": [
- "string"
], - "completeness": 100
}, - "provenance": {
- "source": "string",
- "source_id": "string",
- "licence": "ODbL-1.0",
- "retrieved_at": "2019-08-24T14:15:22Z",
- "source_modified_at": "string"
}, - "updated_at": "2019-08-24T14:15:22Z"
}| barcodes | string Comma-separated barcodes. |
| ids | string Comma-separated Kcalbase ids. |
{- "found": [
- {
- "id": "string",
- "layer": "open",
- "food_type": "generic",
- "name": "string",
- "brand": "string",
- "barcode": "string",
- "categories": [
- "string"
], - "allergens": [
- "string"
], - "basis": "g",
- "per_100": {
- "energy_kcal": 0,
- "protein_g": 0,
- "carbs_g": 0,
- "sugars_g": 0,
- "fat_g": 0,
- "saturated_fat_g": 0,
- "fibre_g": 0,
- "salt_g": 0
}, - "servings": [
- {
- "id": "string",
- "label": "string",
- "quantity": 0,
- "unit": "string",
- "grams": 0,
- "grams_source": "published",
- "is_default": true,
- "nutrients": {
- "energy_kcal": 0,
- "protein_g": 0,
- "carbs_g": 0,
- "sugars_g": 0,
- "fat_g": 0,
- "saturated_fat_g": 0,
- "fibre_g": 0,
- "salt_g": 0
}
}
], - "images": {
}, - "quality": {
- "gate_status": "pass",
- "flags": [
- "string"
], - "completeness": 100
}, - "provenance": {
- "source": "string",
- "source_id": "string",
- "licence": "ODbL-1.0",
- "retrieved_at": "2019-08-24T14:15:22Z",
- "source_modified_at": "string"
}, - "updated_at": "2019-08-24T14:15:22Z"
}
], - "missing": [
- "string"
]
}| id required | string^[0-9A-HJKMNP-TV-Z]{26}$ |
{- "id": "string",
- "layer": "open",
- "food_type": "generic",
- "name": "string",
- "brand": "string",
- "barcode": "string",
- "categories": [
- "string"
], - "allergens": [
- "string"
], - "basis": "g",
- "per_100": {
- "energy_kcal": 0,
- "protein_g": 0,
- "carbs_g": 0,
- "sugars_g": 0,
- "fat_g": 0,
- "saturated_fat_g": 0,
- "fibre_g": 0,
- "salt_g": 0
}, - "servings": [
- {
- "id": "string",
- "label": "string",
- "quantity": 0,
- "unit": "string",
- "grams": 0,
- "grams_source": "published",
- "is_default": true,
- "nutrients": {
- "energy_kcal": 0,
- "protein_g": 0,
- "carbs_g": 0,
- "sugars_g": 0,
- "fat_g": 0,
- "saturated_fat_g": 0,
- "fibre_g": 0,
- "salt_g": 0
}
}
], - "images": {
}, - "quality": {
- "gate_status": "pass",
- "flags": [
- "string"
], - "completeness": 100
}, - "provenance": {
- "source": "string",
- "source_id": "string",
- "licence": "ODbL-1.0",
- "retrieved_at": "2019-08-24T14:15:22Z",
- "source_modified_at": "string"
}, - "updated_at": "2019-08-24T14:15:22Z"
}