Meal Logging API Beta
Ground a photo model's or an assistant's guess in sourced values: dish and grams in, matched food and nutrients out.
Keep your vision model or LLM for recognising the food. Send what it saw ("spaghetti bolognese, 350 g"), a barcode or a food id; get the best sourced record (dishes and USDA survey foods as eaten first), alternatives, the weight used and the nutrients, item by item and in total.
Try it
Choose an endpoint and a sample, change the parameters, and send. Without a key the public demo answers the sample requests (marked demo, not counted against any quota, limited per IP address). With your key any values work and the call counts against your plan. The key stays in this page's memory: it is never stored. Get a free key.
Request
curl -s -X POST "https://api.nutrientgraph.com/demo/v1/food/meal/match" \
-H "Content-Type: application/json" \
-d '{"items":[{"label":"spaghetti bolognese","grams":350},{"label":"caesar salad","grams":150},{"label":"banana"}]}'
Response
Recorded answer of the real API on the current data for this sample (long arrays trimmed).
{
"data": {
"lang": "en",
"complete": true,
"totals": {
"grams": 626,
"nutrients": {
"energy_kcal": {
"value": 787.2648,
"unit": "kcal"
},
"protein_g": {
"value": 34.4029,
"unit": "g"
},
"fat_g": {
"value": 26.444,
"unit": "g"
},
"carbohydrate_g": {
"value": 98.4431,
"unit": "g"
},
"fiber_g": {
"value": 10.3895,
"unit": "g"
},
"sugars_g": {
"value": 28.8293,
"unit": "g"
},
"saturated_fat_g": {
"value": 9.029,
"unit": "g"
},
"sodium_mg": {
"value": 1228.0678,
"unit": "mg"
},
"energy_kj": {
"value": null,
"unit": "kJ",
"lower_bound": 2295.111,
"missing_from": [
1,
2
]
},
"water_g": {
"value": 457.3819,
"unit": "g"
},
"alcohol_g": {
"value": 2.1434,
"unit": "g"
},
"added_sugars_g": {
"value": null,
"unit": "g",
"lower_bound": 0,
"missing_from": [
0,
1,
"… 1 more"
]
},
"trans_fat_g": {
"value": null,
"unit": "g",
"lower_bound": 0,
"missing_from": [
0,
1,
"… 1 more"
]
},
"mufa_g": {
"value": 11.7741,
"unit": "g"
},
"pufa_g": {
"value": 2.2655,
"unit": "g"
},
"cholesterol_mg": {
"value": 69.7511,
"unit": "mg"
},
"potassium_mg": {
"value": 1532.9813,
"unit": "mg"
},
"calcium_mg": {
"value": 285.5395,
"unit": "mg"
},
"iron_mg": {
"value": 5.772,
"unit": "mg"
}
}
},
"items": [
{
"index": 0,
"label": "spaghetti bolognese",
"status": "ok",
"food": {
"id": "dish:D0899",
"type": "dish",
"name": "spaghetti Bolognese",
"source": "dish",
"state": "cooked",
"score": 4.25,
"why": [
"main word leads the name",
"dish as eaten"
]
},
"confidence": "high",
"grams": 350,
"weight": {
"method": "caller_grams",
"detail": "grams given by the caller"
},
"alternatives": [
{
"id": "ciqual:25085",
"name": "Bolognese-style pasta (spaghetti, tagliatelle…), prepacked",
"source": "ciqual",
"state": "as_sold",
"score": -8.1
}
],
"nutrients": {
"energy_kcal": 549.5448,
"protein_g": 27.4705,
"fat_g": 20.9762,
"carbohydrate_g": 58.5935,
"fiber_g": 5.5475,
"sugars_g": 7.0763,
"saturated_fat_g": 6.3889,
"sodium_mg": 871.0678,
"…": "11 more fields"
},
"provenance": {
"source": {
"dataset": "dishes",
"record_id": "dish:D0899",
"method": "computed by the dataset's recipe engine from its ingredients' source records (GET /v1/food/foods/dish:...)"
},
"nutrients": {},
"method": "value = per-100 g source value x grams / 100 (code)"
}
},
{
"index": 1,
"label": "caesar salad",
"status": "ok",
"food": {
"id": "fdc:2709591",
"type": "generic",
"name": "Caesar salad, with romaine, no dressing",
"source": "fdc_survey",
"state": "as_sold",
"score": 3.2,
"why": [
"main word leads the name",
"USDA FNDDS food as eaten"
]
},
"confidence": "medium",
"grams": 150,
"weight": {
"method": "caller_grams",
"detail": "grams given by the caller"
},
"alternatives": [
{
"id": "ciqual:25628",
"name": "Caesar's salad (salad, chicken, croûtons, sauce), prepacked",
"source": "ciqual",
"state": "as_sold",
"score": 1.9
},
{
"id": "dish:D0862",
"name": "Caesar salad with grilled chicken",
"source": "dish",
"state": "cooked",
"score": 0.25
},
"… 1 more"
],
"nutrients": {
"energy_kcal": 115.5,
"protein_g": 6,
"fat_g": 5.115,
"carbohydrate_g": 11.235,
"fiber_g": 2.7,
"sugars_g": 1.845,
"saturated_fat_g": 2.499,
"sodium_mg": 357,
"…": "11 more fields"
},
"provenance": {
"source": {
"dataset": "fdc_survey",
"record_id": "2709591",
"url": "https://fdc.nal.usda.gov/food-details/2709591/nutrients",
"retrieved": "2026-10-10"
},
"nutrients": {
"alcohol_g": {
"source_nutrient_id": "1018"
},
"calcium_mg": {
"source_nutrient_id": "1087"
},
"carbohydrate_g": {
"source_nutrient_id": "1005"
},
"cholesterol_mg": {
"source_nutrient_id": "1253"
},
"energy_kcal": {
"source_nutrient_id": "1008"
},
"fat_g": {
"source_nutrient_id": "1004"
},
"fiber_g": {
"source_nutrient_id": "1079"
},
"iron_mg": {
"source_nutrient_id": "1089"
},
"…": "8 more fields"
},
"method": "value = per-100 g source value x grams / 100 (code)"
}
},
"… 1 more"
],
"method": "Each item: by gtin (label values), by food_id, or by label: full-text search over food and dish names in the given language, ranked by code for foods as eaten (dishes and USDA FNDDS survey foods first…",
"policy": {
"missing_values": "a nutrient a source record does not report is taken from a USDA crosswalk-linked record of the same food (marked filled_from), as POST /v1/food/recipe does; otherwise null, and totals show a lower bou…"
},
"note": "Matches are ranked suggestions: show the user the matched name and alternatives so they can correct it. Not dietary advice."
},
"meta": {
"request_id": "req_…",
"api_version": "1",
"dataset": "food",
"dataset_version": "1.0.0",
"dataset_built_at": "2026-10-10T17:56:11Z",
"data_status": "released",
"sources": [
{
"id": "ah102",
"name": "USDA Agriculture Handbook No. 102, Food Yields Summarized by Different Stages of Preparation (1975)",
"url": "https://www.ars.usda.gov/ARSUserFiles/80400525/Data/Classics/ah102.pdf",
"licence": "U.S. Government work (USDA), public domain in the United States",
"commercial_redistribution_ok": true,
"retrieved": "2026-10-10",
"version": "1975 (scanned PDF, ARS Classics)",
"attribution": "Matthews RH, Garrison YJ. Food Yields Summarized by Different Stages of Preparation. Agriculture Handbook No. 102, USDA, 1975."
},
{
"id": "ciqual",
"name": "ANSES-CIQUAL French food composition table 2025 (English edition)",
"url": "https://ciqual.anses.fr/cms/sites/default/files/inline-files/Table%20Ciqual%202025_ENG_2025_11_03.xlsx",
"licence": "Licence Ouverte / Open Licence (Etalab). Reuse allowed, including commercial, on condition that the data are not altered, their meaning is not distorted, the source and version date are cited, and no …",
"commercial_redistribution_ok": true,
"retrieved": "2026-10-10",
"version": "2025 (file dated 2025-11-03)",
"attribution": "Anses. 2025. Ciqual French food composition table."
},
"… 8 more"
],
"provenance_note": "Every value carries provenance (source, id or URL, retrieval date; method and confidence where an AI judged). Calculations list their inputs and method.",
"disclaimer": "Nutrition reference data. Not medical or dietary advice.",
"usage": "…"
}
}
Endpoints
| Endpoint | What it does | Cost | MCP tool | Documentation |
|---|---|---|---|---|
POST/v1/food/meal/match | Match a meal to sourced foods | 1 unit per item | food_meal_match | Docs |
What is included
- Labels matched against foods and dishes as eaten, in five languages
- Weight from your grams, a quantity and unit, or USDA's default amount, always shown
- Barcodes and known food ids in the same call
- No model on our side: deterministic search and ranking
- Free text and voice transcripts ("two eggs and a coffee") Coming soon
Plans
One key and one plan cover every NutrientGraph product, this one included. Free: 2,500 units a month. Coming soon: Developer $19 and Pro $99 a month. Caching inside your product is allowed, and so is use by AI agents. Plans and units.
How it differs
- Your model recognises the food; the numbers come from a cited record, not from its memory.
- Every item says how its weight was found and offers alternatives the user can pick.
- Missing values stay empty, so a total is never silently low.
Status: Beta (new: the interface may still change, with notice in the docs). All products.