Openfoodfacts Scraper avatar

Openfoodfacts Scraper

Pricing

Pay per event

Go to Apify Store
Openfoodfacts Scraper

Openfoodfacts Scraper

Extract food product data from Open Food Facts. Get nutrition facts, ingredients, Nutri-Score, allergens, and labels for 3M+ products. Filter by category, country, grade.

Pricing

Pay per event

Rating

0.0

(0)

Developer

Stas Persiianenko

Stas Persiianenko

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

12 hours ago

Last modified

Share

Open Food Facts Scraper

Search the Open Food Facts database and extract detailed food product data including nutrition facts, ingredients, Nutri-Score grades, allergens, barcodes, and labels for products sold worldwide.

What does Open Food Facts Scraper do?

This actor searches Open Food Facts — the world's largest open food product database with over 3 million products — and returns structured data for each matching product. It extracts:

  • Product identifiers: barcode (EAN/UPC), product name, brand
  • Nutrition facts per 100g: calories, fat, saturated fat, carbs, sugars, fiber, proteins, salt, sodium
  • Quality scores: Nutri-Score (A–E), NOVA food processing group (1–4), Eco-Score
  • Ingredients & allergens: full ingredient text, allergen list, traces
  • Labels & categories: organic, fair trade, vegan, kosher, and more
  • Origin data: countries where sold, product origins

Why use Open Food Facts Scraper?

  • Free, open data — Open Food Facts is a collaborative, community-maintained database with no licensing fees
  • 3M+ products — one of the largest food databases covering 180+ countries
  • Rich nutrition data — complete nutrition facts per 100g for most products
  • Nutri-Score & Eco-Score — quality grades that are increasingly required on EU food labels
  • No rate limits — search freely without API key restrictions
  • Structured output — clean JSON ready for analysis, dashboards, or integration

Use cases

  • Nutrition analysis: Compare nutrition profiles across brands and categories
  • Health app backends: Power food databases, calorie counters, and diet trackers
  • Market research: Analyze product availability and brand presence by country
  • Label compliance: Track Nutri-Score distribution across product lines
  • Academic research: Study food composition, additives, and labeling trends
  • Price comparison tools: Enrich product databases with nutrition and ingredient data
  • Allergen monitoring: Track allergen presence across food categories

How to scrape food product data from Open Food Facts

  1. Go to Open Food Facts Scraper on Apify Store.
  2. Enter a search query (e.g., "chocolate", "oat milk", "pasta").
  3. Optionally filter by category, country, or Nutri-Score grade.
  4. Set the maximum number of results (1–500).
  5. Click Start and wait for the run to finish.
  6. Download your data as JSON, CSV, or Excel.

Input parameters

ParameterTypeDescription
searchQueryStringSearch term for food products (required). Example: "chocolate", "oat milk", "pasta"
categoriesStringFilter by category tag. Example: "breakfast-cereals", "beverages", "snacks"
countryStringFilter by country tag. Example: "united-states", "france", "germany"
nutriScoreStringFilter by Nutri-Score grade: "a", "b", "c", "d", or "e"
maxResultsIntegerMaximum products to extract (1–500, default: 50)

Output example

Each product in the dataset contains these fields:

{
"barcode": "3175681851856",
"productName": "Oat Drink Barista Edition",
"brands": "Oatly",
"categories": "Plant-based milk substitutes, Oat milks",
"labels": "No gluten, Vegan, Organic",
"quantity": "1 L",
"servingSize": "250 ml",
"nutriScore": "a",
"novaGroup": 4,
"ecoScore": "b",
"ingredients": "Water, oats (10%), rapeseed oil, calcium carbonate...",
"allergens": "en:oats",
"traces": "",
"calories": 48,
"fat": 3,
"saturatedFat": 0.3,
"carbohydrates": 3.9,
"sugars": 3.2,
"fiber": 0.8,
"proteins": 1,
"salt": 0.1,
"sodium": 0.04,
"countries": "France, Germany, United Kingdom",
"origins": "Sweden",
"imageUrl": "https://images.openfoodfacts.org/images/products/317/568/185/1856/front_en.jpg",
"productUrl": "https://world.openfoodfacts.org/product/3175681851856",
"scrapedAt": "2026-03-03T12:00:00.000Z"
}

How much does it cost to scrape Open Food Facts?

Open Food Facts Scraper uses a pay-per-event pricing model:

EventPrice
Run started$0.001
Per product extracted$0.001

Cost examples:

  • 50 products: $0.001 + (50 × $0.001) = $0.051
  • 200 products: $0.001 + (200 × $0.001) = $0.201
  • 500 products: $0.001 + (500 × $0.001) = $0.501

API usage

Node.js

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('YOUR_USERNAME/openfoodfacts-scraper').call({
searchQuery: 'oat milk',
nutriScore: 'a',
maxResults: 50,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach(product => {
console.log(`${product.productName} - ${product.brands} - Score: ${product.nutriScore}`);
});

Python

from apify_client import ApifyClient
client = ApifyClient('YOUR_API_TOKEN')
run = client.actor('YOUR_USERNAME/openfoodfacts-scraper').call(run_input={
'searchQuery': 'oat milk',
'nutriScore': 'a',
'maxResults': 50,
})
dataset = client.dataset(run['defaultDatasetId']).list_items().items
for product in dataset:
print(f"{product['productName']} - {product['brands']} - Score: {product['nutriScore']}")

cURL

curl "https://api.apify.com/v2/acts/automation-lab~openfoodfacts-scraper/runs" \
-X POST \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"searchQuery": "oat milk", "nutriScore": "a", "maxResults": 50}'

Integrations

Connect Open Food Facts Scraper with other tools using Apify integrations:

  • Google Sheets — Export food product data to spreadsheets for nutrition analysis
  • Slack / Email — Get notified when new products match your criteria
  • Webhooks — Trigger downstream processing when extraction completes
  • Zapier / Make — Connect to 5,000+ apps for automated workflows
  • Amazon S3 / Google Cloud — Store large datasets in cloud storage

Tips and best practices

  • Use specific search terms — "organic dark chocolate 70%" returns more relevant results than just "chocolate"
  • Filter by country — reduces noise and returns locally available products; use lowercase hyphenated tags like "united-states"
  • Category tags — use Open Food Facts category taxonomy (e.g., "breakfast-cereals", "plant-based-milk-substitutes")
  • Nutri-Score filter — use "a" for healthiest options; not all products have scores assigned
  • Data completeness varies — community-contributed data means some products may have missing fields
  • Pagination — the actor handles pagination automatically up to 500 products per run

Data source

All data comes from Open Food Facts, a free, open, collaborative database of food products from around the world. The data is contributed by volunteers and is available under the Open Database License (ODbL).

Use with AI agents via MCP

Open Food Facts Scraper is available as a tool for AI assistants via the Model Context Protocol (MCP).

Setup for Claude Code

$claude mcp add --transport http apify "https://mcp.apify.com"

Setup for Claude Desktop, Cursor, or VS Code

{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com"
}
}
}

Example prompts

  • "Search Open Food Facts for organic chocolate bars"
  • "Get nutrition data for these food products"

Learn more in the Apify MCP documentation.

Legality

Scraping publicly available data is generally legal according to the US Court of Appeals ruling (HiQ Labs v. LinkedIn). This actor only accesses publicly available information and does not require authentication. Always review and comply with the target website's Terms of Service before scraping. For personal data, ensure compliance with GDPR, CCPA, and other applicable privacy regulations.

FAQ

Q: How fresh is the data? A: Data is fetched live from Open Food Facts at the time of each run — always up to date.

Q: Why are some fields empty? A: Open Food Facts is community-contributed. Not all products have complete nutrition data, ingredients, or Nutri-Score grades.

Q: What barcode formats are supported? A: Products are identified by EAN-13, UPC-A, and other international barcode standards.

Q: Can I search by barcode? A: The search API matches barcodes as part of the search query. Enter the barcode number in the search field.

Q: What is the Nutri-Score? A: Nutri-Score is a European nutrition label system rating food from A (healthiest) to E (least healthy) based on nutritional composition per 100g.

Q: Nutrition values are missing or zero for some products — is this a bug? A: No. Open Food Facts is community-contributed, so data completeness varies. Some products have full nutrition panels while others only have basic info. Check multiple results if you need complete nutrition data.

Q: My search returns products from other countries — how do I filter? A: Use the country parameter with a lowercase hyphenated tag (e.g., "united-states", "france", "germany"). Without a country filter, results come from the global database.

Other data scrapers on Apify