-
-
Notifications
You must be signed in to change notification settings - Fork 499
docs: Document unwanted ingredients attribute feature #12586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: teolemon <[email protected]>
Co-authored-by: teolemon <[email protected]>
…edictions section Co-authored-by: teolemon <[email protected]>
|
|
|
Here's the associated issue and comment by @monsieurtanuki |
| - Vegetarian | ||
| - Palm oil | ||
| - Unwanted ingredients (unwanted ingredients are specified by the user) | ||
| - Unwanted/Banned ingredients (user-specified list of ingredients to avoid; requires API v3.4+) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name "Unwanted ingredients" is better, "banned" can be understood as banned in one country.
| - as a cookie with the name `attribute_unwanted_ingredients_tags`: this is used in particular on the website so that we do not have URLs with an extra query parameter. | ||
| - as a query parameter in the URL (e.g. ?attribute_unwanted_ingredients_tags=en:garlic,en:kiwi) | ||
|
|
||
| ##### Getting ingredient suggestions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the things below are interesting, but this doc is about explaining product attributes (in general) succinctly. Explain docs should stay on topic, and all the detailed examples, guidance etc. can go into a separate tutorial "How to implement the unwanted ingredients attribute".
| description: |- | ||
| When knowledge_panels are requested, you can specify which panels to exclude from the response. All the others will be included. | ||
| If a panel is both excluded and included (with the knowledge_panels_excluded parameter), it will be excluded. | ||
| - schema: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go into a separate request body schema, so that's it's not duplicated for API v2 and API v3.
| - Vegetarian | ||
| - Palm oil | ||
| - Unwanted ingredients (unwanted ingredients are specified by the user) | ||
| - Unwanted/Banned ingredients (user-specified list of ingredients to avoid; requires API v3.4+) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Unwanted/Banned ingredients (user-specified list of ingredients to avoid; requires API v3.4+) | |
| - Unwanted ingredients (user-specified list of ingredients to avoid; requires API v3.4+) |
| Apps can request Product Attributes through API queries (`/api/v3/product` or `/api/v2/search`) by including `attribute_groups` or `attribute_groups_[language code]` (or `attribute_groups_data` to get only the machine-readable data) in the `fields` parameter. | ||
|
|
||
| #### Product Attributes with Parameters (e.g. Unwanted ingredients) | ||
| #### Product Attributes with Parameters (e.g. Unwanted/Banned ingredients) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #### Product Attributes with Parameters (e.g. Unwanted/Banned ingredients) | |
| #### Product Attributes with Parameters (e.g. Unwanted ingredients) |
| #### Product Attributes with Parameters (e.g. Unwanted/Banned ingredients) | ||
|
|
||
| In September 2025, we introduced support for attributes that can be configured with parameters. The first is the **Unwanted ingredients** attribute that takes a list of canonical ingredients as a parameter. | ||
| In September 2025, we introduced support for attributes that can be configured with parameters. The first is the **Unwanted ingredients** attribute (also referred to as "banned ingredients" in cosmetics contexts) that takes a list of canonical ingredients as a parameter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| In September 2025, we introduced support for attributes that can be configured with parameters. The first is the **Unwanted ingredients** attribute (also referred to as "banned ingredients" in cosmetics contexts) that takes a list of canonical ingredients as a parameter. | |
| In September 2025, we introduced support for attributes that can be configured with parameters. The first is the **Unwanted ingredients** attribute that takes a list of canonical ingredients as a parameter. |
|
|
||
| This feature is available on both: | ||
| - **Open Food Facts** (food products): for filtering out unwanted ingredients based on dietary preferences, allergies, or personal choices | ||
| - **Open Beauty Facts** (cosmetic products): for identifying banned or unwanted ingredients in cosmetics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - **Open Beauty Facts** (cosmetic products): for identifying banned or unwanted ingredients in cosmetics | |
| - **Open Beauty Facts** (cosmetic products): for identifying unwanted ingredients in cosmetics |
|
|
||
| ##### Getting ingredient suggestions | ||
|
|
||
| To help users identify ingredients to flag as unwanted/banned, you can use the **Robotoff API** to get ingredient predictions and suggestions: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| To help users identify ingredients to flag as unwanted/banned, you can use the **Robotoff API** to get ingredient predictions and suggestions: | |
| To help users identify ingredients to flag as unwanted/banned, you can use the **Taxonomies or Suggestions APIs** to get ingredient suggestions: |
| curl "https://world.openfoodfacts.org/api/v3/product/3017620422003?fields=attribute_groups&attribute_unwanted_ingredients_tags=en:garlic,en:kiwi" | ||
| ``` | ||
|
|
||
| **Example 2: Checking cosmetic products for banned ingredients** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| **Example 2: Checking cosmetic products for banned ingredients** | |
| **Example 2: Checking cosmetic products for unwanted ingredients** |
| **For Open Beauty Facts (cosmetic products):** | ||
| - Common use cases include avoiding controversial cosmetic ingredients (e.g., parabens, sulfates, certain preservatives) | ||
| - Ingredients are matched against the cosmetic ingredients taxonomy | ||
| - Some jurisdictions have lists of banned ingredients in cosmetics that can be referenced |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Some jurisdictions have lists of banned ingredients in cosmetics that can be referenced |



Documentation update for ingredient unwanted ingredients feature:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.