# Open Food Facts API

> Food products by barcode: ingredients, nutrition facts, Nutri-Score, allergens, and search

- Vendor: `openfoodfactsapi` · version 1.0 · category Food · tags open food facts api, barcode food api, nutrition facts api, nutri-score api, food ingredients api, allergens api, upc food lookup, grocery product data api
- Datasource: custom HTTP routes
- Marketplace page: https://apiclay.com/api/openfoodfactsapi
- This document: https://apiclay.com/docs/openfoodfactsapi.md
- OpenAPI 3.1: https://apiclay.com/api/openfoodfactsapi/openapi.json
- MCP: connect https://api.apiclay.com/v1/mcp (see https://apiclay.com/llms.txt), then `apiclay_describe_api` with vendor `openfoodfactsapi`
- Updated: 2026-11-18

## About

## Open Food Facts API

Look up packaged food by barcode (UPC/EAN) and get its name, brand, ingredients, allergens, nutrition per 100 g, Nutri-Score and NOVA group, or search the 3M+ product database by keyword.

Data comes from **openfoodfacts.org** (https://world.openfoodfacts.org). Every route below calls the source's own public endpoint directly and returns the upstream response unchanged.

### Routes

#### GET `/product` - Product by barcode
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| barcode | path | string | yes | UPC/EAN digits, e.g. `3017624010701`. |
| fields | query | string | no | Comma-separated fields to keep the response small, e.g. `product_name,brands,nutriscore_grade,nutriments`. |
| lc | query | string | no | Language code for names, e.g. `en`. |

Returns: `status`, `product.product_name`, `product.brands`, `product.ingredients_text`, `product.allergens_tags`, `product.nutriments` (per 100 g / serving), `product.nutriscore_grade`, `product.nova_group`, `product.image_url`.

#### GET `/search` - Keyword search
| Param | In | Type | Required | Description |
|---|---|---|---|---|
| q | query | string | yes | Search text, e.g. `oat milk`. Supports filters like `brands:danone`. |
| page | query | number | no | Page number, from 1. |
| page_size | query | number | no | Results per page. |
| fields | query | string | no | Comma-separated fields to return. |
| sort_by | query | string | no | e.g. `-unique_scans_n` for most scanned. |
| langs | query | string | no | Comma-separated languages, e.g. `en`. |

Returns: `hits[]` (products with the requested fields), `count`, `page`, `page_count`.

### Not yet available

| Endpoint | Why |
|---|---|
| Category/brand filter search (v2) | upstream overloaded (503) when checked |

### License

Database under the Open Database License (ODbL); product images under CC BY-SA. Credit "Open Food Facts" when you display the data.

### Caveats

- Open Food Facts limits search to about 10 requests per minute and product reads to about 100 per minute.
- Data is crowd-sourced; check important values (allergens) against the package.
- Upstream responses can change over time. Verify fields before relying on them.
- Not affiliated with or endorsed by openfoodfacts.org.

## Pricing

- Pay as you go: 0.0012 credits/request
- Trial: 1 free requests per buyer
- Billing order: trial requests -> subscribed plan requests -> pay as you go. 1 credit's USD value is shown on the marketplace page.

## HTTP routes

Only the public, buyer-facing parts of each route are listed; vendor-side credentials stay on the gateway.

### GET /product — Product by barcode
- Gateway: `GET https://api.apiclay.com/v1/api/openfoodfactsapi/product`
- Public query params: `fields` (string), `lc` (string), `barcode` (string, required)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

### GET /search — Product search
- Gateway: `GET https://api.apiclay.com/v1/api/openfoodfactsapi/search`
- Public query params: `q` (string, required), `page` (string), `page_size` (string), `fields` (string), `sort_by` (string), `langs` (string)
- Upstream proxy: ApiClay proxy paid by the vendor (data cap 2 MB per call). Fetched through an ApiClay proxy paid by the vendor; a response larger than the route's data cap fails with 502 and is refunded in full.

## Call example

```bash
curl -X GET "https://api.apiclay.com/v1/api/openfoodfactsapi/product?barcode=<barcode>" \
  -H "token: <YOUR_APICLAY_TOKEN>"
```

Index of every published API: https://apiclay.com/llms.txt
