Open data

Built on open data. Shared back.

Where GoodSwap’s product facts come from, how they’re licensed, and how to get the product packs the app downloads.

Attribution

Open Food Facts

Food and drink product data © Open Food Facts contributors, available under the Open Database License (ODbL) 1.0. Individual contents are under the Database Contents License (DbCL) 1.0. Product photos from Open Food Facts are under CC BY-SA 3.0 and are credited in the app.

Open Beauty Facts, Open Products Facts, Open Pet Food Facts

Beauty, household and pet food data © Open Beauty Facts, Open Products Facts and Open Pet Food Facts contributors, under the ODbL 1.0.

USDA FoodData Central

U.S. Department of Agriculture, Agricultural Research Service. FoodData Central, Branded Foods. FoodData Central data are in the public domain under CC0 1.0; we credit it anyway.

In the app, the same credits are under You → Data & sources. Recall alerts come from public notices published by the FDA, USDA FSIS, CPSC, Health Canada, the CFIA and the UK Food Standards Agency, and each alert links to the agency’s own notice.

We don’t copy third-party ratings or test results into our databases. When an outside test matters, we cite it and link to it.

The product packs

To make scans work offline, the app downloads a pack of product facts for your region. Because the packs are built from Open Food Facts data, they are derivative databases, and we publish them under the ODbL 1.0, like their source.

  • What’s inside: product facts only: GTIN, name, brand, categories, quantity, ingredient codes in label order, nutrition per 100 g or ml, NOVA group, labels, allergens and “may contain” traces, diets, image path, label year, sources and markets.
  • Ingredient codes, decoded: next to the packs we publish ingredient-codes.csv (code,id,name), so the codes in the ingredients column can be read without the app. Codes are permanent and never reused.
  • What isn’t: scores, flags, receipts and swaps. The app computes those on your phone, at display time, with our knowledge base (concern levels, effects, regulatory notes and references), which is a separate database that we don’t publish under the ODbL. The method itself is public on the methodology page.
  • Not in the open-data release: products our app read from shoppers’ label photos and our reviewers verified. They are GoodSwap’s own data, not Open Food Facts data, so they are only in the packs the app downloads. Everything we publish here comes from the open sources above.
  • Regions and tiers: us (also covers Canadian products that share UPCs), gb and ca, each in a popular tier (the most-scanned products) and a full tier.
  • Format: SQLite files compressed with Brotli (quality 11, window 24, the .sqlite.br files), each with its SHA-256 checksum in a .sha256 file and in the release’s manifest.json, with its version, size and product count.

/open-data/2026.10.11/manifest.json Release 2026.10.11: the manifest lists every pack of the release and its download link. Every release stays at /open-data/<version>/.

Build recipe

Each pack is rebuilt weekly, with daily deltas, by our pipeline:

  1. Download the sources. The Open Food Facts full export (Parquet) and daily delta files; the Open Beauty Facts, Open Products Facts and Open Pet Food Facts exports (JSONL); the USDA FoodData Central Branded Foods CSV.
  2. Normalize every barcode to GTIN-14. Keep digits only (6 to 14 of them); expand UPC-E to UPC-A; left-pad with zeros; check the GS1 mod-10 digit and, for 11-digit USDA UPCs stored without one, add it. Codes for store-packed items (prefixes 02, 04 and 20–29) are flagged, because they aren’t unique across stores.
  3. Merge on GTIN-14. Open Food Facts records come first, and USDA FoodData Central fills in products and ingredient lists it’s missing.
  4. Map ingredients. Parse each ingredient list into tokens, normalize them (Unicode folding, lowercase, percentages and connector words removed) and match them to ingredient codes. Unmatched ingredients are written as 0, so the app can show how much of a list it recognized.
  5. Write SQLite files with the schema below, one per region and tier (the full tier adds a full-text search index on name and brand).
  6. Compress and publish. Compress with Brotli (quality 11, window 24), compute the SHA-256 of the compressed file, and add it to the manifest. Write ingredient-codes.csv (code,id,name) next to the packs. The open-data release is the same files without the AI-read rows, at https://goodswap.app/open-data/<version>/.

To rebuild the open-data packs yourself, run python -m pipeline.build --etl --packs from our pipeline without a database connection: it reads the open sources only, so it can’t include AI reads. Each release names the pipeline’s git commit and the dates of the source snapshots it used.

Pack schema (version 1):

CREATE TABLE meta(key TEXT PRIMARY KEY, value TEXT NOT NULL);
-- schema_version, pack_id, region, tier, pack_version, generated_at,
-- kb_codes_version, product_count, attribution, license

CREATE TABLE category(id INTEGER PRIMARY KEY, tag TEXT NOT NULL UNIQUE,
  name TEXT NOT NULL, depth INTEGER NOT NULL);

CREATE TABLE product(
  gtin INTEGER PRIMARY KEY,   -- GTIN-14 as an integer
  name TEXT NOT NULL, brand TEXT,
  kind INTEGER NOT NULL,      -- 0 food 1 beverage 2 supplement 3 cosmetic
                              -- 4 household 5 baby 6 pet 7 other
  category INTEGER, categories TEXT, quantity TEXT,
  ingredients TEXT,           -- ingredient codes in label order; 0 = unmatched
  nova INTEGER, nutrition TEXT, labels TEXT,
  allergens TEXT, traces TEXT, diets INTEGER,
  image TEXT, image_aspect REAL, label_year INTEGER,
  sources INTEGER NOT NULL,   -- 1 OFF, 2 USDA, 4 OBF, 8 OPF, 16 OPFF, 32 user
                              -- (64 = GoodSwap AI reads: app packs only, never here)
  popularity INTEGER NOT NULL DEFAULT 0,
  markets INTEGER NOT NULL,   -- 1 US, 2 GB, 4 CA
  updated INTEGER NOT NULL);

Every pack’s meta table carries its attribution and license: ODbL-1.0; includes USDA FoodData Central (CC0). Credit the open projects as shown under Attribution when you reuse them.

Fix it at the source

Found a wrong product? Correct it on Open Food Facts so every app built on open data gets the fix, or report it in GoodSwap and we’ll handle it. Questions about the data or the license: contact@goodswap.app.