Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 31, 2025

Documentation update for ingredient unwanted ingredients feature:

  • Expand the unwanted ingredients section with comprehensive documentation
  • Document how to send queries with ingredients to flag
  • Add documentation for both food (Open Food Facts) and cosmetics (Open Beauty Facts) usage
  • Update OpenAPI specification (docs/api/ref/api-v3.yaml) with detailed parameter documentation
  • Update v2 API specification (docs/api/ref/api.yaml) with parameter documentation
  • Add examples showing how to use the feature in practice
Original prompt

This section details on the original issue you should resolve

<issue_title>Document the new ingredient ban feature.</issue_title>
<issue_description>### Task

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Document the new ingredient ban feature Document unwanted/banned ingredients attribute feature Oct 31, 2025
Copilot AI requested a review from teolemon October 31, 2025 13:05
Copilot finished work on behalf of teolemon October 31, 2025 13:05
Copilot finished work on behalf of teolemon October 31, 2025 13:09
@sonarqubecloud
Copy link

@teolemon teolemon changed the title Document unwanted/banned ingredients attribute feature docs: Document unwanted/banned ingredients attribute feature Oct 31, 2025
@github-actions github-actions bot added 📚 Documentation Documentation issues improve the project for everyone. API v3 📚 OpenAPI labels Oct 31, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 3, 2025

@teolemon teolemon marked this pull request as ready for review November 3, 2025 21:39
@teolemon teolemon requested a review from a team as a code owner November 3, 2025 21:39
@teolemon
Copy link
Member

teolemon commented Nov 4, 2025

Here's the associated issue and comment by @monsieurtanuki
openfoodfacts/openfoodfacts-dart#1134
cc @stephanegigandet

@github-actions github-actions bot added the 💥 Merge Conflicts 💥 Merge Conflicts label Nov 5, 2025
- 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+)
Copy link
Contributor

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
Copy link
Contributor

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:
Copy link
Contributor

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.

@teolemon teolemon changed the title docs: Document unwanted/banned ingredients attribute feature docs: Document unwanted ingredients attribute feature Nov 6, 2025
- 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+)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#### 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Some jurisdictions have lists of banned ingredients in cosmetics that can be referenced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API v3 📚 Documentation Documentation issues improve the project for everyone. 💥 Merge Conflicts 💥 Merge Conflicts 📚 OpenAPI

Projects

Status: To discuss and validate
Status: Todo
Status: In progress

Development

Successfully merging this pull request may close these issues.

Document the new ingredient ban feature.

3 participants