Taxonomy

Get Taxonomy Suggestions

Open Food Facts uses multilingual taxonomies to normalize entries for categories, labels, ingredients, packaging shapes / materials / recycling instructions and many more fields.

This API returns taxonomy entries suggestions that can be used in product edit forms, search forms etc. (for instance in autocomplete dropdowns using libraries like Tagify or select2 on the Web).

Suggestions filtering:

The string parameter allows to get only suggestions that contain a specific string (useful for autocomplete suggestions).

Suggestions ordering:

  • For packaging shapes and materials, suggestions are ordered first by the number of packaging components they appear in (restricted by country, categories and shape (for materials) if they are passed as parameters).
  • for all other taxonomies, results are ordered alphabetically

If a string is passed, an additional sort is done to put first suggestions that start with the string, followed by suggestions with a word that start with the string, and then suggestions that contain the string anywhere.

get/api/v3/taxonomy_suggestions

Query parameters

stringstring
Example:pe

Optional string used to filter suggestions (useful for autocomplete). If passed, suggestions starting with the string will be returned first, followed by suggestions matching the string at the beginning of a word, and suggestions matching the string inside a word.

categoriesstring
Example:yougurts

Comma separated list of categories tags (e.g. "en:fats,en:unsalted-butters" or categories names in the language indicated by the "lc" field (e.g. "graisses, beurres salés" in French)

shapestring
Example:bottle

Shape of packaging component (tag identified in the packaging_shapes taxonomy, or plain text tag name in the language indicated by the "lc" field)

limitstring

Maximum number of suggestions. Default is 25, max is 400.

get_synonymsstring

Whether or not to include "matched_synonyms" in the response. Set to 1 to include.

termstring

Alias for the "string" parameter provided for backward compatibility. "string" takes precedence.

Parameters

./parameters/tagtype.yaml#/components/parameters/Tagtype — unresolved $ref
./parameters/cc.yaml#/components/parameters/Cc — unresolved $ref
./parameters/lc.yaml#/components/parameters/Lc — unresolved $ref