Products API

The barcode index: look up, scan labels and submit products. 6 ops: lookup_barcode, get_product, scan_label, submit_product, list_submissions, review_submission.

The barcode index: look up, scan labels and submit products.

Look up a barcode · POST /api/v1/lookup_barcode · scope products:read or GET …?input=

Find a packaged food by its barcode: our product index first (instant), then Open Food Facts, then USDA Branded Foods; a product found outside the index is added to it. Returns found, the product (brand, name, serving, nutrients per serving and per 100 g as integers plus display_per_serving in kcal/g, ingredient text, parsed ingredient ids, allergens, status unverified | community_verified | verified, where each field came from and any attribution to show, e.g. Open Food Facts under ODbL) and found_in (index, off, usda_branded). When found is false, ask the person for a photo of the nutrition label and ingredients, then call submit_product with what you read (free) or scan_label with the photos. Free and unlimited. To log the product as eaten, pass the barcode to log_meal instead.

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

get_product

readno credential needed

Get a product · POST /api/v1/get_product · scope products:read or GET …?input=

A product already in our index by GTIN or id: brand, name, serving, nutrients per serving and per 100 g, ingredient text and parsed ingredient ids, allergens, verification status, the source of every field and the attribution to show, and its public page URL. Never calls outside services (use lookup_barcode for a code we may not have yet). Free; no sign-in needed.

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

Read a label photo · POST /api/v1/scan_label · scope products:write

Read a food package from photos on our model: the nutrition facts panel, serving size, ingredient statement and the barcode digits if visible. Returns the label (nutrients as integers in stored units: energy in millikilocalories, mass in milligrams), per 100 g, a display version, parsed ingredient ids with allergens and what did not match. With gtin (or a readable barcode) and submit true (default), it also submits the label to the product index, like submit_product. Uses one analysis from the daily allowance (402 plan_limit past it). If you can see the photo yourself (ChatGPT, Claude), read it and call submit_product instead: that is free.

curl -X POST https://getgutlog.com/api/v1/scan_label \  -H "Authorization: Bearer gutlog_…" \  -H "Content-Type: application/json" \  -d '{"images":[{"media_type":"image/jpeg","data":"data"}]}'

Submit a product label · POST /api/v1/submit_product · scope products:write

Add or correct a packaged food in the product index from its label: the barcode plus what the label says (brand, name, serving size and grams, the nutrition panel per serving as integers in stored units, the ingredient statement verbatim). A new barcode creates the product (unverified); a label matching ours confirms it, and a second person's matching label verifies it (community_verified); a different label is kept as a pending revision with a diff until another person's label or staff review confirms it. Returns submission_id, status (pending, matched, conflicting, accepted), the product, the diff and a message to relay. Free; uses no analysis.

curl -X POST https://getgutlog.com/api/v1/submit_product \  -H "Authorization: Bearer gutlog_…" \  -H "Content-Type: application/json" \  -d '{"gtin":"gtin","label":{"name":"scrambled eggs"}}'

List product submissions · POST /api/v1/list_submissions · scope products:read or GET …?input=

Gutlog staff: product label submissions waiting for review (pending and conflicting by default, oldest first) with the label, the diff against the product and the revision it proposes.

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

Review a product submission · POST /api/v1/review_submission · scope products:write

Gutlog staff: accept a label submission (its label becomes the product's, recorded as a revision with a diff, and the product is verified) or reject it (a pending revision it proposed is dropped).

curl -X POST https://getgutlog.com/api/v1/review_submission \  -H "Authorization: Bearer gutlog_…" \  -H "Content-Type: application/json" \  -d '{"submission_id":"6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10","decision":"accept"}'