Datasets:
The Food API: Packaged Food & Beverage Products Dataset
Normalized packaged-food and beverage product data, keyed by barcode, for food-tech, nutrition apps and e-commerce.
This repository is the free evaluation sample of The Food API: one record per product with the barcode, the full ingredient statement and its parsed tree, declared and precautionary allergens, the nutrition panel, package claims and warnings, and the product and label photos. Every field is normalized to one documented schema, so it drops into a recommendation engine, a barcode scanner app or a training set on day one instead of after weeks of cleaning.
Join the waitlist for launch pricing and the full catalogue
π Dataset Overview (release 2026.09, as of 23 September 2026)
- Records: 993 products across 520 brands (587 foods, 406 beverages), sold in the US
- Barcodes: a checksum-validated 14-digit GTIN on every product (
gtin), so any scanned UPC/EAN resolves directly - Ingredients: the ingredient statement as printed on every product, parsed into a component and sub-ingredient tree on 96%
- Nutrition panel: nutrient rows on 548 products; allergen declaration or precaution on 247
- Images: 1,286 files: 986 main product images plus label photos (ingredient list, nutrition panel, back of pack) on 190 products, all named by content hash
- Formats: interchangeable JSONL and CSV, one product per line or row
π‘ Data Capabilities
1. Ingredient & Allergen Intelligence
Each product is parsed into structured fields that read like the label, not like a scrape.
- Ingredient tree:
ingredients_parsedkeeps label order, groups by labelled component (Filling,Crust), nests the parenthesized sub-ingredients of compound ingredients, and carries theContains 2% or less ofthreshold asmax_percent. - Allergens as identities:
allergens_declaredandallergens_may_containuse fixed identities (milk,wheat,soy,peanut,tree_nut,sesame, β¦) for filtering, with the exact package wording preserved inallergens_statement. - Sweeteners and claims: non-nutritive sweeteners and sugar alcohols named in the ingredients (
sucralose,steviol_glycosides,erythritol, β¦), dietary claims as stated (Gluten-Free,Organic,Vegetarian), anorganicflag, caffeine statements and analcoholic_beverageflag. - Warnings: Proposition 65 notices, phenylketonuria statements and choking or heat cautions, verbatim.
2. Nutrition Data
A nutrition panel in rows, ready for per-serving calculations and scoring.
- Nutrient rows:
nutrition_nutrientsholds each printed row withname,amount,unitanddaily_value_percent, with common label variants normalized (Total Carbohydrate,Added Sugars,Vitamin D). - Explicit basis:
nutrition_basisandnutrition_preparationsay what the amounts refer to (per_serving,per_100g,as_sold,as_prepared), andnutrition_serving_sizekeeps the serving as printed. Values are never converted between bases. - Null is never a claim: a missing row means the panel did not print it; a null allergen list means none was found, not allergen-free.
3. Machine Learning & Computer Vision
Pre-labelled images tied to structured ground truth.
- Label reading: 316 label photos (ingredient lists, nutrition panels, back of pack) paired with the transcribed ingredient statement, nutrient rows and allergen text of the same product, for training and evaluating OCR and vision-language extraction.
- Product recognition: main product images mapped to brand, name, category path and barcode for visual search and shelf-audit models.
- Classification:
product_type, thecategorypath,food_condition,food_formandflavoras targets.
4. E-commerce Enrichment (B2B)
Metadata designed to enrich product pages and power in-app scanning.
- Barcode matching: join the catalogue to your own inventory or a scanner app on the canonical GTIN-14 (pad the scanned code to 14 digits first).
- Page enrichment: ingredient lists, nutrition panels, allergen badges and dietary filters from one record.
- Stable identity: permanent integer ids and
updated_attimestamps, so a later release can be diffed against this one by id.
Technical Schema
The dataset is delivered in interchangeable JSONL and CSV formats. Every record is flat: each field is a scalar, a list, or one of two small structures (nutrition_nutrients, ingredients_parsed), so a product is one row everywhere. Null always means the fact was not stated by the source or could not be read; it is never a negative claim.
Product fields
| Field | Type | Nullable | Description |
|---|---|---|---|
id |
integer | no | Permanent product id. Gaps are normal; an id is never renumbered or reused, so it is safe to key on across releases. |
gtin |
string | no | Barcode in canonical GTIN-14 form (14 digits, left-zero-padded: UPC-A 28239002169 appears as 00028239002169). Checksum-validated. |
name |
string | no | Product title as sold, including variant and package wording ((4 pack) β¦, β¦, 16 oz). |
brand |
string | no | Brand name. |
product_type |
string | no | food or beverage. |
category |
array<string> | no | Category path from broad to narrow, e.g. ["Food", "Snacks, Cookies & Chips", "Cookies"]. |
net_content |
string | yes | Package quantity as printed, e.g. 16 oz, 12 fl oz, 12 count. |
pack_count |
integer | yes | Number of units in a multipack, when stated. |
food_condition |
string | yes | Storage condition as stated, lowercased: shelf_stable, refrigerated, frozen, dry, ready-to-eat, β¦ |
food_form |
string | yes | Physical form as stated, lowercased, e.g. whole, powder, liquid. |
flavor |
string | yes | Flavor as stated. |
dietary_claims |
array<string> | yes | Claims as stated on the listing or pack, e.g. Gluten-Free, Organic, Vegetarian, Natural. |
organic |
boolean | yes | true when the product carries an organic claim; otherwise null, never false. |
ingredients |
string | no | The full ingredient statement as printed, with formatting cleaned but no words changed. |
ingredients_parsed |
array<object> | yes | The statement as a tree of components and ingredients in label order; see Ingredient tree below. Null when the statement could not be parsed reliably; the text is still in ingredients. |
sweeteners |
array<string> | yes | Non-nutritive sweeteners and sugar alcohols named in the ingredients, as identities in order of appearance: aspartame, sucralose, acesulfame_potassium, saccharin, steviol_glycosides, monk_fruit_extract, erythritol, xylitol, sorbitol, maltitol, allulose, β¦ Sugars, syrups and honey are not listed. |
allergens_declared |
array<string> | yes | Allergens the package declares it contains (Contains: β¦), as identities: milk, egg, wheat, soy, peanut, tree_nut, almond, cashew, walnut, pecan, hazelnut, pistachio, macadamia, brazil_nut, sesame, fish, shellfish, crustacean, mustard, celery, sulfite, coconut, gluten. |
allergens_may_contain |
array<string> | yes | Precautionary allergens, same identities: May contain β¦ claims and facility, equipment or line notes. |
allergens_statement |
string | yes | The allergen wording verbatim, including facility notes. |
nutrition_serving_size |
string | yes | Serving size as printed, e.g. 3 cookies (30g). |
nutrition_servings_per_container |
number | yes | Servings per container, when stated. |
nutrition_basis |
string | no | What the nutrient amounts refer to: per_serving, per_100g, per_100ml, or unknown when the source gave the rows without saying. |
nutrition_preparation |
string | no | Which panel column the rows come from: as_sold, as_prepared, or unknown. |
nutrition_nutrients |
array<object> | no | Nutrient rows in label order; see Nutrient rows below. Empty [] when no panel was available. |
caffeine_statement |
string | yes | The caffeine claim verbatim: Caffeine-Free, Decaffeinated, Naturally Caffeinated. |
caffeine_amount_mg, caffeine_basis |
β | yes | Reserved, always null in this version. |
alcoholic_beverage |
boolean | no | true when the product is an alcoholic beverage (a stated ABV of 0.5% or more, or listed as one). |
alcohol_percent |
number | yes | Alcohol by volume as stated, e.g. 4.7. Null when not stated. |
warnings |
array<string> | yes | Package warnings verbatim: Proposition 65 notices, phenylketonuria statements, choking and heat cautions, allergen warning text. |
front_of_pack_warnings |
β | yes | Reserved, always null in this version. |
directions |
string | yes | Preparation, use and safe-handling instructions as supplied. |
countries_of_sale |
array<string> | no | ISO 3166 country codes where the product is sold, e.g. ["US"]. |
additives, nutri_score, nova_group |
β | yes | Reserved, always null in this version. |
image_name |
string | yes | Filename of the main product image in images/; see Images below. |
label_image_names |
array<string> | yes | Filenames of the other package photos (ingredient list, nutrition panel, back of pack), in a fixed order without duplicates. |
source_name, source_url |
β | yes | Always null; no source attribution is published. |
updated_at |
string | no | ISO 8601 timestamp of the release in which this record's data last changed. |
nutrition_nutrients[] object fields
{ "name": "Total Fat", "amount": 5, "unit": "g", "daily_value_percent": 6 }
| Field | Type | Nullable | Description |
|---|---|---|---|
name |
string | no | The row label as printed, with common variants normalized (Total Carbohydrate, Added Sugars, Vitamin D). |
amount |
number | yes | The printed quantity. A printed zero is 0. A value not stated, or printed as a bound (less than 1g), is null. |
unit |
string | yes | The unit of amount: g, mg, mcg, and kcal for Calories. Null when amount is null. |
daily_value_percent |
number | yes | The printed % Daily Value, or null when none is printed. Rows that print only a % Daily Value (Iron 4%) have amount and unit null. |
Amounts refer to nutrition_serving_size when nutrition_basis is per_serving. A missing row means the panel did not print it, not zero.
ingredients_parsed[] object fields (ingredient tree)
[
{
"component": null,
"ingredients": [
{ "name": "Sugar", "max_percent": null, "sub_ingredients": null },
{
"name": "Peanut Butter Chips",
"max_percent": null,
"sub_ingredients": [
{ "name": "Partially Defatted Peanuts", "max_percent": null, "sub_ingredients": null }
]
},
{ "name": "Salt", "max_percent": 2, "sub_ingredients": null }
]
}
]
Order follows the statement, which by regulation lists ingredients in descending order of weight.
| Field | Type | Nullable | Description |
|---|---|---|---|
component |
string | yes | A labelled part of the product (Filling, Crust, Vitamins and Minerals); null for a plain list. |
ingredients |
array<object> | no | The ingredients of that component, in label order. |
ingredients[].name |
string | no | The ingredient as printed. |
ingredients[].max_percent |
number | yes | Set from threshold wording (Contains 2% or less of:) on each ingredient it covers; an upper bound, not a measured share. Null otherwise. |
ingredients[].sub_ingredients |
array<object> | yes | The parenthesized ingredients of a compound ingredient, each with the same three fields (nesting continues as deep as the label does); null for a simple ingredient. |
Format notes
JSONL (food_data.jsonl). One JSON object per line, records sorted ascending by id, keys in alphabetical order. Arrays stay arrays, objects stay objects, booleans stay booleans, nulls stay null. Preferred for programmatic use.
CSV (food_data.csv). The same products, one per row, in the same id order, with the same field names. UTF-8 without BOM, CRLF line endings, RFC 4180 quoting; embedded line breaks in text are replaced by spaces. Null is an empty cell. Booleans are the literal strings True / False. List and structured fields (category, dietary_claims, the allergens_* lists, sweeteners, warnings, countries_of_sale, label_image_names, nutrition_nutrients, ingredients_parsed) are stored as their JSON text, not split into columns. gtin keeps its leading zeros; open it as text, not a number.
import pandas as pd, json
df = pd.read_json("food_data.jsonl", lines=True) # arrays and nested values stay native
df = pd.read_csv("food_data.csv", dtype={"gtin": str}, keep_default_na=False)
for c in ["category", "allergens_declared", "allergens_may_contain", "nutrition_nutrients", "ingredients_parsed"]:
df[c] = df[c].map(lambda s: json.loads(s) if s else None)
Images
- Files live flat in
images/, named by the SHA-256 of their bytes plus their format:<sha256>.jpg,.pngor.webp. The same bytes always get the same name, so a photo shared by two listings is one file. image_nameis the main product image;label_image_nameslists the other package photos. Both hold bare filenames.- Label photos are the source of the nutrition rows and allergen declarations on many products, so a consumer can check an extracted value against the package.
- 7 products have no main image (
image_nameisnull); their records are complete, only the picture is absent.
Notes and caveats
- Values are as printed. Ingredient statements, allergen wording, nutrient amounts, claims and warnings are transcribed from the listing and the package, not measured, scored or reinterpreted. Where a source and the package disagreed, the current package wins.
- Null is not "no". An absent allergen list, claim or warning means none was found in the sources, not that the product is free of it. Allergen identities are a reading aid, not a complete allergy assessment;
allergens_statementcarries the exact wording. - Nutrition rows are per the stated basis.
nutrition_basis: "unknown"means the source supplied the rows without a serving size, and the amounts should be read with that in mind. - One product, one record. A listing that sells the same package under several item numbers appears once; multipacks are separate products with their own GTIN and
pack_count. - No PII. Product catalogue information only.
Licensing
This sample dataset is provided under the CC BY-NC 4.0 license for non-commercial research and evaluation.
Commercial Access: For production apps, commercial AI training or retail tools, a commercial license is required. The Food API launches with one-time dataset licenses (CSV, JSONL and SQLite snapshots with a full data dictionary) and a hosted API to follow. Visit thefoodapi.io to join the waitlist for launch pricing and the full catalogue.
- Downloads last month
- 213