Hacker News new | past | comments | ask | show | jobs | submit login
Open Food Facts (openfoodfacts.org)
145 points by lelf 12 days ago | hide | past | web | favorite | 47 comments





I was once at a Coffee place, reading a book. There was a 50-ish guy at the adjacent table, explaining cryptography to a bunch of young 20-30 odds (perhaps first-time entrepreneurs). I could not help myself overhear them for 30+ minutes. When they ended their meeting, I asked the guy if I can take some more of his extra time to talk "interesting tech." He was elated, and we spent an additional hour or so just talking. I let him talk most of the time, interrupting him with "my usual dumb questions."

He was part of a Startup sometime back that did some optical etching on medicines. With this, a standard Smartphone app can point to the medicine (tablets, etc.) and be able to track all the info on it. Any attempt to alter the data will result in, of course, corrupted/frauded data.

So, I asked him if the machine do it for food. He was confident that it could be done but will likely be too costly for food items.

I walked out happy, being able to talk to an interesting person. I'm not sure of any information or links, though. If this is something that interesting, it presents a lot of possibilities -- etch an "invisible barcode" on our food, that I can fish out my phone and track every detail about the food.


This is actually a really cool idea, thanks for sharing! With pubkey authentication you could even generate a new QR code for each box of food and sign it against the master for a company. Really cool!

The problem with this (and GPs idea) is that you can copy a valid code from somewhere else; a "replay attack" of sorts. You have to somehow tie the signature to a verifiable but uncopyiable trait which is much, much harder than you'd expect.

I'm not 100% sure this would work but possibly you could see a chain of custody of the product. If it says "I was delivered to Kroger yesterday. I was distributed by Kroger to grocery store #123 today. I was placed on the shelf by employee Bobby Circuits two hours ago." it would be hard to fake this

Only if every participant along the way played along and was dependable. You are talking 10 distribution levels and hundreds of employees. Good luck with establishing such a system, blockchain or not.

Bitcoin works because you don’t need trust, not because everyone is trustworthy.


I'd love to see this data glued to an open source nutrition tracking app of some kind. Most nutrition tracking apps are designed for weight loss, use a limited proprietary database, and make questionable quality/design decisions.

MyFitnessPal is probably the most complete platform in this space, but their backend code seems to be declining in quality recently, and their app does annoying comical things like shaming you for eating the exactly the amount you specified in your goal macros. Actively tracking your calories without developing an eating disorder is challenging enough, but they all seem to be hell bent on keeping users actively engaged instead of actually helping them hit their goals.

I've halfway started on the project I want to exist, but it's one of those side projects I might touch every month or two, and I'm a long way from having any kind of viable product.


Shameless plug (from one of the developers) - you might want to give a try to our app/website - MyNetDiary https://www.mynetdiary.com .

1) We prioritize user experience and health over profits - there are no ads, no user data sharing, even account creation is optional, and all advice, all materials are carefully prepared and reviewed by RDs and CDEs.

2) Technology-wise it's as state-of-the-art as it gets - fully re-written in Swift 5, modern UX, ruthlessly optimized for minimum of taps, fully configurable (even the Dashboard), with awesome apps for Apple Watch and iMessage, with AR Grocery Check tool, etc.

3) Food database (805,000 items) is our crown jewel – if something is not correct or missing, users can send photos of food packages and nutrition facts from the app, we will verify and correct or add the food to the database. Thus, the database has no duplicates and as complete information as available. This is a free service for our users.

The Android app and web app are on par.


The easiest way to get a correct answer on the internet is to post an incorrect answer. You might have already solved this problem. I will definitely check this out, thanks.

But to be clear, it's not affiliated with openfoodfacts, right? So there is still room for a true open source solution that's based on OFF?

FYI during on boarding the “use metric” toggle does not covert the value imported from HealthKit.

> they all seem to be hell bent on keeping users actively engaged instead of actually helping them hit their goals

That's a fundamental tendency for any profit-driven business: The more they keep you using it, the more money they make.

To avoid that tendency, you'd need to make the app open-source and figure out alternative ways of funding its development (donations and/or grants).


For macronutrients and android there is waistline¹(available on fdroid and google app stores). It's pretty much what you asked for, open source and it uses OpenFoodFacts. It's more focused than myfitnesspal, but very usable and I think eating habits are too intimate to share with a company. Plus with myfitnesspal I feel like I'm working for the company when I add products to the database, not so with OpenFoodFacts.

[1] https://github.com/davidhealey/waistline


Great to see a lot of ideas and competition in this space. Another shameless plug for my team's app: https://www.joyapp.com.

High level benefits vs MFP and the other household names:

- Once you learn the ropes, it's an order of magnitude faster to add entries. It was designed to be opened for as little as possible each day.

- Very flexible with regards to dieting. Works just as well for people who want to gain or maintain weight. Low carb and intermittent fasting is also very easy to use with this app.

- Also, there are no community-entered foods. This is a feature in most cases. All the food is either from a professionally curated database (Nutritionix) or custom foods you enter.

- Tracking works all the way down to the micronutrient level, like potassium, vitamins. etc. If you're into that.

- No ads whatsoever. And we don't sell your data. Privacy is very important to us. You're not the product, we sell a product to you.

Another commenter mentioned corrections: this is built into Joy. Even FDA/Nutritionix items can be wrong/outdated. It's rare, but it happens. Or you want to track them differently. This is a single click away.

For the record: I did look at using Open Food Facts as the backing database a couple of years ago. And gave it a recent look again. But compared to the FDA database (for generic foods) and Nutritionix, it was way behind. I do want to explore ways to help the project.


Maybe not as comprehensive, but https://cronometer.com/ goes to lengths to break down foods by amino acids (super helpful for protein tracking and weightlifting) and micronutrients

One of the problems I have with MyFitnessPal (aside from the fact that I hate their UI) is that the nutrition information is not very robust beyond the basic calories, fat, etc. Unfortunately, they try to tell you more nutrition, like, say, potassium, but they don't tell you that the number is likely too low, because most of the food items don't record a value for potassium.

I recently wrote a free iOS app, Eight Brains Nutrition Diary [1] that queries the very comprehensive USDA database and displays nutrition values computed from the meals you input.

[1] https://apps.apple.com/us/app/eight-brains-nutrition-diary/i...


I agree here. Also myfitnesspal doesn't let you easily correct things for being wrong; case in point many products list only the calories for something, and not the macros/nutrients. I often search for something as a proxy for what I made myself, so don't have the stats, but do know it doesn't have 0g protein, 0g fat, and 0g carbs.

Basically it doesn't seem to want to help you flag things to make it better. A collaborative enterprise would.


It is possible to correct entries in MyFitnessPal, but not easily, as you say. I sometimes come across entries that are 100 times off, so someone (a user, or pulled from a database) has entered e.g. 600 kcal for 1 g when it should clearly be per 100 g.

That means I can either enter having eaten 0.4 of 1 gram, or try to correct the information. But when you try to correct it, you can't just say "multiply everything by 100" or add a new 100 g option. It's only possible to divide all entered macro and micro nutrients by 100 to get to the value per 1 g, which is tedious to do while cooking dinner for the family.


Yep, exactly this. It doesn't seem like it should be that hard to let you suggest fixes, or flag things that are clearly incorrect, even if you don't fix them yourself - especially on something i pay for!

It's not open source but I'm working on an app to make nutrition tracking easier, it's called Bitesnap. I'd be open to open sourcing parts of the app and will open up an API for it soon.

I'd love to hear what ideas and features you have in mind.


The "killer feature" that I really really want, is the ability to create meals as ratios of foods, and then scale them up/down. For example, create a meal that's 100g of food A, 150g of food B, etc, with all of the nutrition information from each, and potentially a completely different final weight (more or less water from preparation, etc), say 400g/serving. Then let me log 500g of the meal on a given day, scaling the nutrition content of all of the components as needed.

The way I typically prepare food is by creating large batches of food with many ingredients, and then using different sized portions throughout the week. I think that's the way most people who actively plan their nutrition do it.

A nice-to-have would be the ability to randomly select past meals for a given day that match your goal nutrition profile. I usually eat the same stuff over and over in a given month, so planning what to eat for the week while maintaining variety is more of a chore than anything creative.


Nice, I've actually had a few people ask for that. Might have to add a way to turn a logged meal into a recipe/new item and let you adjust it the way you described.

Meal planning and suggestions is also on the roadmap.


Unless I misunderstand you, I solve this in MyFitnessPal by first creating a recipe with all ingredients, including water, then selecting the number of portions so that each portion is (close to) 100 grams. That way I can have 230 grams later and just enter 2.3 portions.

What I thought you meant when you talked about entering ratios of food that you can scale up and down is that at first I created "Spaghetti and sauce" recipes, with a set amount of spaghetti and sauce. But then I may just keep the left-over sauce in the fridge, and next time I'll have a different amount of pasta. Since the recipe is fixed, I can't easily change the ratios of the recipe as I add it, but would have to create a completely new recipe with a different amount of pasta.

I've now started creating recipes for only the sauce part, and will enter the pasta separately for each meal. That makes it more flexible, but annoying for recipes where I always have the same things toghether.

One thing that I miss from the recipe handling in MyFitnessPal is that when I'm in the diary day view and want to add a recipe to a meal, I can't see the list of ingredients or how much it is of each. I have to go to the recipe section first to be able to see that. For example, I have a protein shake I've added as a recipe that's 250 g of plant-based milk and 45 g of protein powder, but I always forget if it's 40, 45, or 60 grams of powder. I would prefer to be able to add the recipe to a meal and from the diary see the amounts of different ingredients in the recipe, like a click-to-expand-the-recipe feature.


try cronometer. i've been using them for several years, they are by far one of the best calorie tracking apps out there.

What would really solve the problem of food tracking and diet apps is a QR code containing all nutritional values on the package of every food product. I really can't believe this is not implemented yet. It's law to put all nutritional values on the package (in Europe at least), so why not go a step further and make it machine readable?

What's the improvement of a QR code over the universally-present UPC barcode that is already in place?

You need a database to link the UPC to the nutritional values. And the UPC needs to be in the database, which not every product will be.

Grandparents wish was for the nutritional values to be encoded directly in the QR code.


You can mandate manufacturers write the values to the database the same way you'd mandate that they print values on the packaging.

You would probably use EAN or even GTIN rather than UPC to be more universal while you're at it.

Edited to add:

Using GTINs on actual articles might have made a slightly incremental improvement to life in current turmoil. Ordinarily of course competing supermarket brands in the UK aren't allowed to work together - that's a competition rules violation. But right now four half-empty trucks to four supermarkets makes no sense, so send two full trucks and you've got two other trucks to take stuff elsewhere. But the result is my local Brand X supermarket has Brand Y "own brand" products on some shelves. If a truck full of frozen vegetables arrives, and they're Brand Y vegetables, well, too bad, customers want food, they'll buy those just the same. But the codes for them don't work because each supermarket uses its own short (EAN-8) codes, since they never expect them to be used in other companies. So I can't easily buy those vegetables. I still will of course because I want food, there are _queues_ to buy food now. But if they used longer codes they could just share all the data across all the big supermarkets and it would Just Work™.


I always get a little irritated, perhaps irrationally so, when I find another "open" project that uses a new or obscure content licensing scheme. In this case, they are using ones from the "Open Database" family, of which I am not familiar.

Can someone clarify what, if any, advantages for consumers/users this has over one of the Creative Commons content licenses? If there is a code aspect to it, then please similarly explain the advantage it has over one of the BSD, MIT, Apache, or A/GPL-compatible licenses.

License proliferation has been a real pain of late (past few years) and has muddied the waters significantly whereas many of these above-mentioned ones have largely stood the test of time and already serve a huge swath of the content world.


In 2012 OpenStreetMap switched from CC-BY-SA to Open Database Licence.

I think the most important is the provision that "produced works" need only to attribute the authors, and if you don't modify the source database then the license is non-viral.


A summary of the reason for their change is here: https://wiki.osmfoundation.org/wiki/Licence/Historic/We_Are_...

Also worth noting is that OSM was on CC-BY-SA version 2 prior to the change. If I'm remembering correctly, version 3 or 4 of the CC licenses made it more amenable to databases, but I'll have to do a little more digging to see if my memory is serving me correctly...


Databases are not always copyrightable, depending on the jurisdiction.

There's a better explanation than I could possibly give here: https://wiki.osmfoundation.org/wiki/Licence/Historic/We_Are_...


Founder of a food related robotics company here. There are a number of databases out there covering this sort of thing already, eg. USDA's NNDB. Some of the issues: not global in coverage, static entries where product formulae change, raw entries where products are typically cooked, variable cooking times, variable ingredients, new brand names/mergers, unknown products. Frankly if you want to know what is in your food precisely, the best way is to grow it in an environment that you control, and eat it directly instead of packaging, storing, preserving or transporting.

My son has a handful of food allergies (peanuts, Cashews, pistachios and unfortunately milk). When you say "traces" is that like the equivalent of "Made in a facility with X"?

IMO, this could be very useful for people ordering phone online, but the packaging and definitions should probably be pulled directly from the manufacturer.

For example, "Made in a facility with X, but we clean our machines every day to ensure no cross contamination" is a lot better than "Made on a shared machine with products that contain X".


I would not trust any online source for this. Some years ago I was buying chocolate for my daughter who has a peanut allergy. On a single grocery store shelf, some Hershey bars had peanut warnings and others didn't. I called the company and learned that some of their facilities are shared and some aren't, so you always have to check the packaging, even if it's the same product you've bought before.

That's true. Two other situations that can trip you up is when a company changes the ingredients, without clearly advertising it, and restaurant chains with different preparation procedures.

An ingredient change in Sweden that was minor, but still led to some confusion, was when the Marianne candy [1] changed the text from "May contain traces of milk" to "Contains <0.05 g of milk". Some vegans eat products with traces of milk, but the latter made it sound like it was something that was specifically added. Dairy products can also be completely added or removed from products without any other notice, which is something I'm not too bothered by if I make a mistake, but if I had a real allergy I might need to be more careful.

Fast-food chains sometimes prepare the food differently between restaurants. The Max hamburger chain (or if it was Burger King, I don't remember) usually prepare the vegan options separately. But in some restaurants, due to space constraints, they fry the vegan products together with chicken products, or use the same counter space for preparation for vegan options and cheese. So if you care about this, you need to ask specifically in each restaurant, because they can't guarantee that they never come in contact in all restaurants. It's not enough to just look at the list of ingredients.

[1] https://en.fazer.com/collections/marianne/products/marianne-...


Used by many product checking apps. In France, Yuka seems to be the leader app ( https://yuka.io/en/ ). Yuka uses the open food facts database to fill its own datatabase. This kind of app is used a lot here to verify the chemicals in a product. It already started to force food companies to change their recipes and to remove bad chemicals they usually put into their products.

Personally, I like my food data normalized to a given calorie quantity so i can easily make comparisons and rank foods/recipes easily. I like to search for foods based on their nutritional content: micronutrients like vitamins and minerals. i couldn't find anything like that on the web. anyways, so i created: https://kale.world/c. (shameless plug, i know)

Out of nostalgia for German foods I grew up with I clicked on two: a packaged whole grain bread and some Liverwurst, I would love to eat those two together. First gets an "A", second gets an "F". I guess I average out - awesome.

I guess the liverwurst got an F, and that's because of the fat contents? I'm eating keto-like and most of what I eat have terrible nutriscores because of fat contents. Meanwhile useless stuff like white sliced bread gets a B.

High fat but also lots of preservatives, I think that's the killer. I've been planning on making my own, here in the US you can get "Braunschweiger", which is great, but in Germany any decent supermarket will have a dozen different Liverwurst varieties.

My personal interest in such a thing would be health related, a la "Let your food be your medicine." Talking about medicinal uses of food tends to be highly controversial, and never mind the endless studies into health effects of various foods and the constant interest in diet and health.

I don't readily see what kinds of "facts" about food they specifically desire or will accept. They may want to address that before someone comes along and starts adding facts that other people would object to for various reasons.


I work for a diabetes prevention startup, and we found that https://myfitnesspal.com and https://www.wikicalories.com have most of the foods facts at least for the UK. However we also found that such crowdsourced info is often not reliable.

The USDA also maintains a big database of nutrition information. The older version had better features but unfortunately they rewrote everything and lost some of those features. https://fdc.nal.usda.gov/

Looks fantastic! But why no price information? I'd suspect maybe for legal reasons, but there are other websites tracking prices in supermarkets...

I agree that this would be the ultimate tool for consumers, but think how hard if a problem this is. Do you track the price for every grocery store in the world. Where does that data come from?

I think for starters that receipts should be provided in a format that's useful for consumers. Consumers could then contribute to keeping this database up to date. There is absolutely no consistency in the way stores print receipts and I'm pretty sure that's by design.

The way business work is they want to be able to track you without you being able to track them.


It's already a collaborative database using tons of user supplied data. How hard would it be to add another entry for (price, date, supermarket, location)? For example (€4.99, 25/3/19, Lidl, Berlin DE)

There's already an app with a scanner, you could just walk down the supermarket and scan a few things and when you do you see the price displayed for your location (if available), if it's significantly different you can change it.


I don't think price would be very meaningful, since the price will be dependent on area. A major metropolitan area with a high cost of living will have higher prices, as will a small town that's 30 minutes from the nearest small city. And across countries, not only is there different tax rates, whether the tax is included in the price (US: no, Europe: yes, I believe), there is also the variation in exchange rate, which could be substantial. Then some stores may use the product as a loss leader, while others do not.



Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: