Glossary

barcode JSON API v2

A barcode JSON API v2 is a read endpoint that returns one product record as JSON for a barcode supplied in the URL. Open Food Facts serves product JSON at /api/v2/product/{barcode}.json across its 4,697,746-product index, updated in realtime. The catalog it serves holds 4,697,746 indexed products with Nutri-Score and Green-Score, and is filterable by category.

What is barcode JSON API v2?

The barcode JSON API v2 is the live read pattern behind the Open Food Facts database: you append an EAN/UPC barcode to /api/v2/product/{barcode}.json and receive that single product's record as JSON. The catalog it serves holds 4,697,746 indexed products with Nutri-Score and Green-Score, and is filterable by category. Open Food Facts lists 'JSON (API v2)' among its data formats and marks the feed's update frequency as realtime, so a record edited today is what the endpoint returns today. The same project also publishes nightly exports, which makes the API the freshest access path and the exports the cheapest bulk path; both are covered by the project's open licence.

Why does barcode JSON API v2 matter when choosing a dataset?

Without a per-barcode endpoint you fetch whole files to answer one product question. A price or shelf-audit workflow that scans a handful of SKUs would otherwise download and re-parse a large catalog on every run. The v2 pattern keeps lookups one request per item and returns structured JSON rather than a page to scrape. It matters most when freshness does: because Open Food Facts updates in realtime, an app that checks a barcode at scan time sees contributions made minutes earlier, while an export-based pipeline shows yesterday's snapshot. Buyers should still confirm the volume profile - polling millions of barcodes one call at a time is slower than pulling the nightly file once.

How do you evaluate barcode JSON API v2 in a data source?

  1. Confirm the URL shape: Open Food Facts documents product JSON at /api/v2/product/{barcode}.json, so any source claiming v2 compatibility should expose the same per-barcode path.
  1. Check index depth against your need: the endpoint covers 4,697,746 indexed products - if your category coverage matters, verify records exist before building on it.
  1. Check enrichment fields, not just a payload: the Open Food Facts API carries Nutri-Score and Green-Score and supports category filtering.
  1. Check update cadence: Open Food Facts lists its data_formats as including 'JSON (API v2)' and its update_frequency as realtime, paired with nightly full exports.

Frequently asked questions

What does the barcode JSON API v2 return?

It returns one product record as JSON per barcode requested. Open Food Facts implements it at /api/v2/product/{barcode}.json over 4,697,746 indexed products, each carrying Nutri-Score and Green-Score fields and filterable by category.

Is the barcode JSON API v2 updated in realtime?

Yes. Open Food Facts lists 'JSON (API v2)' among its data formats with an update frequency of realtime, meaning edits to the crowd-sourced catalog are visible through the endpoint immediately, alongside separate nightly export files.

How large is the catalog behind the API?

The Open Food Facts source profile reports a live JSON API v2 running over 4,697,746 indexed products, making it one of the larger open food composition indexes available without a key.

Datasets containing this field

Datasets containing barcode JSON API v2

6 datasets carry barcode json api v2 in the catalog. Open one, count the fields, judge for yourself.

Packaged Foods & Meats

Open Food Facts - Open Database & API

Packaged Foods & Meats United States, with state-level… · 2004 to the present

openFDA Food Enforcement (Recalls) API Data

Packaged Foods & Meats United States-focused grocery products · Current catalog snapshot

Spoonacular Food API - Product Search

badges · importantBadges · ingredients …+2 more

Packaged Foods & Meats

USDA AMS Market News - Livestock, Poultry & Grain

Packaged Foods & Meats

USDA ERS Food Availability (Per Capita) Data System

Packaged Foods & Meats United States national plus all 50… · Current annual series from 1997

USDA ERS Food Expenditure Series

Every listing shows the field dictionary, sample rows, and coverage before you commit. API, files, or your warehouse. Daily, weekly, or hourly.

Get sample rows