Open Food Facts API

Beginner's Pick Food & Drink / No Auth Required Beginner HTTPS
Free to Use
76 B
Measured Score 0 50 100 Speed 13/30 Consistency 20/20 Security 20/20 Browser access 15/15 Transparency 8/15 TESTED 2026-08-10

Overview

Open Food Facts is a free, community-driven database of food products from around the world, containing nutritional facts, ingredients, allergens, and Eco-scores. No API key is required — you can look up any product by its barcode or search by name or nutrient. It is an excellent API for building nutrition trackers, diet apps, or sustainability dashboards.

Beginner Tip

Look up a product using its barcode number (the digits under the barcode on the package) via GET /api/v2/product/{barcode}.json — this is the most reliable way to get accurate data for a specific item.

Measurement Record

What actually happened when we called this API from our own infrastructure. Every value below was recorded by the request, not copied from the provider's documentation.

Request
GET https://world.openfoodfacts.org/api/v2/product/3017624010701.json
Result
HTTP 200 · application/json · 39,607 bytes · compressed
Response time
294 ms (median of 3) · fastest 288 ms
Transport
TLSv1.3 · TLS_AES_256_GCM_SHA384 · certificate issued by Let's Encrypt
Browser CORS
Allowed — Access-Control-Allow-Origin: *
Served by
nginx
Recorded
2026-08-10

Fields Returned

Top-level fields present in the response we captured, with the type and value we actually received.

Field Type Value received
code string 3017624010701
product object {15 fields}
status integer 1
status_verbose string product found

Captured Response

Captured from a real request to https://world.openfoodfacts.org/api/v2/product/3017624010701.json on 2026-08-10. Long arrays and nested objects are truncated to keep the shape readable.

JSON Response · Captured
{
  "code": "3017624010701",
  "product": {
    "_id": "3017624010701",
    "_keywords": [
      "brotaufstriche"
    ],
    "added_countries_tags": [],
    "additives_n": 0,
    "additives_original_tags": [],
    "additives_tags": [],
    "allergens": "Schalenfrüchte",
    "allergens_from_user": "(it) Frutta a guscio",
    "allergens_hierarchy": [
      "en:nuts"
    ],
    "allergens_lc": "de",
    "allergens_tags": [
      "en:nuts"
    ],
    "amino_acids_tags": [],
    "brands": "Ferrero",
    "brands_tags": [
      "Ferrero"
    ],
    "…": "(237 more fields)"
  },
  "status": 1,
  "status_verbose": "product found"
}

Field Reference

status 1 if the product was found, 0 if not found in the database.

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://world.openfoodfacts.org/api/v2/product/3017624010701.json";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

status 0 in response (product not found) The barcode does not exist in the Open Food Facts database yet.
Check the status field before accessing product data: if data.status === 0, show a "not found" message. You can also contribute the product at world.openfoodfacts.org.
Missing or empty nutriments fields Open Food Facts is community-sourced so data completeness varies widely by product.
Always treat nutritional fields as optional and display "N/A" when they are absent.
429 Too Many Requests Making rapid repeated requests triggers rate limiting.
Add a short delay between requests (e.g., 1 second) and cache product data locally by barcode to avoid redundant lookups.

Measured Score Breakdown

Live HTTP request to the API endpoint

Speed 13/30
Consistency 20/20
Security 20/20
Browser access 15/15
Transparency 8/15
Endpoint Response Time 294ms

Fully tested on Aug 10, 2026

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS UNKNOWN
Category Food & Drink
Difficulty Beginner
Endpoint last called: 2026-08-10

Similar APIs

View All →