Hacker News new | ask | show | jobs
by shafyy 887 days ago
This is cool. As you said, my recommendation would be to not use ChatGPT to get the nutrition data, but use one of the databases that have good APIs such as USDA's Food Data Central [1]. This is domain where there's structured data and it's important that the output is deterministic, so a LLM is not a good choice.

I once started working on something similar, but the goal was to suggest a list of ingredients for me to buy for the week so that I had a good total nutritional values. I don't work on it anymore though.

1: https://fdc.nal.usda.gov/index.html

3 comments

I'd second this, I just gave it a try and many of the results in the receipt breakdown did not seem to align with the nutritional information available from other sources.

Also, if it's going to give protein advice it should probably recognise meat - unless it's aimed solely at vegetarians & vegans. My receipt had a whole chicken, a lamb shoulder, and a couple of different kinds of fish - but it said I was getting 0 protein and recommended quinoa.

Haha, love its passive-aggressiveness. Lowkey pushing people to plant-based diets :D
This is how we eventually get Soylent Green.
“Fun tip, you have plenty of protein right at home!”
> I once started working on something similar, but the goal was to suggest a list of ingredients for me to buy for the week so that I had a good total nutritional values. I don't work on it anymore though.

Cronometer has a feature that does this – it checks to see where you aren't hitting your daily targets for macro/micronutrients and then suggests foods that would allow you to hit those targets. Quite nifty.

Yes, that's what I ended up using, too! The goal for my project was just to build something as a side project (I was experimenting with Deno and Fresh at that time), not necessarily because I couldn't find an existing alternative.

I tracked my intake for 1-2 weeks with Cronometer and it helped me see what kind of minerals and vitamins I might be missing. I mean, these things are "ballpark" only anyways, and I wouldn't have the discipline to track my every meal. But good to get a general idea - kind of like a check-up, just doing it from time to time.

I had this database in mind too, thanks! Btw Bard has deterministic output as I learned