> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrouter.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Open Food Facts

> Keyless open database of packaged food products: ingredients, nutrition facts, Nutri-Score, NOVA, allergens and labels by barcode, plus filtered product search.

![](https://mintcdn.com/webrouter/JBFYvcRI1PVnd4YX/logo/data-apis/openfoodfacts.webp?fit=max\&auto=format\&n=JBFYvcRI1PVnd4YX\&q=85\&s=589529d12114e3384f99cf2d83582da7)

[Web Catalog · Health](https://docs.webrouter.net/data-apis.md?category=health)

No key needed

Endpoints

4

Auth

None

[Vendor docs](https://openfoodfacts.github.io/openfoodfacts-server/api/) · Serves `openfoodfacts.org`

## Setup

| Variable | | What it is |
| - | - | - |
| `OPENFOODFACTS_USER_AGENT` | optional | the custom User-Agent Open Food Facts asks every client to send, as AppName/Version (ContactEmail), e.g. 'MyApp/1.0 ([me@example.com](mailto:me@example.com))'; the default names WebRouter, so set your own with contact details for heavy use. Default `WebRouter (+https://github.com/Nimbleway/webrouter)`. |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* Reads need no key, only a custom User-Agent (set OPENFOODFACTS\_USER\_AGENT).
* Rate limits per IP: 15 product reads and 10 searches per minute; going over can get the IP banned. For bulk work use the CSV/JSONL data exports instead.
* Search v2 has no full-text query: it filters by tags and nutrient values only.
* Data is crowd-sourced; fields can be missing or wrong. Writes (adding or editing products) need an account and are not in this entry.

## Endpoints

GET

Get a product by barcode

Name, brand, ingredients, nutriments per 100 g and per serving, Nutri-Score, NOVA, allergens and images for one barcode.

[Open](#openfoodfacts-product-get)

GET

Search products by filters

Products matching tag and nutrient filters, paged, with total count.

[Open](#openfoodfacts-products-search)

GET

Suggest taxonomy terms

Autocomplete values of one tag type (categories, labels, brands, allergens, ...) containing a term.

[Open](#openfoodfacts-suggest)

GET

Get taxonomy entries

Entries of a taxonomy (names, synonyms, parents/children) for given tags.

[Open](#openfoodfacts-taxonomy-get)

### Get a product by barcode

GET

`/api/v2/product/{code}`

`openfoodfacts.product.get`

Name, brand, ingredients, nutriments per 100 g and per serving, Nutri-Score, NOVA, allergens and images for one barcode.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`code` required</td><td>string</td><td>path</td><td>The product barcode (EAN/UPC). Example `3017620422003`</td></tr>

    <tr>
      <td>
        `fields`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Comma-separated product fields to return, e.g. product\_name,brands,nutriments,nutrition\_grades,ingredients\_text,allergens\_tags. Use it: full products are large.
      </td>
    </tr>

    <tr>
      <td>
        `lc`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Language code for localized fields.
      </td>
    </tr>

    <tr>
      <td>
        `cc`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Country code for country-specific fields.
      </td>
    </tr>

    <tr>
      <td>
        `blame`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        1 to add who last modified each field.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://openfoodfacts.github.io/openfoodfacts-server/api/ref-v2/) · Same job: [Best Buy](https://docs.webrouter.net/data-apis/bestbuy.md#bestbuy-products-get), [Etsy Open API v3](https://docs.webrouter.net/data-apis/etsy.md#etsy-listings-get), [Keepa](https://docs.webrouter.net/data-apis/keepa.md#keepa-product), [Outscraper](https://docs.webrouter.net/data-apis/outscraper.md#outscraper-amazon-products), [Rainforest API](https://docs.webrouter.net/data-apis/rainforest.md#rainforest-product)

```python Python theme={null}
router.call_data_api("openfoodfacts.product.get", {'code': '3017620422003'})
```

```text MCP theme={null}
call_data_api(endpoint="openfoodfacts.product.get", params={"code": "3017620422003"})
```

> [!NOTE]
>
> * The answer carries status 1 when the product was found.

### Search products by filters

GET

`/api/v2/search`

`openfoodfacts.products.search`

Products matching tag and nutrient filters, paged, with total count.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `categories_tags`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Category filter, e.g. en:breakfast-cereals. Comma = AND, pipe = OR, a '-' prefix excludes; use taxonomy ids like en:organic.
      </td>
    </tr>

    <tr>
      <td>
        `brands_tags`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Brand filter. Comma = AND, pipe = OR, a '-' prefix excludes; use taxonomy ids like en:organic.
      </td>
    </tr>

    <tr>
      <td>
        `labels_tags`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Label filter, e.g. en:organic. Comma = AND, pipe = OR, a '-' prefix excludes; use taxonomy ids like en:organic.
      </td>
    </tr>

    <tr>
      <td>
        `countries_tags`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Country of sale filter, e.g. en:france. Comma = AND, pipe = OR, a '-' prefix excludes; use taxonomy ids like en:organic.
      </td>
    </tr>

    <tr>
      <td>
        `nutrition_grades_tags`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Nutri-Score grade filter, a to e. Comma = AND, pipe = OR, a '-' prefix excludes; use taxonomy ids like en:organic.
      </td>
    </tr>

    <tr>
      <td>
        `allergens_tags`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Allergen filter, e.g. en:gluten. Comma = AND, pipe = OR, a '-' prefix excludes; use taxonomy ids like en:organic.
      </td>
    </tr>

    <tr>
      <td>
        `stores_tags`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Store filter. Comma = AND, pipe = OR, a '-' prefix excludes; use taxonomy ids like en:organic.
      </td>
    </tr>

    <tr>
      <td>
        `code`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Comma-separated barcodes, to fetch several products in one call.
      </td>
    </tr>

    <tr>
      <td>
        `fields`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Comma-separated product fields to return, e.g. product\_name,brands,nutriments,nutrition\_grades,ingredients\_text,allergens\_tags. Use it: full products are large.
      </td>
    </tr>

    <tr><td>`sort_by`</td><td>string</td><td>query</td><td>Default is popularity (food) or last modification. One of `product_name`, `last_modified_t`, `scans_n`, `unique_scans_n`, `created_t`, `completeness`, `popularity_key`, `nutriscore_score`, `nova_score`, `nothing`, `ecoscore_score`</td></tr>

    <tr>
      <td>
        `page`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        Page number.
      </td>
    </tr>

    <tr><td>`page_size`</td><td>integer</td><td>query</td><td>Products per page. Example `24`</td></tr>
  </tbody>
</table>

[Vendor docs](https://openfoodfacts.github.io/openfoodfacts-server/api/ref-v2/) · Same job: [Best Buy](https://docs.webrouter.net/data-apis/bestbuy.md#bestbuy-products-search), [Etsy Open API v3](https://docs.webrouter.net/data-apis/etsy.md#etsy-listings-search), [Keepa](https://docs.webrouter.net/data-apis/keepa.md#keepa-search-products), [Rainforest API](https://docs.webrouter.net/data-apis/rainforest.md#rainforest-search)

```python Python theme={null}
router.call_data_api("openfoodfacts.products.search", {'page_size': 24})
```

```text MCP theme={null}
call_data_api(endpoint="openfoodfacts.products.search", params={"page_size": 24})
```

> [!NOTE]
>
> * Nutrient filters put the condition in the parameter name, e.g. sugars\_100g\<10 or salt\_serving>1; this entry cannot take them, so send them as a raw call to /api/v2/search.
> * page\_count in the answer is the number of products on this page, not the number of pages; total pages = floor((count - 1) / page\_size) + 1.
> * Language-specific tag filters put the language in the name, e.g. categories\_tags\_en=orange-juices; send them as a raw call to the same path.

### Suggest taxonomy terms

GET

`/cgi/suggest.pl`

`openfoodfacts.suggest`

Autocomplete values of one tag type (categories, labels, brands, allergens, ...) containing a term.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`tagtype` required</td><td>string</td><td>query</td><td>Taxonomy id: categories, labels, ingredients, brands, countries, additives, allergens, packaging\_shapes, ... Example `categories`</td></tr>
    <tr><td>`term`</td><td>string</td><td>query</td><td>Text the suggestions contain. Example `choco`</td></tr>
  </tbody>
</table>

[Vendor docs](https://openfoodfacts.github.io/openfoodfacts-server/api/ref-v2/) · Same job: [Clay](https://docs.webrouter.net/data-apis/clay.md#clay-search-reference), [CompanyEnrich](https://docs.webrouter.net/data-apis/companyenrich.md#companyenrich-keywords-autocomplete), [Forager](https://docs.webrouter.net/data-apis/forager.md#forager-reference-keywords), [GetProspect](https://docs.webrouter.net/data-apis/getprospect.md#getprospect-reference-suggest), [SalesIntel](https://docs.webrouter.net/data-apis/salesintel.md#salesintel-reference-tech-categories), [ZoomInfo](https://docs.webrouter.net/data-apis/zoominfo.md#zoominfo-lookup-search-fields)

```python Python theme={null}
router.call_data_api("openfoodfacts.suggest", {'tagtype': 'categories', 'term': 'choco'})
```

```text MCP theme={null}
call_data_api(endpoint="openfoodfacts.suggest", params={"tagtype": "categories", "term": "choco"})
```

### Get taxonomy entries

GET

`/api/v2/taxonomy`

`openfoodfacts.taxonomy.get`

Entries of a taxonomy (names, synonyms, parents/children) for given tags.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`tagtype` required</td><td>string</td><td>query</td><td>Taxonomy id, e.g. categories, labels, additives. Example `categories`</td></tr>
    <tr><td>`tags` required</td><td>string</td><td>query</td><td>Comma-separated tag ids. Example `en:chocolates`</td></tr>

    <tr>
      <td>
        `fields`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Entry fields to return.
      </td>
    </tr>

    <tr>
      <td>
        `lc`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Language codes for names.
      </td>
    </tr>

    <tr>
      <td>
        `cc`
      </td>

      <td>
        string
      </td>

      <td>
        query
      </td>

      <td>
        Country code.
      </td>
    </tr>

    <tr>
      <td>
        `include_children`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        1 to include child entries.
      </td>
    </tr>

    <tr>
      <td>
        `include_parents`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        1 to include parent entries.
      </td>
    </tr>

    <tr>
      <td>
        `include_root_entries`
      </td>

      <td>
        integer
      </td>

      <td>
        query
      </td>

      <td>
        1 to include root entries.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://openfoodfacts.github.io/openfoodfacts-server/api/ref-cheatsheet/)

```python Python theme={null}
router.call_data_api("openfoodfacts.taxonomy.get", {'tagtype': 'categories', 'tags': 'en:chocolates'})
```

```text MCP theme={null}
call_data_api(endpoint="openfoodfacts.taxonomy.get", params={"tagtype": "categories", "tags": "en:chocolates"})
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.