# Open Food Facts Brazil Scraper (`nimbryxo-studio/open-food-facts-brazil-scraper`) Actor

Scrape Brazilian food products from Open Food Facts Brazil (br.openfoodfacts.org) - search by name, category, or brand. Returns product names, ingredients, nutrition facts, Nutri-Score, barcodes, packaging, and more. No API key required.

- **URL**: https://apify.com/nimbryxo-studio/open-food-facts-brazil-scraper.md
- **Developed by:** [Nimbryxo-studio](https://apify.com/nimbryxo-studio) (community)
- **Categories:** E-commerce, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Open Food Facts Brazil Scraper

Pull packaged-food product data for the Brazilian market from [Open Food Facts Brazil](https://br.openfoodfacts.org), the community-maintained, open database covering products sold in Brazil. Search by keyword, browse a category or brand, or look up exact products by EAN barcode — every record carries Nutri-Score, NOVA processing group, Eco-Score, and per-100g nutrition facts where the community has entered them.

### What this actor does

- **Four modes:** `search` (keyword), `byBarcode` (exact EAN-13/EAN-8 lookup), `byCategory`, `byBrand`
- **Three Open Food Facts scores per product:** Nutri-Score (A–E nutrition grade), NOVA group (1–4 processing level), and Eco-Score (A–E environmental grade)
- **Full nutrition panel** — calories, fat, saturated fat, carbohydrates, sugars, proteins, salt, and fiber per 100g
- **Nutri-Score floor filter** — drop products below a chosen grade in any mode
- **Empty fields are omitted** — a product only carries the facts contributors actually entered for it

### Output per product

- `barcode` — EAN-13/EAN-8
- `productName` — usually in Portuguese
- `brand` — primary brand; `brands[]` lists every brand on the label when there's more than one
- `categories[]` — up to 10 category tags
- `nutritionGrade` — Nutri-Score, `a` (best) to `e` (worst)
- `novaGroup` — 1 (minimally processed) to 4 (ultra-processed)
- `ecoscoreGrade` — Eco-Score, `a` to `e`
- `calories`, `fat`, `saturatedFat`, `carbohydrates`, `sugars`, `proteins`, `salt`, `fiber` — all per 100g
- `ingredientsText` — full ingredients list, as entered
- `allergens[]`, `labels[]` — up to 10 labels (organic, fair-trade, etc.)
- `quantity`, `packaging`
- `countries[]` — up to 5 countries where the product is sold
- `imageUrl` — front-of-pack photo
- `productUrl` — the product's Open Food Facts page
- `sourceUrl` — the Open Food Facts endpoint the actor queried for this run
- `recordType: "food_product"`, `scrapedAt`

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `search` | `search` / `byBarcode` / `byCategory` / `byBrand` |
| `searchQuery` | string | `arroz` | Keyword to search (mode=search) |
| `barcodes` | array | `[]` | EAN-13/EAN-8 codes to look up (mode=byBarcode) |
| `categoryTag` | string | – | Category tag, e.g. `cereais`, `biscoitos` (mode=byCategory) |
| `brandName` | string | – | Brand name, e.g. `Camil`, `Nestlé` (mode=byBrand) |
| `nutritionGradeFilter` | string | – (none) | Keep only products at this Nutri-Score grade or better |
| `maxItems` | int | `50` | Hard cap on emitted records (1–500) |

#### Example: search for a staple food

```json
{
  "mode": "search",
  "searchQuery": "feijão",
  "maxItems": 40
}
```

#### Example: a brand's catalog, A/B grade only

```json
{
  "mode": "byBrand",
  "brandName": "Camil",
  "nutritionGradeFilter": "b",
  "maxItems": 100
}
```

#### Example: look up specific barcodes

```json
{
  "mode": "byBarcode",
  "barcodes": ["7891000055120", "7896004001254"]
}
```

### Use cases

- **Nutrition research** — compare Nutri-Score and NOVA processing level across a food category
- **Private-label benchmarking** — pull every product from a competing Brazilian brand
- **Barcode enrichment** — attach nutrition facts to an internal product catalog by EAN
- **Regulatory/labeling audits** — check allergen and label declarations across a brand's range
- **Sustainability screening** — filter or sort by Eco-Score for a category

### FAQ

**Do I need an account or API key?**
No. Open Food Facts is a free, community-maintained database with no registration required.

**Why is a field missing on some products?**
Open Food Facts is crowd-sourced — a product only has the fields a contributor filled in. Nothing is guessed or filled with a placeholder; the field is simply left out.

**What does the NOVA group mean?**
It's a 1–4 food-processing classification: 1 = unprocessed/minimally processed, 2 = processed culinary ingredients, 3 = processed foods, 4 = ultra-processed foods.

**What language are product names and ingredients in?**
Mostly Portuguese, since this dataset targets products sold in Brazil, though some entries carry English or multilingual text if that's how a contributor entered them.

**Can I combine `nutritionGradeFilter` with keyword search?**
Yes — it applies on top of `search`, `byCategory`, and `byBrand` alike, keeping only products at or above the chosen grade.

**How current is the data?**
Live at request time. Open Food Facts is edited continuously by its contributor community, so a product's score or nutrition facts can change between runs.

**Is this affiliated with Open Food Facts?**
No. This actor reads Open Food Facts' own free public data; it is not affiliated with or endorsed by the Open Food Facts association.

# Actor input Schema

## `mode` (type: `string`):

What to scrape.

## `searchQuery` (type: `string`):

Free-text search term (mode=search). Examples: 'arroz', 'feijão', 'biscoito', 'iogurte'.

## `barcodes` (type: `array`):

List of EAN-13 or EAN-8 barcodes to look up.

## `categoryTag` (type: `string`):

Open Food Facts category tag, e.g. 'cereais', 'biscoitos', 'iogurtes', 'sucos', 'massas'. Use lowercase with hyphens.

## `brandName` (type: `string`):

Brand to filter by, e.g. 'Nestlé', 'Sadia', 'Vigor', 'Camil'.

## `nutritionGradeFilter` (type: `string`):

Only return products with this Nutri-Score grade or better. 'a' = best, 'e' = worst.

## `maxItems` (type: `integer`):

Maximum number of products to return.

## Actor input object example

```json
{
  "mode": "search",
  "searchQuery": "arroz",
  "barcodes": [],
  "nutritionGradeFilter": "",
  "maxItems": 50
}
```

# Actor output Schema

## `products` (type: `string`):

Dataset containing all scraped food product records.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "search",
    "searchQuery": "arroz",
    "barcodes": [],
    "nutritionGradeFilter": "",
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("nimbryxo-studio/open-food-facts-brazil-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "search",
    "searchQuery": "arroz",
    "barcodes": [],
    "nutritionGradeFilter": "",
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("nimbryxo-studio/open-food-facts-brazil-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "search",
  "searchQuery": "arroz",
  "barcodes": [],
  "nutritionGradeFilter": "",
  "maxItems": 50
}' |
apify call nimbryxo-studio/open-food-facts-brazil-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nimbryxo-studio/open-food-facts-brazil-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Q2Cry45LvEff1ekVp/builds/3GZlxh9uBqMeouWtY/openapi.json
