Guides

Where does OnMacros get its food data?

By OnMacros editorialUpdated November 10, 20265 min read
Where does OnMacros get its food data? title card

OnMacros reads the numbers for a food from two public databases, USDA FoodData Central and Open Food Facts, and labels anything else as added by people. A model decides which food you mean, and the database supplies the values.

The principle

A macro tracker is only as good as the numbers under it. An app that lets an AI recall calories from memory will give confident figures that drift. OnMacros is built the other way around: the AI works out what you ate, then looks the food up, and the stored values are what get counted. The home page puts it plainly: the AI never invents grams, it looks them up.

That rule makes the source of the data matter, so here is what the sources are.

USDA FoodData Central

FoodData Central is the United States Department of Agriculture's food composition resource. Its data type documentation describes five kinds of data, each with its own origin:

  • Foundation Foods: data and metadata on individual samples of commodity or minimally processed foods, with insight into how much a food varies. The source is USDA analysis, and releases come in April and October.
  • SR Legacy: historic data on food components, including nutrients derived from analyses, calculations and published literature. It was a final release, published in April 2018.
  • FNDDS (Food and Nutrient Database for Dietary Studies): nutrients and portion weights for foods and beverages reported in What We Eat in America, NHANES. It is updated every two years.
  • Branded Foods: data from the labels of national and international branded foods, collected through a public and private partnership, updated monthly.
  • Experimental Foods: data on food published in peer reviewed journals, supported by or in collaboration with USDA.

For plain foods, such as oats, salmon, sweet potato or broccoli, this is the backbone. The values on the OnMacros home page demo day are USDA figures. A USDA row carries a verified mark in the app, because its numbers come from the source and not from a person typing.

Open Food Facts

Open Food Facts is a collaborative database of packaged products. Its terms of use say the database can be viewed on the website, which also lets users add, complete or correct product data. Because anyone can contribute, it can reach brands and countries that a single national dataset does not.

That reach comes with two things to know. First, the quality of an entry depends on the people who entered it, which is why OnMacros labels a packaged product as branded and treats it as a different kind of record from a USDA row. Second, the license brings an obligation.

What the license asks

The Open Food Facts terms state that the database is available under the Open Database License, individual contents of the database are available under the Database Contents License, and product images are available under the Creative Commons Attribution ShareAlike license. The terms ask anyone who reuses the data to attribute the source and, for derivative works, to share them under the same conditions.

The Open Data Commons page for the ODbL v1.0 describes the license as one intended to let users freely share, modify and use a database while keeping that same freedom for others. Its text includes a share alike clause for a derivative database that is publicly used.

OnMacros handles this in the open. The product has a data sources page that names each source with its license, and Open Food Facts is credited there with the ODbL. If you build on top of data from a source, credit it. It costs one line and it is the correct thing to do.

Foods added by people

Not every food is in a public database. Home recipes, a restaurant dish, or a product that is missing can be added by a person. In OnMacros such entries are listed under added by people in the data sources list and are not given the verified mark that a USDA row has. A recipe built from your own ingredients is labeled Recipe, and an estimate is labeled Estimate.

This matters when you read a result. A verified mark tells you the numbers came straight from a reference dataset. A person's entry is a reasonable record and may still be a guess. Knowing which is which lets you decide where to double check.

How a food gets picked

When you say what you ate, OnMacros searches its food records for a match and asks the AI to choose among real candidates. The AI does not make up a food or a food id. If the right food is not found, you can add it, and from then on it is available to you as your own record.

When two records disagree, prefer the one with the more direct source. For a generic ingredient that is usually USDA. For a branded product, the label on the pack is the truth for that pack, and the packaged entry should match it.

What to remember

  • USDA FoodData Central supplies generic foods and is the backbone of the verified numbers.
  • Open Food Facts supplies packaged products and is credited under the ODbL.
  • Anything added by a person is labeled as such.
  • The AI chooses among stored records. The values come from the records.

Good numbers start with knowing where they came from, and now you can see where ours do.

Questions

Why use two databases instead of one?

They cover different ground. USDA FoodData Central is strong on generic foods such as chicken breast, rice and spinach. Open Food Facts is strong on packaged products with a brand name.

Is a food someone added as trustworthy as a USDA row?

Treat it as a different kind of record. A food added by a person is listed under added by people in the data sources list and does not carry the verified mark that a USDA row has, so you can tell the two apart.

What does the Open Food Facts credit mean?

The database is licensed under the Open Database License, which asks that users credit the database. OnMacros lists Open Food Facts and the license on its data sources page for that reason.

Do the numbers change over time?

Yes, because the sources are updated. USDA publishes new releases on a schedule that depends on the data type, and Open Food Facts changes whenever contributors add or correct a product.

Sources

More guides