Clean and organic API

Clean-ingredient verdicts, profiles, swaps and organic advice. 6 ops: check_clean, get_clean_rubric, get_clean_profile, set_clean_profile, clean_summary, suggest_swaps.

Clean-ingredient verdicts, profiles, swaps and organic advice.

check_clean

readno credential needed

Check if food is clean · POST /api/v1/check_clean · scope clean:read or GET …?input=

Judge ingredients against Gutlog's published clean-ingredient rubric: pass exactly one of ingredients_text (a label as printed), ingredients (names), barcode (a product in the index) or meal_id (a logged meal). Returns verdict (clean, mostly_clean, not_clean), a 0–100 score, flags (ingredient, category, evidence level: regulatory, strong, mixed or preference, the penalty, a one-line why and a citation), organic advice for Dirty Dozen and Clean Fifteen produce (buy_organic, conventional_ok), and names it did not recognize. Uses the person's profile (Strict, Balanced or Custom) unless profile is given. Tell the person the verdict and the top flags with their evidence level; preference flags are not proven harms. Free and unlimited.

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

get_clean_rubric

readno credential needed

Get the clean rubric · POST /api/v1/get_clean_rubric · scope clean:read or GET …?input=

The clean-ingredient rubric as data: version, scoring rules, profiles (strict, balanced, custom) with their thresholds, evidence levels, categories, every rule (ingredient, aliases, category, evidence, penalty, why, citation), additives the EU bans or restricts, and this year's EWG Dirty Dozen and Clean Fifteen with the citation. Filter by category or ingredient id. Use it to explain why something was flagged.

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

Get the clean profile · POST /api/v1/get_clean_profile · scope clean:read or GET …?input=

The person's clean profile: strict, balanced (the default) or custom, and for custom the level per category (off, balanced or strict). Verdicts from check_clean and clean_summary use it.

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

Set the clean profile · POST /api/v1/set_clean_profile · scope clean:write

Choose how strictly food is judged: strict (every rule, including gums, starches and all added sugars), balanced (the default) or custom. With custom, `categories` sets a level per category (off, balanced or strict); categories not given keep their saved level, or balanced. Returns the saved profile. Ask the person before changing it.

curl -X POST https://getgutlog.com/api/v1/set_clean_profile \  -H "Authorization: Bearer gutlog_…" \  -H "Content-Type: application/json" \  -d '{"profile":"strict"}'

Summarize clean eating · POST /api/v1/clean_summary · scope clean:read or GET …?input=

How clean the person ate from `from` to `to` (diary days, inclusive, at most 92 days), or over the last `days` days up to today in their timezone (default 7): the overall verdict and mean score, one entry per day with its meals' verdicts and scores, verdict counts, the worst offenders (flagged ingredients by how often and how heavily they appeared, with evidence and why) and Dirty Dozen or Clean Fifteen produce eaten. Use it for weekly check-ins and to suggest one change at a time.

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

suggest_swaps

readno credential needed

Suggest cleaner swaps · POST /api/v1/suggest_swaps · scope clean:read or GET …?input=

Cleaner products of the same kind from the product index: for one product (barcode) or each indexed product in a logged meal (meal_id). Returns, per product, its verdict, score and flags, and up to `limit` swaps that score higher (brand, name, barcode, verdict, score, improvement and which flags they avoid). Empty when the index has nothing cleaner yet.

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