# Open Beauty Facts API

> Returns cosmetic products by barcode, search, category, label or brand, with ingredients, and taxonomy entries.

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

One cosmetic product by its barcode: brands, labels, ingredients and country of sale.

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 6956088582881. (e.g. 6956088582881) |
| `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), `labels` (string[]), `name` (string), `quantity` (string)

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

## GET /v1/openbeautyfacts/search

Cosmetic products matching words, one page at a time, with barcode and brand.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Words to search for, such as shampoo. (e.g. nivea) |
| `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), `quantity` (string)

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

## GET /v1/openbeautyfacts/byCategory

Products of one category, such as shampoos or foot-creams, 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 shampoos. (e.g. shampoos) |
| `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) |
| `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), `quantity` (string)

```bash
curl "https://api.hoshime.com/v1/openbeautyfacts/byCategory?category=shampoos" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/openbeautyfacts/byLabel

Products carrying one label, such as vegan or cruelty-free, paged.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `label` | string | yes | Label name, such as vegan. (e.g. vegan) |
| `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) |
| `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), `quantity` (string)

```bash
curl "https://api.hoshime.com/v1/openbeautyfacts/byLabel?label=vegan" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/openbeautyfacts/byBrand

Products of one brand, such as l-oreal, paged.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `brand` | string | yes | Brand name, such as l-oreal. (e.g. l-oreal) |
| `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) |
| `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), `quantity` (string)

```bash
curl "https://api.hoshime.com/v1/openbeautyfacts/byBrand?brand=l-oreal" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/openbeautyfacts/byIngredient

Products that list one ingredient, such as niacinamide or glycerin, paged.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `ingredient` | string | yes | Ingredient name, such as niacinamide. (e.g. niacinamide) |
| `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) |
| `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), `quantity` (string)

```bash
curl "https://api.hoshime.com/v1/openbeautyfacts/byIngredient?ingredient=niacinamide" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/openbeautyfacts/byAllergen

Products that contain one allergen, such as milk or nuts, paged.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `allergen` | string | yes | Allergen name, such as milk. (e.g. milk) |
| `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) |
| `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), `quantity` (string)

```bash
curl "https://api.hoshime.com/v1/openbeautyfacts/byAllergen?allergen=milk" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/openbeautyfacts/byCountry

Products sold in one country, such as france or germany, paged.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `country` | string | yes | Country name in English, 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) |
| `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), `quantity` (string)

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

## GET /v1/openbeautyfacts/taxonomy

The entries of one Open Beauty 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, categories or countries. (one of labels, allergens, categories, countries; e.g. labels) |
| `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/openbeautyfacts/taxonomy?name=labels&limit=5" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
