Pub Version Run sdk tests likes popularity pub points

Open Food Facts - Dart

Dart package for the Open Food Facts API. Easily access to more than 1.9 million products from all around the world. Open Food Facts is powered by contributors from around the world and is constantly growing thanks to them.

How to use ?

You can find the full documentation here: Documentation. You can find automated code documentation here: Documentation.

General principles

  • You can look for information about products, including many useful computed values.
  • If you can't get the information on a specific product, you can get your user to send photos and data, that will then be processed by Open Food Facts AI and contributors to get the computed result you want to show them.
  • You can also implement the complete flow so that they get immediately the result with some effort on their side.

Contributing

If your users do not expect a specific result immediately (eg. Inventory apps)

  • Send photos (front/nutrition/ingredients/packaging): most painless thing for your users
  • The Open Food Facts AI Robotoff will generate some derived data from the photos
  • Overtime, other apps, and the Open Food Facts community will fill the data gaps

If your users do expect a result immediately (eg Nutrition apps, Scoring apps…):

  • Send nutrition facts + category > get the Nutri-Score
  • Send ingredients > get the NOVA group (about food ultra-processing), additives, allergens, normalized ingredients, vegan, vegetarian…
  • Send category (strict minimum) + labels + origins of ingredients + packaging (photo and text) > get the Eco-Score (about environmental impact)

Open Data Licence

The database in under the OdBL. This means attributing the source and also contributing back any additions (photos, data), which this package makes easy to do. You can check the terms of use here : Terms of use.

List of current features

GENERAL

  • x Multilingual (180 languages are supported)
  • x Create users
  • x Check if users exist

READ

  • x Product: you can retrieve information about products
  • x Product images (get product image by field, size and language, current fields are: Front, Ingredients, Nutrition, Packaging)
  • x Additives, Allergens, Environment impact, Ingredient analysis, Nutrient levels, Nutrition facts (incl. micro-nutrients)
  • x Language dependant fields (like ingredients, product name, packaging text)
  • x Eco-Score, Nutri-Score, NOVA groups
  • x Translated, high-level and customizable product information (Attributes)
  • x Product completion status
  • x Folksonomy Engine (custom properties for products)
  • x Open Food Facts Events (Gamification)

PERSONALIZATION

  • x Recommended Daily Intakes
  • x Translated, high-level and customizable product information (Attributes)
  • x Autocompleting for the user inputs, by giving suggestions for (Labels, categories, ingredients, additives, traces ...)
  • x search products by tags
  • x search products with / without additives
  • x search products with keywords
  • x Personalized search

WRITE

  • x Save product to Open Food Facts
  • x Send images
  • x User comments and auth
  • x Anonymous photo upload
  • x Photo operations (rotate, crop, select, unselect with language awareness)

ML

  • x Robotoff support
  • x Extract ingredients from ingredients image: User can extract the ingredients text if it is missing
  • x Get the OCR of the ingredients photo (for validation purposes)

Roadmap

READ

  • ???

WRITE

Other

Contribute

There are many ways to contribute, and Open Food Facts has a lot of projects beside this package. Most of our operations are coordinated through our Slack which you can join here : Open Food Facts Slack.

Regarding this package, we accept pull requests as well feature requests.

Testing

Execute the following command from the root of the repository to run the tests:

dart test

Applications using this SDK

Official application

Smoothie is the official developed by Open Food Facts, which will soon be released on Android and iOS. The source code is also available on GitHub.

Third party applications

Feel free to open a PR to add your application in this list.

Authors

Libraries

utils/AbstractQueryConfiguration
model/Additives
model/Agribalyse
model/Allergens
model/parameter/AllergensParameter
model/Attribute
model/AttributeGroup
personalized_search/available_attribute_groups
personalized_search/available_preference_importances
personalized_search/available_product_preferences
model/BadgeBase
model/parameter/BarcodeParameter
utils/BarcodesValidator
model/parameter/BoolMapParameter
utils/CountryHelper
model/EcoscoreAdjustments
model/EcoscoreData
model/EnvironmentImpactLevels
events
model/EventsBase
folksonomy
utils/HttpHelper
utils/ImageHelper
model/Ingredient
model/parameter/IngredientsAnalysisParameter
model/IngredientsAnalysisTags
model/Insight
utils/InvalidBarcodes
utils/JsonHelper
interface/JsonObject
model/KeyStats
model/KnowledgePanel
model/KnowledgePanelElement
model/KnowledgePanels
utils/LanguageHelper
model/LeaderboardEntry
model/LocalizedTag
model/LoginStatus
personalized_search/matched_product
personalized_search/matched_product_v2
model/Nutrient
model/NutrientLevels
model/Nutriments
utils/NutrimentsHelper
utils/OcrField
model/OcrIngredientsResult
model/OcrPackagingResult
model/OffTagged
utils/OpenFoodAPIConfiguration
openfoodfacts
model/OrderedNutrient
model/OrderedNutrients
model/OriginsOfIngredients
model/Packaging
model/parameter/Page
model/parameter/PageNumber
model/parameter/PageSize
interface/Parameter
model/PerSize
model/parameter/PnnsGroup2Filter
utils/PnnsGroups
personalized_search/preference_importance
model/Product
personalized_search/product_preferences_manager
personalized_search/product_preferences_selection
utils/ProductFields
model/ProductFreshness
utils/ProductHelper
model/ProductImage
model/ProductList
utils/ProductListQueryConfiguration
model/ProductPackaging
utils/ProductQueryConfigurations
model/ProductResult
model/ProductResultField
model/ProductResultFieldAnswer
model/ProductResultV3
utils/ProductSearchQueryConfiguration
model/ProductStats
model/ProductTag
utils/QueryType
model/RecommendedDailyIntake
utils/RecommendedDailyIntakeHelper
model/RobotoffQuestion
model/SearchResult
model/parameter/SearchTerms
model/SendImage
model/SignUpStatus
model/parameter/SortBy
model/SpellingCorrections
model/State
model/parameter/StatesTagsParameter
model/Status
model/parameter/TagFilter
model/TagI18N
utils/TagType
model/TaxonomyAdditive
model/TaxonomyAllergen
model/TaxonomyCategory
model/TaxonomyCountry
model/TaxonomyIngredient
model/TaxonomyLabel
model/TaxonomyLanguage
model/TaxonomyNova
model/TaxonomyOrigin
model/TaxonomyPackaging
model/TaxonomyPackagingMaterial
model/TaxonomyPackagingRecycling
model/TaxonomyPackagingShape
utils/TaxonomyQueryConfiguration
utils/ToBeCompletedConfiguration
utils/UnitHelper
utils/UriHelper
utils/UriReader
utils/UriReader_io
utils/UriReader_js
utils/UriReader_stub
model/User
model/UserAgent
utils/UserProductSearchQueryConfiguration
model/parameter/WithoutAdditives