Foods API

Search the food database and your personal foods; nutrients per portion. 2 ops: search_foods, get_food.

Search the food database and your personal foods; nutrients per portion.

search_foods

readno credential needed

Search foods · POST /api/v1/search_foods · scope foods:read or GET …?input=

Find canonical foods by name in USDA FoodData Central (Foundation, SR Legacy and FNDDS mixed dishes) plus packaged products in the barcode index. Returns foods best first with a 0–1 match score, nutrients per 100 g (integers: energy in millikilocalories, macros and most minerals in milligrams, some vitamins in micrograms), the default serving with kcal and grams for display, household portions ("1 cup, sliced" = 165 g) and canonical ingredient ids; and products (brand, name, gtin). Use it to pick the food id before get_food, or to answer "how many calories in…". Free; no sign-in needed. log_meal matches foods itself: you do not need this to log.

curl -X POST https://getgutlog.com/api/v1/search_foods \  -H "Authorization: Bearer gutlog_…" \  -H "Content-Type: application/json" \  -d '{"query":"greek yogurt"}'

get_food

readno credential needed

Get a food · POST /api/v1/get_food · scope foods:read or GET …?input=

One canonical food by id (from search_foods, e.g. usda:171705) or by its page slug: name, category, source and citation, every nutrient per 100 g, all household portions, ingredient ids and its public page. Pass grams or a portion label to also get the nutrients for that amount (integers in stored units, plus a display version in kcal and grams). Free; no sign-in needed.

curl -X POST https://getgutlog.com/api/v1/get_food \  -H "Authorization: Bearer gutlog_…"