# Open Food Facts derived food export

The snapshot is `fi6`. `gainzz-food-off-derived-fi6.jsonl.gz` contains each FI6 tier-3 row, as
served by Gainzz, with the Open Food Facts ID, name, brand, GTINs, per-100 g nutrition, serving
and portion data, category, product source URL, and source license.

The pinned Open Food Facts source release is 2026-10-10 06:49:23 UTC (object version
`30pUulInaDxqnSqZqENUDAqOaPxShdXD`; ETag `2f31c68f4f2031a9a88f3b6c1c45be30-782`).

Open Food Facts data is licensed under the [Open Database License
(ODbL-1.0)](https://opendatacommons.org/licenses/odbl/1-0/); the database contents also carry
the [Database Contents License (DbCL-1.0)](https://opendatacommons.org/licenses/dbcl/1-0/). The
exported tier-3 database is offered under ODbL-1.0. Open Food Facts attribution and the source
URL are retained in the records.

## Build method

FI6 was built from the pinned Open Food Facts JSONL snapshot. The existing food index gate
filters invalid or incomplete products, supported-country scope, nutrition quality, and invalid
GTINs. The build then deduplicates by GTIN and near-identical name/brand/nutrient content, applies
the reviewed curation rules, and writes the local SQLite index. See
[`build-food-index.mjs`](build-food-index.mjs), [`food-ingest.mjs`](food-ingest.mjs),
[`curate-food-build.mjs`](curate-food-build.mjs), and [`food-manifest.mjs`](food-manifest.mjs).

Export the tier-3 rows from the local FI6 database with:

```sh
node scripts/food-db/export-odbl.mjs \
  --db "$HOME/food-build/cg14/fi6/foods.db" \
  --out "$HOME/food-build/cg14/fi6/gainzz-food-off-derived-fi6.jsonl.gz"
```

The exporter checks that every tier-3 row is Open Food Facts and normalized per 100 g. It
includes primary and deduplicated barcode alias GTINs. USDA Foundation, SR Legacy, FNDDS and
Branded rows are public-domain/CC0 source data and are not included. Restaurant rows are not
included; no restaurant extract or restaurant append is used by this export.

`node tests/food-odbl-export.mjs` checks the gzip JSONL schema, all tier-3 rows in its fixture,
barcode aliases, nutrition, portions, and exclusion of USDA and restaurant tiers. The production
FI6 export contains 334,470 tier-3 rows.

## Download the database

The Open Food Facts-derived FI6 database is available here:

- [Download the compressed JSONL database](https://pub-f9f8e4b09610463db971807679ae4dea.r2.dev/gainzz-food-off-derived-fi6.jsonl.gz)
- [This ODbL README](https://pub-f9f8e4b09610463db971807679ae4dea.r2.dev/ODBL-README.md)

SHA-256 of `gainzz-food-off-derived-fi6.jsonl.gz`:
`f4341e79f9bb0512762dba075ad0fb11347a7803476631b5000c082677baee5a`
