What you ate, in a format you can take anywhere.
The Open Food Log records a person's meals: what they said they ate, the food it matched, how much, what it held, and which numbers were guessed. Any app can write it, any assistant can read it, and the person keeps the log.
Unknown is not zero
A nutrient a food doesn't list is left out, never written as 0. Every key names its unit: protein_g, sodium_mg.
Guesses say so
A size the person didn't give, an amount read from a photo, a model's estimate: each is listed in estimates by JSON pointer, so a label's number and a guess never look the same.
The person's words stay
Each item keeps what the person said beside the food it matched and how sure the match is, and records which app wrote it.
Documents
- meal
- One meal or snack: what the person said they ate, the food each item was matched to, how much, what it held, and where the record came from. Draft; may change until v1.
- food
- One food: what it is, what 100 g of it holds, and the portions people measure it in. Draft; may change until v1.
- log
- A person's whole food log as one file: what an export holds and an import can read. A server may add more of the person's record beside these keys; readers ignore keys they don't know. Draft; may change until v1.
Use it
- meal.json, JSON Schema (draft 2020-12), at its
$id - food.json, JSON Schema (draft 2020-12), at its
$id - log.json, JSON Schema (draft 2020-12), at its
$id - nutrients.json, the nutrient keys and their mappings
- amount-vectors.json, worked cases from an amount to grams to nutrients
- An example meal, a food and a log
- The Open Food Catalogue: generic foods with
ofc:IDs from USDA FoodData Central, one per line, CC0 go run github.com/openexercise/open-food-log/cmd/ofl@latest validate my-meal.json