# Open Food Facts API

> Returns food products by barcode, search, category, label, brand or Nutri-Score, with ingredients and nutrition data.

Category: Commerce & Marketplaces. Region: global. 9 endpoints at `https://api.hoshime.com/v1/openfoodfacts/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/openfoodfacts
## GET /v1/openfoodfacts/product

One food product by its barcode: brands, ingredients, Nutri-Score and nutrition per 100 g.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `barcode` | string | yes | EAN, UPC or GTIN barcode of 8 to 14 digits, such as 3017620422003. (e.g. 3017620422003) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `barcode` (string), `brands` (string[]), `categories` (string[]), `countries` (string[]), `imageUrl` (string), `ingredients` (string), `name` (string), `novaGroup` (integer (int64)), `nutriScore` (string), `nutrition` (Nutrition), `nutrition.carbohydrates` (number (double)), `nutrition.energyKcal` (number (double)), `nutrition.fat` (number (double)), `nutrition.fiber` (number (double)), `nutrition.proteins` (number (double)), `nutrition.salt` (number (double)), `nutrition.saturatedFat` (number (double)), `nutrition.sugars` (number (double)), `quantity` (string)

```bash
curl "https://api.hoshime.com/v1/openfoodfacts/product?barcode=3017620422003" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/openfoodfacts/search

Food products matching words, one page at a time, with barcode, brand and Nutri-Score.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Words to search for, such as nutella. (e.g. nutella) |
| `limit` | integer | no | Items per page, 1 to 50. (default 10) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `barcode` (string), `brands` (string[]), `imageUrl` (string), `name` (string), `nutriScore` (string), `quantity` (string)

```bash
curl "https://api.hoshime.com/v1/openfoodfacts/search?query=nutella" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/openfoodfacts/byCategory

Products of one category, such as breakfasts or chocolate-spreads, paged.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `category` | string | yes | Category name as the database writes it, such as breakfasts. (e.g. breakfasts) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `limit` | integer | no | Items per page, 1 to 50. (default 10; e.g. 2) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `barcode` (string), `brands` (string[]), `imageUrl` (string), `name` (string), `nutriScore` (string), `quantity` (string)

```bash
curl "https://api.hoshime.com/v1/openfoodfacts/byCategory?category=breakfasts&limit=2" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/openfoodfacts/byLabel

Products carrying one label, such as organic or vegan, paged.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `label` | string | yes | Label name, such as organic or vegan. (e.g. organic) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `limit` | integer | no | Items per page, 1 to 50. (default 10; e.g. 2) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `barcode` (string), `brands` (string[]), `imageUrl` (string), `name` (string), `nutriScore` (string), `quantity` (string)

```bash
curl "https://api.hoshime.com/v1/openfoodfacts/byLabel?label=organic&limit=2" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/openfoodfacts/byBrand

Products of one brand, such as nutella, paged.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `brand` | string | yes | Brand name, such as nutella. (e.g. nutella) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `limit` | integer | no | Items per page, 1 to 50. (default 10; e.g. 2) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `barcode` (string), `brands` (string[]), `imageUrl` (string), `name` (string), `nutriScore` (string), `quantity` (string)

```bash
curl "https://api.hoshime.com/v1/openfoodfacts/byBrand?brand=nutella&limit=2" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/openfoodfacts/byStore

Products sold in one store or chain, such as carrefour or lidl, paged.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `store` | string | yes | Store or chain name, such as carrefour. (e.g. carrefour) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `limit` | integer | no | Items per page, 1 to 50. (default 10; e.g. 2) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `barcode` (string), `brands` (string[]), `imageUrl` (string), `name` (string), `nutriScore` (string), `quantity` (string)

```bash
curl "https://api.hoshime.com/v1/openfoodfacts/byStore?store=carrefour&limit=2" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/openfoodfacts/byCountry

Food products sold in one country, such as france or indonesia, paged.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `country` | string | yes | Country name, such as france. (e.g. france) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `limit` | integer | no | Items per page, 1 to 50. (default 10; e.g. 2) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `barcode` (string), `brands` (string[]), `imageUrl` (string), `name` (string), `nutriScore` (string), `quantity` (string)

```bash
curl "https://api.hoshime.com/v1/openfoodfacts/byCountry?country=france&limit=2" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/openfoodfacts/byNutriScore

Products with one Nutri-Score grade, from A (best) to E, paged.

Scope: `social:read` · Units: 1 · Cached: 60 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `grade` | string | yes | Nutri-Score grade: a, b, c, d or e. (one of a, b, c, d, e; e.g. a) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `limit` | integer | no | Items per page, 1 to 50. (default 10; e.g. 2) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `barcode` (string), `brands` (string[]), `imageUrl` (string), `name` (string), `nutriScore` (string), `quantity` (string)

```bash
curl "https://api.hoshime.com/v1/openfoodfacts/byNutriScore?grade=a&limit=2" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/openfoodfacts/taxonomy

The entries of one Open Food Facts taxonomy, such as labels or allergens, with their English names, paged.

Scope: `social:read` · Units: 1 · Cached: 1440 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Taxonomy: labels, allergens, additives, countries or packaging. (one of labels, allergens, additives, countries, packaging; e.g. allergens) |
| `limit` | integer | no | Items per page, 1 to 500. (default 50; e.g. 5) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `id` (string), `name` (string)

```bash
curl "https://api.hoshime.com/v1/openfoodfacts/taxonomy?name=allergens&limit=5" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
