Graph Beta Get a free key

NutrientGraph API · OpenAPI 3.1 and MCP

API documentation

The NutrientGraph APIs, grouped by product: Food Database, Barcode, Nutrition Analysis and Meal Logging, plus the MCP server.

Generated from the OpenAPI 3.1 spec (openapi.json); every example response below is real output of the API on the current data.

Try the API

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, or your account when you are signed in, any values work and the call counts against your plan. A key stays in this page's memory: it is never stored. Get a free key.

1 unit per call. Endpoint docs

query, required: Search text

query: Language of the name; non-English names of USDA foods are machine translations (marked as such)

query

query

query

query: Food group (GET /v1/food/groups); returns generic foods only

query: Preparation state; returns generic foods only

query: Source dataset; returns generic foods only

query: Only foods with (true) or without (false) a source portion weight; returns generic foods only

query: Comma-separated nutrient keys to return per 100 g in each result, e.g. energy_kcal,protein_g

Your API key (optional)

Leave empty for the demo. With a key the playground calls the real endpoint from your browser; the key is kept in memory only.

Recorded answer of the real API on the current data for this sample (long arrays trimmed).

Response

Response 200GET/v1/food/search
{
  "data": {
    "query": "chicken breast roasted",
    "lang": "en",
    "type": null,
    "count": 3,
    "results": [
      {
        "id": "fdc:2705956",
        "type": "generic",
        "name": "Chicken breast, baked, broiled, or roasted, skin not eaten, from raw",
        "basis": "100 g",
        "energy_kcal_per_100": 161,
        "energy_provenance": {
          "source": "fdc_survey",
          "record_id": "2705956",
          "source_nutrient_id": "1008",
          "retrieved": "2026-10-10",
          "method": "copied from source"
        },
        "is_preferred": true,
        "matched_name": "Chicken breast, baked, broiled, or roasted, skin not eaten, from raw",
        "matched_lang": "en",
        "score": 6.119,
        "why": ["name is the search words", "state cooked", "… 1 more"]
      },
      {
        "id": "fdc:2705955",
        "type": "generic",
        "name": "Chicken breast, baked, broiled, or roasted, skin eaten, from raw",
        "basis": "100 g",
        "energy_kcal_per_100": 192,
        "energy_provenance": {
          "source": "fdc_survey",
          "record_id": "2705955",
          "source_nutrient_id": "1008",
          "retrieved": "2026-10-10",
          "method": "copied from source"
        },
        "is_preferred": true,
        "matched_name": "Chicken breast, baked, broiled, or roasted, skin eaten, from raw",
        "matched_lang": "en",
        "score": 6,
        "why": ["name is the search words", "state cooked", "… 1 more"]
      },
      "… 1 more"
    ],
    "ranking": "Generic foods and dishes together, by a score computed from the data (each result's score and why): every word as a whole word (not only the start of a longer word), the name starting with the words o…"
  },
  "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": "…"
  }
}
  1. 1Pin and diff: the version is also in the X-Dataset-Version header

Request

curlGET/v1/food/search
curl -s "https://api.nutrientgraph.com/demo/v1/food/search?q=chicken+breast+roasted&lang=en&limit=3"

Getting started

  1. Create a free account: confirm your email with a code, and your first key is on your dashboard, where you also create, name and revoke keys and see your usage.
  2. Send it in the X-API-Key header (or Authorization: Bearer).
  3. Base URL: https://api.nutrientgraph.com.
First callGET/v1/food/search
export API_KEY=xmd_live_...
curl -s "https://api.nutrientgraph.com/v1/food/search?q=chicken+breast+roasted&lang=en&limit=3" -H "X-API-Key: $API_KEY"

Responses and provenance

Every successful response is {"data": …, "meta": …}. meta always has dataset, dataset_version, dataset_built_at, data_status, the sources with their licences, a disclaimer and your usage. The X-Dataset-Version header repeats the version so you can pin and diff.

Inside data, each value carries its provenance: the source, the record id or URL, the source field and value, and the retrieval date; where an AI judged something, the method and a confidence. Calculations list their inputs and method.

Envelope
{
  "data": { … 6 more },
  "meta": {
    "dataset": "food",
    "dataset_version": "1.0.0",
    "dataset_built_at": "2026-10-10T17:56:11Z",
    "data_status": "released",
    "sources": [
      … 10 more
    ]
    … 5 more
  }
}
  1. 1Pin and diff: the version is also in the X-Dataset-Version header

Errors and limits

Errors are {"error": {"code", "message", "details"}} with an HTTP status:

Error statuses
StatusMeaning and typical codes
400Invalid request: invalid_request, invalid_gtin, invalid_food_id, nutrient_values_not_accepted
401missing_api_key, invalid_api_key, revoked_api_key
404food_not_found, barcode_not_found
422Valid but not computable: basis_not_per_100g, portion_without_grams, recipe_error
429rate_limited (see Retry-After), quota_exceeded, too_many_attempts (signup, key changes and the demo)
503dataset_not_loaded

Rate limits are per key per minute; quotas are monthly units. Headers on every metered call: X-RateLimit-Limit, X-RateLimit-Remaining, X-Quota-Limit, X-Quota-Used. X-Quota-Limit is the units included in your plan each month, not the point where calls stop: free plans stop there, paid plans keep working up to meta.usage.hard_cap_units. meta.usage.units_charged is the units a call counted against your plan (a count, not money). Your usage by product and endpoint: GET /v1/usage. Errors cost nothing. See pricing for the limits of each plan.

Free keys stop at their included units until the next month. Developer and Pro keep working above their included units at no extra charge during the beta, up to 3× the included units; then calls answer 429 quota_exceeded until the next month or until you upgrade. Months are calendar months in UTC. If we ever charge for usage above the included units, we will announce it at least 30 days in advance, and it will not apply to usage before that date.

Demo without a key

The playground above, and the try-it panels on the product pages, call https://api.nutrientgraph.com/demo followed by an endpoint's path when no key is given, for example GET /demo/v1/food/groups. The demo answers the sample requests listed at GET /demo/samples (some samples allow a few other values) with the endpoint's real output, marked meta.demo: true and the X-Demo header. It is not counted against any quota and is limited per IP address (30 requests a minute, 200 a day); any other input answers 403 demo_not_allowed. Use your key for real work.

MCP for AI agents

POST JSON-RPC 2.0 to /mcp (Streamable HTTP, JSON responses) with your key in X-API-Key. Methods: initialize, tools/list, tools/call, ping. Each REST operation below is a read-only tool with the same input schema; results come back as structuredContent with the same envelope and the same metering. Tool list: mcp-tools.json.

  • food_search
  • food_autocomplete
  • food_get
  • food_get_many
  • food_groups
  • food_barcode
  • food_barcode_batch
  • food_nutrients_for_portion
  • food_analyze_ingredients
  • food_meal_match
  • food_recipe_calculate
  • food_cooking_yields
MCP client config
{
  "mcpServers": {
    "nutrientgraph": {
      "type": "http",
      "url": "https://api.nutrientgraph.com/mcp",
      "headers": { "X-API-Key": "YOUR_KEY" }
    }
  }
}

Endpoints by product

Every endpoint belongs to one product: Food Database API, Barcode API, Nutrition Analysis API, Meal Logging API. One key and one plan cover all of them.

Food Database API

Live

Find a food and get every nutrient with its source: search, autocomplete, details, portions. Product page.

GET /v1/food/autocomplete

Suggest food names as you type. Names only, for search-as-you-type: prefix matching in five languages, names starting with the text first, then the foods USDA's survey recipes use most, preferred records and shorter names; identical names once. Generic foods and dishes by default. Free (0 units); rate limits apply.

  • Costfree
  • MCP toolfood_autocomplete
Parameters of GET /v1/food/autocomplete
NameInTypeRequiredNotes
qquerystringyesWhat the user typed so far
langquerystring: en, fr, de, it, esno Default en.
typequerystring: generic, dish, branded, anynoDefault: generic foods and dishes
limitqueryintegerno Default 10.

Example

curlGET/v1/food/autocomplete
curl -s "https://api.nutrientgraph.com/v1/food/autocomplete?q=chick&lang=en&limit=8" \
  -H "X-API-Key: $API_KEY"
Response (200, real output of the API on the current data; long arrays trimmed)
Response 200
{
  "data": {
    "query": "chick",
    "lang": "en",
    "count": 8,
    "suggestions": [
      { "id": "fdc:2706437", "name": "Chicken curry", "type": "generic" },
      { "id": "fdc:169886", "name": "Chicken, meatless", "type": "generic" },
      "… 6 more"
    ],
    "ranking": "names starting with the text first, then shorter names (fewer words), then foods used most in USDA FNDDS 2021-2023 survey recipes, preferred records; identical names shown once",
    "note": "Names only, for search-as-you-type. Get values with GET /v1/food/foods/{id}."
  },
  "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": "…"
  }
}

GET /v1/food/foods/{id}

Get a food by id. All nutrients per 100 g (or per 100 ml for products labelled per ml) with per-value provenance (source dataset, record id, source nutrient id, retrieval date, method), names in five languages with how each was made, portions with gram weights and their sources, and flags. Dishes include their recipe, cooking-yield tier and the computation trail.

  • Cost1 unit
  • MCP toolfood_get
Parameters of GET /v1/food/foods/{id}
NameInTypeRequiredNotes
idpathstringyesfdc:<FDC id>, ciqual:<code>, gtin:<GTIN-14> or dish:<id>

Example

curlGET/v1/food/foods/{id}
curl -s "https://api.nutrientgraph.com/v1/food/foods/fdc%3A171477" \
  -H "X-API-Key: $API_KEY"
Response (200, real output of the API on the current data; long arrays trimmed)
Response 200
{
  "data": {
    "id": "fdc:171477",
    "type": "generic",
    "names": [
      {
        "lang": "en",
        "name": "Chicken, broilers or fryers, breast, meat only, cooked, roasted",
        "method": "source",
        "source": "fdc_sr_legacy"
      },
      {
        "lang": "de",
        "name": "Brat- oder Backhähnchen, Brust, nur Fleisch, gegart, gebraten",
        "method": "machine_translation",
        "translated_from": "en",
        "check_status": "confirmed",
        "model": "Claude Opus 5.5 (claude-opus-5-5)"
      },
      "… 3 more"
    ],
    "group": "poultry",
    "basis": "100 g",
    "nutrients": {
      "alcohol_g": 0,
      "calcium_mg": 15,
      "carbohydrate_g": 0,
      "cholesterol_mg": 85,
      "energy_kcal": 165,
      "energy_kj": 690,
      "fat_g": 3.57,
      "fiber_g": 0,
      "iron_mg": 1.04,
      "mufa_g": 1.24,
      "potassium_mg": 256,
      "protein_g": 31.02,
      "pufa_g": 0.77,
      "saturated_fat_g": 1.01,
      "sodium_mg": 74,
      "sugars_g": 0,
      "water_g": 65.26,
      "added_sugars_g": null,
      "trans_fat_g": null
    },
    "units": {
      "alcohol_g": "g",
      "calcium_mg": "mg",
      "carbohydrate_g": "g",
      "cholesterol_mg": "mg",
      "energy_kcal": "kcal",
      "energy_kj": "kJ",
      "fat_g": "g",
      "fiber_g": "g",
      "iron_mg": "mg",
      "mufa_g": "g",
      "potassium_mg": "mg",
      "protein_g": "g",
      "pufa_g": "g",
      "saturated_fat_g": "g",
      "sodium_mg": "mg",
      "sugars_g": "g",
      "water_g": "g",
      "added_sugars_g": "g",
      "trans_fat_g": "g"
    },
    "portions": [
      {
        "description": "1 cup, chopped or diced",
        "grams": 140,
        "source": "fdc_sr_legacy food_portion id=88817"
      },
      {
        "description": "1 unit (yield from 1 lb ready-to-cook chicken)",
        "grams": 52,
        "source": "fdc_sr_legacy food_portion id=88818"
      },
      "… 1 more"
    ],
    "primary_portion": {
      "description": "1 cup, chopped or diced",
      "grams": 140,
      "source": "fdc_sr_legacy food_portion id=88817"
    },
    "source": {
      "dataset": "fdc_sr_legacy",
      "name": "USDA FoodData Central - SR Legacy",
      "version": "2018-04",
      "record_id": "171477",
      "code": "5064",
      "code_type": "ndb_number",
      "url": "https://fdc.nal.usda.gov/food-details/171477/nutrients",
      "retrieved": "2026-10-10",
      "licence": "CC0 1.0 Universal (USDA FoodData Central)",
      "publication_date": "2019-04-01"
    },
    "mapping": {
      "type": "source",
      "sources": [
        { "dataset": "fdc_sr_legacy", "id": "171477" }
      ]
    },
    "description": {
      "name_en": "Chicken, broilers or fryers, breast, meat only, cooked, roasted",
      "base_name_en": "Chicken, broilers or fryers, breast, meat only",
      "source_category": "Poultry Products",
      "food_group_method": "SR food category map",
      "preparation_state": "cooked",
      "preparation_methods": ["roasted", "cooked"],
      "processing": []
    },
    "carb_definition": "by_difference_incl_fibre",
    "cluster": {
      "cluster_id": "fdc:171477",
      "is_preferred": true,
      "relation": "preferred",
      "note": "USDA crosswalk cluster: records of the same food from different USDA analyses; the preferred one is the catalogue entry"
    },
    "aliases": [],
    "missing": ["added_sugars_g", "trans_fat_g"],
    "flags": [],
    "warnings": [],
    "provenance": {
      "nutrients": {
        "alcohol_g": {
          "dataset": "fdc_sr_legacy",
          "id": "171477",
          "source_nutrient_id": "1018",
          "source_nutrient_name": "Alcohol, ethyl",
          "retrieved": "2026-10-10",
          "method": "copied from source"
        },
        "calcium_mg": {
          "dataset": "fdc_sr_legacy",
          "id": "171477",
          "source_nutrient_id": "1087",
          "source_nutrient_name": "Calcium, Ca",
          "retrieved": "2026-10-10",
          "method": "copied from source"
        },
        "carbohydrate_g": {
          "dataset": "fdc_sr_legacy",
          "id": "171477",
          "source_nutrient_id": "1005",
          "source_nutrient_name": "Carbohydrate, by difference",
          "retrieved": "2026-10-10",
          "method": "copied from source"
        },
        "cholesterol_mg": {
          "dataset": "fdc_sr_legacy",
          "id": "171477",
          "source_nutrient_id": "1253",
          "source_nutrient_name": "Cholesterol",
          "retrieved": "2026-10-10",
          "method": "copied from source"
        },
        "energy_kcal": {
          "dataset": "fdc_sr_legacy",
          "id": "171477",
          "source_nutrient_id": "1008",
          "source_nutrient_name": "Energy",
          "retrieved": "2026-10-10",
          "method": "copied from source"
        },
        "energy_kj": {
          "dataset": "fdc_sr_legacy",
          "id": "171477",
          "source_nutrient_id": "1062",
          "source_nutrient_name": "Energy",
          "retrieved": "2026-10-10",
          "method": "copied from source"
        },
        "fat_g": {
          "dataset": "fdc_sr_legacy",
          "id": "171477",
          "source_nutrient_id": "1004",
          "source_nutrient_name": "Total lipid (fat)",
          "retrieved": "2026-10-10",
          "method": "copied from source"
        },
        "fiber_g": {
          "dataset": "fdc_sr_legacy",
          "id": "171477",
          "source_nutrient_id": "1079",
          "source_nutrient_name": "Fiber, total dietary",
          "retrieved": "2026-10-10",
          "method": "copied from source"
        },
        "iron_mg": {
          "dataset": "fdc_sr_legacy",
          "id": "171477",
          "source_nutrient_id": "1089",
          "source_nutrient_name": "Iron, Fe",
          "retrieved": "2026-10-10",
          "method": "copied from source"
        },
        "mufa_g": {
          "dataset": "fdc_sr_legacy",
          "id": "171477",
          "source_nutrient_id": "1292",
          "source_nutrient_name": "Fatty acids, total monounsaturated",
          "retrieved": "2026-10-10",
          "method": "copied from source"
        },
        "potassium_mg": {
          "dataset": "fdc_sr_legacy",
          "id": "171477",
          "source_nutrient_id": "1092",
          "source_nutrient_name": "Potassium, K",
          "retrieved": "2026-10-10",
          "method": "copied from source"
        },
        "protein_g": {
          "dataset": "fdc_sr_legacy",
          "id": "171477",
          "source_nutrient_id": "1003",
          "source_nutrient_name": "Protein",
          "retrieved": "2026-10-10",
          "method": "copied from source"
        },
        "pufa_g": {
          "dataset": "fdc_sr_legacy",
          "id": "171477",
          "source_nutrient_id": "1293",
          "source_nutrient_name": "Fatty acids, total polyunsaturated",
          "retrieved": "2026-10-10",
          "method": "copied from source"
        },
        "saturated_fat_g": {
          "dataset": "fdc_sr_legacy",
          "id": "171477",
          "source_nutrient_id": "1258",
          "source_nutrient_name": "Fatty acids, total saturated",
          "retrieved": "2026-10-10",
          "method": "copied from source"
        },
        "sodium_mg": {
          "dataset": "fdc_sr_legacy",
          "id": "171477",
          "source_nutrient_id": "1093",
          "source_nutrient_name": "Sodium, Na",
          "retrieved": "2026-10-10",
          "method": "copied from source"
        },
        "sugars_g": {
          "dataset": "fdc_sr_legacy",
          "id": "171477",
          "source_nutrient_id": "2000",
          "source_nutrient_name": "Total Sugars",
          "retrieved": "2026-10-10",
          "method": "copied from source"
        },
        "water_g": {
          "dataset": "fdc_sr_legacy",
          "id": "171477",
          "source_nutrient_id": "1051",
          "source_nutrient_name": "Water",
          "retrieved": "2026-10-10",
          "method": "copied from source"
        }
      }
    }
  },
  "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": "…"
  }
}

GET /v1/food/foods

Get several foods by id. Up to 20 foods in one call (generic, branded or dish ids), each with every value and its provenance, as GET /v1/food/foods/{id} returns it. Ids that do not exist are listed in not_found.

  • Cost1 unit per 5 distinct ids (minimum 1)
  • MCP toolfood_get_many
Parameters of GET /v1/food/foods
NameInTypeRequiredNotes
idsquerystringyesComma-separated food ids, e.g. fdc:171477,ciqual:20034

Example

curlGET/v1/food/foods
curl -s "https://api.nutrientgraph.com/v1/food/foods?ids=fdc%3A171477%2Cciqual%3A20034%2Cdish%3AD0852" \
  -H "X-API-Key: $API_KEY"
Response (200, real output of the API on the current data; long arrays trimmed)
Response 200
{
  "data": {
    "count": 3,
    "foods": [
      {
        "id": "fdc:171477",
        "type": "generic",
        "names": [
          {
            "lang": "en",
            "name": "Chicken, broilers or fryers, breast, meat only, cooked, roasted",
            "method": "source",
            "source": "fdc_sr_legacy"
          },
          {
            "lang": "de",
            "name": "Brat- oder Backhähnchen, Brust, nur Fleisch, gegart, gebraten",
            "method": "machine_translation",
            "translated_from": "en",
            "check_status": "confirmed",
            "model": "Claude Opus 5.5 (claude-opus-5-5)"
          },
          "… 3 more"
        ],
        "group": "poultry",
        "basis": "100 g",
        "nutrients": {
          "alcohol_g": 0,
          "calcium_mg": 15,
          "carbohydrate_g": 0,
          "cholesterol_mg": 85,
          "energy_kcal": 165,
          "energy_kj": 690,
          "fat_g": 3.57,
          "fiber_g": 0,
          "…": "11 more fields"
        },
        "units": {
          "alcohol_g": "g",
          "calcium_mg": "mg",
          "carbohydrate_g": "g",
          "cholesterol_mg": "mg",
          "energy_kcal": "kcal",
          "energy_kj": "kJ",
          "fat_g": "g",
          "fiber_g": "g",
          "…": "11 more fields"
        },
        "portions": [
          {
            "description": "1 cup, chopped or diced",
            "grams": 140,
            "source": "fdc_sr_legacy food_portion id=88817"
          },
          {
            "description": "1 unit (yield from 1 lb ready-to-cook chicken)",
            "grams": 52,
            "source": "fdc_sr_legacy food_portion id=88818"
          },
          "… 1 more"
        ],
        "primary_portion": {
          "description": "1 cup, chopped or diced",
          "grams": 140,
          "source": "fdc_sr_legacy food_portion id=88817"
        },
        "source": {
          "dataset": "fdc_sr_legacy",
          "name": "USDA FoodData Central - SR Legacy",
          "version": "2018-04",
          "record_id": "171477",
          "code": "5064",
          "code_type": "ndb_number",
          "url": "https://fdc.nal.usda.gov/food-details/171477/nutrients",
          "retrieved": "2026-10-10",
          "…": "2 more fields"
        },
        "mapping": {
          "type": "source",
          "sources": [
            { "dataset": "fdc_sr_legacy", "id": "171477" }
          ]
        },
        "description": {
          "name_en": "Chicken, broilers or fryers, breast, meat only, cooked, roasted",
          "base_name_en": "Chicken, broilers or fryers, breast, meat only",
          "source_category": "Poultry Products",
          "food_group_method": "SR food category map",
          "preparation_state": "cooked",
          "preparation_methods": ["roasted", "cooked"],
          "processing": []
        },
        "carb_definition": "by_difference_incl_fibre",
        "cluster": {
          "cluster_id": "fdc:171477",
          "is_preferred": true,
          "relation": "preferred",
          "note": "USDA crosswalk cluster: records of the same food from different USDA analyses; the preferred one is the catalogue entry"
        },
        "aliases": [],
        "missing": ["added_sugars_g", "trans_fat_g"],
        "flags": [],
        "warnings": [],
        "provenance": {
          "nutrients": {
            "alcohol_g": {
              "dataset": "fdc_sr_legacy",
              "id": "171477",
              "source_nutrient_id": "1018",
              "source_nutrient_name": "Alcohol, ethyl",
              "retrieved": "2026-10-10",
              "method": "copied from source"
            },
            "calcium_mg": {
              "dataset": "fdc_sr_legacy",
              "id": "171477",
              "source_nutrient_id": "1087",
              "source_nutrient_name": "Calcium, Ca",
              "retrieved": "2026-10-10",
              "method": "copied from source"
            },
            "carbohydrate_g": {
              "dataset": "fdc_sr_legacy",
              "id": "171477",
              "source_nutrient_id": "1005",
              "source_nutrient_name": "Carbohydrate, by difference",
              "retrieved": "2026-10-10",
              "method": "copied from source"
            },
            "cholesterol_mg": {
              "dataset": "fdc_sr_legacy",
              "id": "171477",
              "source_nutrient_id": "1253",
              "source_nutrient_name": "Cholesterol",
              "retrieved": "2026-10-10",
              "method": "copied from source"
            },
            "energy_kcal": {
              "dataset": "fdc_sr_legacy",
              "id": "171477",
              "source_nutrient_id": "1008",
              "source_nutrient_name": "Energy",
              "retrieved": "2026-10-10",
              "method": "copied from source"
            },
            "energy_kj": {
              "dataset": "fdc_sr_legacy",
              "id": "171477",
              "source_nutrient_id": "1062",
              "source_nutrient_name": "Energy",
              "retrieved": "2026-10-10",
              "method": "copied from source"
            },
            "fat_g": {
              "dataset": "fdc_sr_legacy",
              "id": "171477",
              "source_nutrient_id": "1004",
              "source_nutrient_name": "Total lipid (fat)",
              "retrieved": "2026-10-10",
              "method": "copied from source"
            },
            "fiber_g": {
              "dataset": "fdc_sr_legacy",
              "id": "171477",
              "source_nutrient_id": "1079",
              "source_nutrient_name": "Fiber, total dietary",
              "retrieved": "2026-10-10",
              "method": "copied from source"
            },
            "…": "9 more fields"
          }
        }
      },
      {
        "id": "ciqual:20034",
        "type": "generic",
        "names": [
          {
            "lang": "en",
            "name": "Onion, raw",
            "method": "source",
            "source": "ciqual"
          },
          {
            "lang": "de",
            "name": "Zwiebel, roh",
            "method": "machine_translation",
            "translated_from": "fr",
            "check_status": "confirmed",
            "model": "Claude Opus 5.5 (claude-opus-5-5)"
          },
          "… 3 more"
        ],
        "group": "vegetables",
        "basis": "100 g",
        "nutrients": {
          "alcohol_g": 0,
          "calcium_mg": 25,
          "carbohydrate_g": 6.25,
          "cholesterol_mg": 0,
          "energy_kcal": 39,
          "energy_kj": 164,
          "fat_g": 0.62,
          "fiber_g": 1.7,
          "…": "12 more fields"
        },
        "units": {
          "alcohol_g": "g",
          "calcium_mg": "mg",
          "carbohydrate_g": "g",
          "cholesterol_mg": "mg",
          "energy_kcal": "kcal",
          "energy_kj": "kJ",
          "fat_g": "g",
          "fiber_g": "g",
          "…": "12 more fields"
        },
        "portions": [],
        "primary_portion": null,
        "source": {
          "dataset": "ciqual",
          "name": "ANSES-CIQUAL French food composition table 2025 (English edition)",
          "version": "2025 (file dated 2025-11-03)",
          "record_id": "20034",
          "code": "20034",
          "code_type": "ciqual_alim_code",
          "url": "https://ciqual.anses.fr/#/aliments/20034",
          "retrieved": "2026-10-10",
          "…": "2 more fields"
        },
        "mapping": {
          "type": "source",
          "sources": [
            { "dataset": "ciqual", "id": "20034" }
          ]
        },
        "description": {
          "name_en": "Onion, raw",
          "base_name_en": "Onion",
          "source_category": "fruits, vegetables, legumes and nuts / vegetables / vegetables, raw",
          "food_group_method": "CIQUAL subgroup map",
          "preparation_state": "raw",
          "preparation_methods": [],
          "processing": []
        },
        "carb_definition": "available_excl_fibre",
        "cluster": {
          "cluster_id": "ciqual:20034",
          "is_preferred": true,
          "relation": "preferred",
          "note": "USDA crosswalk cluster: records of the same food from different USDA analyses; the preferred one is the catalogue entry"
        },
        "aliases": [],
        "missing": ["added_sugars_g", "trans_fat_g"],
        "flags": [
          "portion_present: no portion with a gram (or ml) weight in the source"
        ],
        "warnings": [
          {
            "check_id": "portion_present",
            "message": "no portion with a gram (or ml) weight in the source"
          }
        ],
        "provenance": {
          "nutrients": {
            "alcohol_g": {
              "dataset": "ciqual",
              "id": "20034",
              "source_nutrient_id": "col:Alcohol",
              "source_nutrient_name": "Alcohol (g 100g)",
              "retrieved": "2026-10-10",
              "method": "copied from source"
            },
            "calcium_mg": {
              "dataset": "ciqual",
              "id": "20034",
              "source_nutrient_id": "col:Calcium",
              "source_nutrient_name": "Calcium (mg 100g)",
              "retrieved": "2026-10-10",
              "method": "copied from source"
            },
            "carbohydrate_g": {
              "dataset": "ciqual",
              "id": "20034",
              "source_nutrient_id": "col:Carbohydrate",
              "source_nutrient_name": "Carbohydrate (g 100g)",
              "retrieved": "2026-10-10",
              "method": "copied from source"
            },
            "cholesterol_mg": {
              "dataset": "ciqual",
              "id": "20034",
              "source_nutrient_id": "col:Cholesterol",
              "source_nutrient_name": "Cholesterol (mg 100g)",
              "retrieved": "2026-10-10",
              "method": "copied from source"
            },
            "energy_kcal": {
              "dataset": "ciqual",
              "id": "20034",
              "source_nutrient_id": "col:Energy, Regulation EU No 1169 2011",
              "source_nutrient_name": "Energy, Regulation EU No 1169 2011 (kcal 100g)",
              "retrieved": "2026-10-10",
              "method": "copied from source"
            },
            "energy_kj": {
              "dataset": "ciqual",
              "id": "20034",
              "source_nutrient_id": "col:Energy, Regulation EU No 1169 2011",
              "source_nutrient_name": "Energy, Regulation EU No 1169 2011 (kJ 100g)",
              "retrieved": "2026-10-10",
              "method": "copied from source"
            },
            "fat_g": {
              "dataset": "ciqual",
              "id": "20034",
              "source_nutrient_id": "col:Fat",
              "source_nutrient_name": "Fat (g 100g)",
              "retrieved": "2026-10-10",
              "method": "copied from source"
            },
            "fiber_g": {
              "dataset": "ciqual",
              "id": "20034",
              "source_nutrient_id": "col:Fibres",
              "source_nutrient_name": "Fibres (g 100g)",
              "retrieved": "2026-10-10",
              "method": "copied from source"
            },
            "…": "10 more fields"
          }
        }
      },
      "… 1 more"
    ],
    "not_found": []
  },
  "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": "…"
  }
}

GET /v1/food/foods/{id}/nutrients

Nutrients for a portion. Scales per-100 g values to a portion: give grams, or a portion (index or description from the food's portions) and a quantity. Missing values stay null. Products labelled per 100 ml are refused (density unknown).

  • Cost1 unit
  • MCP toolfood_nutrients_for_portion
Parameters of GET /v1/food/foods/{id}/nutrients
NameInTypeRequiredNotes
idpathstringyesfdc:<FDC id>, ciqual:<code>, gtin:<GTIN-14> or dish:<id>
gramsquerynumberno
portionquerystringnoPortion index (0-based) or description
quantityquerynumberno Default 1.

Example

curlGET/v1/food/foods/{id}/nutrients
curl -s "https://api.nutrientgraph.com/v1/food/foods/fdc%3A171477/nutrients?portion=0&quantity=1" \
  -H "X-API-Key: $API_KEY"
Response (200, real output of the API on the current data; long arrays trimmed)
Response 200
{
  "data": {
    "food_id": "fdc:171477",
    "name": "Chicken, broilers or fryers, breast, meat only, cooked, roasted",
    "basis": "100 g",
    "portion": {
      "description": "1 cup, chopped or diced",
      "grams": 140,
      "source": "fdc_sr_legacy food_portion id=88817"
    },
    "quantity": 1,
    "grams_total": 140,
    "nutrients": {
      "alcohol_g": { "value": 0, "unit": "g", "per_100g": 0 },
      "calcium_mg": { "value": 21, "unit": "mg", "per_100g": 15 },
      "carbohydrate_g": { "value": 0, "unit": "g", "per_100g": 0 },
      "cholesterol_mg": { "value": 119, "unit": "mg", "per_100g": 85 },
      "energy_kcal": { "value": 231, "unit": "kcal", "per_100g": 165 },
      "energy_kj": { "value": 966, "unit": "kJ", "per_100g": 690 },
      "fat_g": { "value": 4.998, "unit": "g", "per_100g": 3.57 },
      "fiber_g": { "value": 0, "unit": "g", "per_100g": 0 },
      "iron_mg": { "value": 1.456, "unit": "mg", "per_100g": 1.04 },
      "mufa_g": { "value": 1.736, "unit": "g", "per_100g": 1.24 },
      "potassium_mg": { "value": 358.4, "unit": "mg", "per_100g": 256 },
      "protein_g": { "value": 43.428, "unit": "g", "per_100g": 31.02 },
      "pufa_g": { "value": 1.078, "unit": "g", "per_100g": 0.77 },
      "saturated_fat_g": { "value": 1.414, "unit": "g", "per_100g": 1.01 },
      "sodium_mg": { "value": 103.6, "unit": "mg", "per_100g": 74 },
      "sugars_g": { "value": 0, "unit": "g", "per_100g": 0 },
      "water_g": { "value": 91.364, "unit": "g", "per_100g": 65.26 },
      "added_sugars_g": { "value": null, "unit": "g", "per_100g": null },
      "trans_fat_g": { "value": null, "unit": "g", "per_100g": null }
    },
    "missing": ["added_sugars_g", "trans_fat_g"],
    "method": "value = per-100 g source value x grams / 100 (code; missing values stay null)",
    "provenance": {
      "food": {
        "nutrients": {
          "alcohol_g": {
            "dataset": "fdc_sr_legacy",
            "id": "171477",
            "source_nutrient_id": "1018",
            "source_nutrient_name": "Alcohol, ethyl",
            "retrieved": "2026-10-10",
            "method": "copied from source"
          },
          "calcium_mg": {
            "dataset": "fdc_sr_legacy",
            "id": "171477",
            "source_nutrient_id": "1087",
            "source_nutrient_name": "Calcium, Ca",
            "retrieved": "2026-10-10",
            "method": "copied from source"
          },
          "carbohydrate_g": {
            "dataset": "fdc_sr_legacy",
            "id": "171477",
            "source_nutrient_id": "1005",
            "source_nutrient_name": "Carbohydrate, by difference",
            "retrieved": "2026-10-10",
            "method": "copied from source"
          },
          "cholesterol_mg": {
            "dataset": "fdc_sr_legacy",
            "id": "171477",
            "source_nutrient_id": "1253",
            "source_nutrient_name": "Cholesterol",
            "retrieved": "2026-10-10",
            "method": "copied from source"
          },
          "energy_kcal": {
            "dataset": "fdc_sr_legacy",
            "id": "171477",
            "source_nutrient_id": "1008",
            "source_nutrient_name": "Energy",
            "retrieved": "2026-10-10",
            "method": "copied from source"
          },
          "energy_kj": {
            "dataset": "fdc_sr_legacy",
            "id": "171477",
            "source_nutrient_id": "1062",
            "source_nutrient_name": "Energy",
            "retrieved": "2026-10-10",
            "method": "copied from source"
          },
          "fat_g": {
            "dataset": "fdc_sr_legacy",
            "id": "171477",
            "source_nutrient_id": "1004",
            "source_nutrient_name": "Total lipid (fat)",
            "retrieved": "2026-10-10",
            "method": "copied from source"
          },
          "fiber_g": {
            "dataset": "fdc_sr_legacy",
            "id": "171477",
            "source_nutrient_id": "1079",
            "source_nutrient_name": "Fiber, total dietary",
            "retrieved": "2026-10-10",
            "method": "copied from source"
          },
          "…": "9 more fields"
        }
      },
      "portion_source": "fdc_sr_legacy food_portion id=88817"
    }
  },
  "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": "…"
  }
}

GET /v1/food/groups

Food groups and preparation states. The unified food groups over USDA and CIQUAL records with their record counts, and the preparation states, for search filters and browse screens. Free (0 units).

  • Costfree
  • MCP toolfood_groups

Example

curlGET/v1/food/groups
curl -s "https://api.nutrientgraph.com/v1/food/groups" \
  -H "X-API-Key: $API_KEY"
Response (200, real output of the API on the current data; long arrays trimmed)
Response 200
{
  "data": {
    "count": 26,
    "groups": [
      {
        "id": "alcoholic_beverages",
        "label": "alcoholic beverages",
        "generic_records": 197,
        "catalogue_entries": 197
      },
      {
        "id": "baby_foods",
        "label": "baby foods",
        "generic_records": 490,
        "catalogue_entries": 490
      },
      "… 24 more"
    ],
    "states": ["raw", "cooked", "… 4 more"],
    "note": "Unified food groups over USDA and CIQUAL records (each record's food_group_method says how it was set). Use id as group=, and a state as state=, in GET /v1/food/search."
  },
  "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": "…"
  }
}

Barcode API

Live

Look up a packaged food by its barcode: label nutrition, ingredients and the USDA records behind it. Product page.

GET /v1/food/barcode/{gtin}

Look up a packaged product by barcode. GTIN-8, UPC-A (12), EAN-13 or GTIN-14. The check digit is validated and the code normalised to GTIN-14. Returns the product from USDA Branded Foods with the FDC records behind it.

  • Cost1 unit
  • MCP toolfood_barcode
Parameters of GET /v1/food/barcode/{gtin}
NameInTypeRequiredNotes
gtinpathstringyes

Example

curlGET/v1/food/barcode/{gtin}
curl -s "https://api.nutrientgraph.com/v1/food/barcode/016000228986" \
  -H "X-API-Key: $API_KEY"
Response (200, real output of the API on the current data; long arrays trimmed)
Response 200
{
  "data": {
    "gtin14": "00016000228986",
    "product": {
      "id": "gtin:00016000228986",
      "type": "branded",
      "names": [
        {
          "lang": "en",
          "name": "Dunkaroos Cinnamon Graham Cookie Vanilla Frosting 12 Count",
          "source": "fdc_branded description (as labelled)"
        }
      ],
      "group": "sweets_desserts",
      "gtin": "00016000228986",
      "gtin_published": "00016000228986",
      "gtin_derivation": "as published",
      "brand": "GENERAL MILLS SALES INC.",
      "brand_name": "DunkAroos",
      "subbrand_name": "",
      "market": "United States",
      "category": "Biscuits/Cookies",
      "ingredients": "Vanilla Frosting with Rainbow Chips: Sugar, High Fructose Corn Syrup, Palm Oil, Corn Starch, Water, Salt, Monoglycerides, Polysorbate 60, Nonfat Dry Milk, Whey Powder, Sodium Acid Pyrophosphate, Sodiu…",
      "basis": "100 g",
      "nutrients": {
        "energy_kcal": 429,
        "energy_kj": null,
        "protein_g": 2.38,
        "fat_g": 14.29,
        "carbohydrate_g": 71.43,
        "fiber_g": 2.4,
        "sugars_g": 45.24,
        "saturated_fat_g": 7.14,
        "sodium_mg": 357,
        "water_g": null,
        "alcohol_g": null,
        "added_sugars_g": 42.9,
        "trans_fat_g": 0,
        "mufa_g": null,
        "pufa_g": null,
        "cholesterol_mg": 0,
        "potassium_mg": 0,
        "calcium_mg": 0,
        "iron_mg": 1.19
      },
      "units": {
        "energy_kcal": "kcal",
        "energy_kj": "kJ",
        "protein_g": "g",
        "fat_g": "g",
        "carbohydrate_g": "g",
        "fiber_g": "g",
        "sugars_g": "g",
        "saturated_fat_g": "g",
        "sodium_mg": "mg",
        "water_g": "g",
        "alcohol_g": "g",
        "added_sugars_g": "g",
        "trans_fat_g": "g",
        "mufa_g": "g",
        "pufa_g": "g",
        "cholesterol_mg": "mg",
        "potassium_mg": "mg",
        "calcium_mg": "mg",
        "iron_mg": "mg"
      },
      "portions": [
        {
          "description": "1 serving (1 tray with frosting) = 42 GRM",
          "grams": 42,
          "source": "fdc_branded 2739214 label serving size"
        }
      ],
      "primary_portion": {
        "description": "1 serving (1 tray with frosting) = 42 GRM",
        "grams": 42,
        "source": "fdc_branded 2739214 label serving size"
      },
      "package_weight": "18 ONZ",
      "dates": {
        "available": "2025-07-24",
        "modified": "2025-06-20",
        "publication": "2025-07-24",
        "discontinued": ""
      },
      "source": {
        "dataset": "fdc_branded",
        "record_id": "2739214",
        "url": "https://fdc.nal.usda.gov/food-details/2739214/nutrients",
        "retrieved": "2026-10-10",
        "data_source": "GDSN",
        "selection": "top_ranked",
        "n_records": 2,
        "source_records": [
          {
            "fdc_id": "2739214",
            "rank": 1,
            "role": "canonical",
            "data_source": "GDSN",
            "available_date": "2025-07-24",
            "discontinued_date": "",
            "failed_checks": []
          },
          {
            "fdc_id": "2734636",
            "rank": 2,
            "role": "superseded",
            "data_source": "GDSN",
            "available_date": "2025-06-19",
            "discontinued_date": "",
            "failed_checks": []
          }
        ]
      },
      "mapping": {
        "type": "source",
        "sources": [
          { "dataset": "fdc_branded", "id": "2739214" }
        ]
      },
      "missing": ["energy_kj", "water_g", "… 3 more"],
      "flags": [],
      "provenance": {
        "nutrients": {
          "energy_kcal": {
            "dataset": "fdc_branded",
            "id": "2739214",
            "source_nutrient_id": "1008",
            "retrieved": "2026-10-10",
            "method": "copied from source (per 100 g or 100 ml as the label basis)"
          },
          "protein_g": {
            "dataset": "fdc_branded",
            "id": "2739214",
            "source_nutrient_id": "1003",
            "retrieved": "2026-10-10",
            "method": "copied from source (per 100 g or 100 ml as the label basis)"
          },
          "fat_g": {
            "dataset": "fdc_branded",
            "id": "2739214",
            "source_nutrient_id": "1004",
            "retrieved": "2026-10-10",
            "method": "copied from source (per 100 g or 100 ml as the label basis)"
          },
          "carbohydrate_g": {
            "dataset": "fdc_branded",
            "id": "2739214",
            "source_nutrient_id": "1005",
            "retrieved": "2026-10-10",
            "method": "copied from source (per 100 g or 100 ml as the label basis)"
          },
          "fiber_g": {
            "dataset": "fdc_branded",
            "id": "2739214",
            "source_nutrient_id": "1079",
            "retrieved": "2026-10-10",
            "method": "copied from source (per 100 g or 100 ml as the label basis)"
          },
          "sugars_g": {
            "dataset": "fdc_branded",
            "id": "2739214",
            "source_nutrient_id": "2000",
            "retrieved": "2026-10-10",
            "method": "copied from source (per 100 g or 100 ml as the label basis)"
          },
          "saturated_fat_g": {
            "dataset": "fdc_branded",
            "id": "2739214",
            "source_nutrient_id": "1258",
            "retrieved": "2026-10-10",
            "method": "copied from source (per 100 g or 100 ml as the label basis)"
          },
          "sodium_mg": {
            "dataset": "fdc_branded",
            "id": "2739214",
            "source_nutrient_id": "1093",
            "retrieved": "2026-10-10",
            "method": "copied from source (per 100 g or 100 ml as the label basis)"
          },
          "…": "6 more fields"
        }
      }
    }
  },
  "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": "…"
  }
}

POST /v1/food/barcode/batch

Look up many barcodes. Up to 100 barcodes in one call, for catalogue matching. Each code comes back found (with the product as GET /v1/food/barcode/{gtin} returns it), not_found or invalid (bad length or check digit). US packaged foods from USDA Branded Foods.

  • Cost1 unit per 5 codes (minimum 1)
  • MCP toolfood_barcode_batch
Request body of POST /v1/food/barcode/batch
NameTypeRequiredNotes
gtinsarrayyes

Example

curlPOST/v1/food/barcode/batch
curl -s "https://api.nutrientgraph.com/v1/food/barcode/batch" \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"gtins":["016000228986","011153074060","3017620422003"]}'
Response (200, real output of the API on the current data; long arrays trimmed)
Response 200
{
  "data": {
    "count": 3,
    "found": 2,
    "not_found": 1,
    "invalid": 0,
    "results": [
      {
        "input": "016000228986",
        "gtin14": "00016000228986",
        "status": "found",
        "product": {
          "id": "gtin:00016000228986",
          "type": "branded",
          "names": [
            {
              "lang": "en",
              "name": "Dunkaroos Cinnamon Graham Cookie Vanilla Frosting 12 Count",
              "source": "fdc_branded description (as labelled)"
            }
          ],
          "group": "sweets_desserts",
          "gtin": "00016000228986",
          "gtin_published": "00016000228986",
          "gtin_derivation": "as published",
          "brand": "GENERAL MILLS SALES INC.",
          "…": "17 more fields"
        }
      },
      {
        "input": "011153074060",
        "gtin14": "00011153074060",
        "status": "found",
        "product": {
          "id": "gtin:00011153074060",
          "type": "branded",
          "names": [
            {
              "lang": "en",
              "name": "GREEK YOGURT, PLAIN",
              "source": "fdc_branded description (as labelled)"
            }
          ],
          "group": "milk_yogurt_cream",
          "gtin": "00011153074060",
          "gtin_published": "011153074060",
          "gtin_derivation": "as published",
          "brand": "Foodtown, Inc.",
          "…": "17 more fields"
        }
      },
      "… 1 more"
    ],
    "coverage_note": "US packaged foods from USDA Branded Foods. Codes from other markets are often not found: the dataset has no European barcode source yet."
  },
  "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": "…"
  }
}

Nutrition Analysis API

Live

Turn a recipe or an ingredient list into nutrition per serving and per 100 g. Product page.

POST /v1/food/analyze

Analyse ingredient lines. Ingredient lines as people write them ("2 cups chopped onion", "1 can (400 g) chickpeas, drained") in, nutrition out: each line is split by rules into quantity, unit, size, food and preparation (parsed_by: rules; no model at query time), matched to a generic food by full-text search ranked by code, and weighed from exact unit definitions, a weight stated in the line or a USDA/CIQUAL portion of the matched food. Every line returns the food, grams and how they were found, a confidence, alternatives, nutrients and provenance; lines that cannot be read or weighed come back as such and stay out of the totals. A weight in brackets is the whole line's weight ("2 cups (250 g) flour"), or per container after a can, jar or package ("1 can (400 g)"); a bare count ("2 eggs") is weighed only from a source portion that is one whole item. A nutrient a matched record lacks is taken from a USDA crosswalk-linked record of the same food, as POST /v1/food/recipe does. Totals per recipe, per 100 g and per serving, as written (no cooking yield); recipe_request carries the matched ids and grams for POST /v1/food/recipe. One request runs at most 150 name searches; lines past that come back unparsed, with the reason.

  • Cost1 unit per 5 lines (minimum 1)
  • MCP toolfood_analyze_ingredients
Request body of POST /v1/food/analyze
NameTypeRequiredNotes
linesarrayyes
langstring: en, fr, de, it, esnoLanguage of the food names in the lines Default en.
servingsintegerno
titlestringno
alternativesintegerno Default 3.

Example

curlPOST/v1/food/analyze
curl -s "https://api.nutrientgraph.com/v1/food/analyze" \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Chickpea and onion stew","servings":4,"lines":["2 cups chopped onion","1 tbsp olive oil","3 cloves garlic, minced","1 can (400 g) chickpeas, drained","1 tsp ground cumin","salt to taste"]}'
Response (200, real output of the API on the current data; long arrays trimmed)
Response 200
{
  "data": {
    "title": "Chickpea and onion stew",
    "lang": "en",
    "complete": false,
    "excluded_lines": [5],
    "excluded_note": "Lines that are unparsed, unmatched or without a sourced weight are left out of the totals (listed here); nothing is guessed for them.",
    "totals": {
      "grams": 598.1,
      "nutrients": {
        "energy_kcal": { "value": 626.415, "unit": "kcal" },
        "protein_g": { "value": 22.3263, "unit": "g" },
        "fat_g": { "value": 21.83, "unit": "g" },
        "carbohydrate_g": { "value": 90.3559, "unit": "g" },
        "fiber_g": { "value": 22.0955, "unit": "g" },
        "sugars_g": { "value": 23.8506, "unit": "g" },
        "saturated_fat_g": { "value": 2.8888, "unit": "g" },
        "sodium_mg": { "value": 640.518, "unit": "mg" },
        "energy_kj": {
          "value": null,
          "unit": "kJ",
          "lower_bound": 2092.827,
          "missing_from": [1]
        },
        "water_g": { "value": 459.8019, "unit": "g" },
        "alcohol_g": { "value": 0, "unit": "g" },
        "added_sugars_g": {
          "value": null,
          "unit": "g",
          "lower_bound": 0,
          "missing_from": [0, 1, "… 3 more"]
        },
        "trans_fat_g": {
          "value": null,
          "unit": "g",
          "lower_bound": 0,
          "missing_from": [1, 4]
        },
        "mufa_g": { "value": 11.1508, "unit": "g" },
        "pufa_g": { "value": 3.9179, "unit": "g" },
        "cholesterol_mg": { "value": 0, "unit": "mg" },
        "potassium_mg": { "value": 859.758, "unit": "mg" },
        "calcium_mg": { "value": 223.431, "unit": "mg" },
        "iron_mg": { "value": 5.0041, "unit": "mg" }
      }
    },
    "per_100g": {
      "energy_kcal": 104.7342,
      "protein_g": 3.7329,
      "fat_g": 3.6499,
      "carbohydrate_g": 15.1072,
      "fiber_g": 3.6943,
      "sugars_g": 3.9877,
      "saturated_fat_g": 0.483,
      "sodium_mg": 107.0921,
      "energy_kj": null,
      "water_g": 76.8771,
      "alcohol_g": 0,
      "added_sugars_g": null,
      "trans_fat_g": null,
      "mufa_g": 1.8644,
      "pufa_g": 0.6551,
      "cholesterol_mg": 0,
      "potassium_mg": 143.7482,
      "calcium_mg": 37.3568,
      "iron_mg": 0.8367
    },
    "per_serving": {
      "servings": 4,
      "grams": 149.525,
      "nutrients": {
        "energy_kcal": 156.6038,
        "protein_g": 5.5816,
        "fat_g": 5.4575,
        "carbohydrate_g": 22.589,
        "fiber_g": 5.5239,
        "sugars_g": 5.9627,
        "saturated_fat_g": 0.7222,
        "sodium_mg": 160.1295,
        "energy_kj": null,
        "water_g": 114.9505,
        "alcohol_g": 0,
        "added_sugars_g": null,
        "trans_fat_g": null,
        "mufa_g": 2.7877,
        "pufa_g": 0.9795,
        "cholesterol_mg": 0,
        "potassium_mg": 214.9395,
        "calcium_mg": 55.8578,
        "iron_mg": 1.251
      }
    },
    "basis": "ingredients as written (raw or as sold): no cooking yield applied. For cooked values, send the matched ids and grams to POST /v1/food/recipe with a cited yield (recipe_request below).",
    "lines": [
      {
        "index": 0,
        "line": "2 cups chopped onion",
        "parsed": {
          "quantity": 2,
          "quantity_text": "2",
          "unit": "cup",
          "size": null,
          "food_text": "onion",
          "preparation": ["chopped"],
          "notes": [],
          "parsed_by": "rules"
        },
        "status": "ok",
        "food": {
          "id": "fdc:170000",
          "type": "generic",
          "name": "Onions, raw",
          "source": "fdc_sr_legacy",
          "state": "raw",
          "score": 9,
          "why": ["main word leads the name", "state raw", "… 2 more"]
        },
        "confidence": "medium",
        "grams": 320,
        "weight": {
          "method": "portion",
          "detail": "2 cup x 160 g per '1 cup, chopped' (source portion)",
          "portion": {
            "description": "1 cup, chopped",
            "grams": 160,
            "source": "fdc_sr_legacy food_portion id=85855"
          }
        },
        "alternatives": [
          {
            "id": "fdc:170005",
            "name": "Onions, spring or scallions (includes tops and bulb), raw",
            "source": "fdc_sr_legacy",
            "state": "raw",
            "score": 8.086
          },
          {
            "id": "fdc:2709795",
            "name": "Onions, raw",
            "source": "fdc_survey",
            "state": "raw",
            "score": 6.153
          },
          "… 1 more"
        ],
        "nutrients": {
          "energy_kcal": 128,
          "protein_g": 3.52,
          "fat_g": 0.32,
          "carbohydrate_g": 29.888,
          "fiber_g": 5.44,
          "sugars_g": 13.568,
          "saturated_fat_g": 0.1344,
          "sodium_mg": 12.8,
          "…": "11 more fields"
        },
        "provenance": {
          "source": {
            "dataset": "fdc_sr_legacy",
            "record_id": "170000",
            "url": "https://fdc.nal.usda.gov/food-details/170000/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" },
            "energy_kj": { "source_nutrient_id": "1062" },
            "fat_g": { "source_nutrient_id": "1004" },
            "fiber_g": { "source_nutrient_id": "1079" },
            "…": "10 more fields"
          },
          "method": "value = per-100 g source value x grams / 100 (code)"
        }
      },
      {
        "index": 1,
        "line": "1 tbsp olive oil",
        "parsed": {
          "quantity": 1,
          "quantity_text": "1",
          "unit": "tbsp",
          "size": null,
          "food_text": "olive oil",
          "preparation": [],
          "notes": [],
          "parsed_by": "rules"
        },
        "status": "ok",
        "food": {
          "id": "fdc:2710186",
          "type": "generic",
          "name": "Olive oil",
          "source": "fdc_survey",
          "state": "as_sold",
          "score": 7.999,
          "why": ["main word leads the name", "state as_sold", "… 2 more"]
        },
        "confidence": "high",
        "grams": 14,
        "weight": {
          "method": "portion",
          "detail": "1 tbsp x 14 g per '1 tablespoon' (source portion)",
          "portion": {
            "description": "1 tablespoon",
            "grams": 14,
            "source": "fdc_survey food_portion id=309586"
          }
        },
        "alternatives": [
          {
            "id": "fdc:748608",
            "name": "Oil, olive, extra virgin",
            "source": "fdc_foundation",
            "state": "as_sold",
            "score": 5.752
          },
          {
            "id": "fdc:171413",
            "name": "Oil, olive, salad or cooking",
            "source": "fdc_sr_legacy",
            "state": "as_sold",
            "score": 5.3
          },
          "… 1 more"
        ],
        "nutrients": {
          "energy_kcal": 126,
          "protein_g": 0,
          "fat_g": 14,
          "carbohydrate_g": 0,
          "fiber_g": 0,
          "sugars_g": 0,
          "saturated_fat_g": 2.1728,
          "sodium_mg": 0.28,
          "…": "11 more fields"
        },
        "provenance": {
          "source": {
            "dataset": "fdc_survey",
            "record_id": "2710186",
            "url": "https://fdc.nal.usda.gov/food-details/2710186/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)"
        }
      },
      "… 4 more"
    ],
    "recipe_request": {
      "name": "Chickpea and onion stew",
      "cooked": false,
      "servings": 4,
      "ingredients": [
        { "food": "fdc:170000", "grams": 320, "label": "2 cups chopped onion" },
        { "food": "fdc:2710186", "grams": 14, "label": "1 tbsp olive oil" },
        "… 3 more"
      ]
    },
    "method": "Each line: quantity, unit, size and food words split by rules (parsed_by: rules); food found by full-text search over names and ranked by code (main word, extra words, preparation state, source, porti…",
    "policy": {
      "missing_values": "a nutrient a food's 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; if none has it, or the source value …",
      "unparsed": "a line the rules cannot read, or whose weight has no source, is returned as such and left out of the totals"
    },
    "note": "Matches are ranked suggestions: check confidence and alternatives, and correct a food with its id (GET /v1/food/search) when needed. 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": "…"
  }
}

POST /v1/food/recipe

Calculate a recipe. Nutrients per 100 g as eaten (and per serving) of a recipe from ingredient foods and grams, with the food dataset's recipe engine (the code that computed its 150 dishes). Weight changes come only from cited sources you name: a cooked record of the same food (convert.to_cooked, by dry-matter balance), FNDDS moisture change, a USDA meat/poultry yield row, a verified AH-102 row, or an SR refuse portion; no yield is ever assumed (T6) and the result's tier says which kind was used. A nutrient missing for an ingredient is taken from a USDA crosswalk-linked record of the same food, else the result is null with a lower bound (never zero, T7). Nutrient numbers in the request are rejected.

  • Cost1 unit per 5 ingredients (minimum 1)
  • MCP toolfood_recipe_calculate
Request body of POST /v1/food/recipe
NameTypeRequiredNotes
namestringno
cookedbooleanyesfalse: no heat step (tier T0); true: cooked (T1-T3 from the references used)
servingsintegerno
ingredientsarrayyes
hydratearraynoBring a group of ingredients to the water content of a cooked record (e.g. a dough)
group_cookarraynoWeight change of a group of ingredients (e.g. a sauce reduced)
dish_cookobjectnoOne cited weight-change source (from GET /v1/food/cooking-yields): exactly one of fndds_moisture, meat_yield_row, ah102_item, evaporate_all_water
uncovered_heat_stepsarraynoHeat steps you know of that have no USDA yield (flags the result T3)
retention_codeintegerno

Example

curlPOST/v1/food/recipe
curl -s "https://api.nutrientgraph.com/v1/food/recipe" \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"scrambled eggs on buttered toast","cooked":true,"servings":1,"ingredients":[{"food":"fdc:748967","grams":100,"label":"egg, whole, raw (2 large)"},{"food":"fdc:171265","grams":30,"label":"whole milk"},{"food":"fdc:173410","grams":10,"label":"butter, salted"},{"food":"fdc:2707598","grams":60,"label":"white sandwich bread (2 slices), toasted","convert":{"to_cooked":"fdc:2707599"}},{"food":"fdc:173468","grams":1,"label":"table salt"}],"dish_cook":{"fndds_moisture":32130020,"match":"same_food"}}'
Response (200, real output of the API on the current data; long arrays trimmed)
Response 200
{
  "data": {
    "name": "scrambled eggs on buttered toast",
    "basis": "per 100 g as eaten (after the cooking steps given)",
    "per_100g": {
      "energy_kcal": { "value": 203.465, "unit": "kcal" },
      "protein_g": { "value": 9.758, "unit": "g" },
      "fat_g": { "value": 10.8371, "unit": "g" },
      "carbohydrate_g": { "value": 16.3231, "unit": "g" },
      "fiber_g": { "value": 0.6978, "unit": "g" },
      "sugars_g": { "value": 2.5184, "unit": "g" },
      "saturated_fat_g": { "value": 4.8, "unit": "g" },
      "sodium_mg": { "value": 441.7432, "unit": "mg" },
      "energy_kj": {
        "value": null,
        "unit": "kJ",
        "lower_bound": 507.7212,
        "missing_weight_share_pct": 29.85,
        "missing_from": [4]
      },
      "water_g": { "value": 61.2872, "unit": "g" },
      "alcohol_g": { "value": 0, "unit": "g" },
      "added_sugars_g": {
        "value": null,
        "unit": "g",
        "lower_bound": 0,
        "missing_weight_share_pct": 100,
        "missing_from": [1, 2, "… 3 more"]
      },
      "trans_fat_g": {
        "value": null,
        "unit": "g",
        "lower_bound": 0.2042,
        "missing_weight_share_pct": 29.85,
        "missing_from": [4]
      },
      "mufa_g": { "value": 3.275, "unit": "g" },
      "pufa_g": { "value": 1.6896, "unit": "g" },
      "cholesterol_mg": { "value": 222.6488, "unit": "mg" },
      "potassium_mg": { "value": 125.0071, "unit": "mg" },
      "calcium_mg": { "value": 107.9813, "unit": "mg" },
      "iron_mg": { "value": 1.8911, "unit": "mg" }
    },
    "per_serving": {
      "servings": 1,
      "grams": 195.6,
      "nutrients": {
        "energy_kcal": 397.9755,
        "protein_g": 19.0865,
        "fat_g": 21.1972,
        "carbohydrate_g": 31.9279,
        "fiber_g": 1.365,
        "sugars_g": 4.926,
        "saturated_fat_g": 9.3888,
        "sodium_mg": 864.0453,
        "energy_kj": null,
        "water_g": 119.8772,
        "alcohol_g": 0,
        "added_sugars_g": null,
        "trans_fat_g": null,
        "mufa_g": 6.4059,
        "pufa_g": 3.3048,
        "cholesterol_mg": 435.4989,
        "potassium_mg": 244.5127,
        "calcium_mg": 211.2103,
        "iron_mg": 3.699
      },
      "method": "per-100 g value x serving grams / 100, serving grams = final weight / servings (code)"
    },
    "weights": {
      "raw_g": 201,
      "after_ingredient_steps_g": 195.599,
      "final_g": 195.599,
      "dish_weight_change": "FNDDS 32130020 'Egg omelet or scrambled egg, made with butter' moisture change +0.0%: 195.6 g -> 195.6 g [code]"
    },
    "yield_tier": "T2_usda_yield",
    "flags": [],
    "carb_definition": "by_difference_incl_fibre",
    "ingredients": [
      {
        "seq": 1,
        "label": "egg, whole, raw (2 large)",
        "food": "fdc:748967",
        "food_id": "fdc:748967",
        "food_name": "Eggs, Grade A, Large, egg whole",
        "recipe_grams": 100,
        "grams_entered": 100,
        "weight_after_cooking_g": 100
      },
      {
        "seq": 2,
        "label": "whole milk",
        "food": "fdc:171265",
        "food_id": "fdc:171265",
        "food_name": "Milk, whole, 3.25% milkfat, with added vitamin D",
        "recipe_grams": 30,
        "grams_entered": 30,
        "weight_after_cooking_g": 30
      },
      "… 3 more"
    ],
    "nutrient_provenance": {
      "energy_kcal": {},
      "protein_g": {},
      "fat_g": {},
      "carbohydrate_g": {},
      "fiber_g": {},
      "sugars_g": {},
      "saturated_fat_g": {},
      "sodium_mg": {},
      "energy_kj": {
        "missing_from": [4],
        "rule": "not computed: a value is missing for ingredient(s) [4] and no linked record has it (never counted as zero)",
        "lower_bound": 507.7212,
        "lower_bound_rule": "sum of the known ingredient contributions per 100 g (nutrients are never negative, so the true value is at least this)",
        "missing_weight_share_pct": 29.85
      },
      "water_g": {},
      "alcohol_g": {
        "filled": [
          {
            "ingredient": 1,
            "source": "fdc_sr_legacy:171287",
            "filled_from": "fdc:171287",
            "rule": "missing in fdc:748967; value of USDA crosswalk-linked record fdc:171287 (same food)"
          }
        ]
      },
      "added_sugars_g": {
        "missing_from": [1, 2, "… 3 more"],
        "rule": "not computed: a value is missing for ingredient(s) [1, 2, 3, 4, 5] and no linked record has it (never counted as zero)",
        "lower_bound": 0,
        "lower_bound_rule": "sum of the known ingredient contributions per 100 g (nutrients are never negative, so the true value is at least this)",
        "missing_weight_share_pct": 100
      },
      "trans_fat_g": {
        "missing_from": [4],
        "rule": "not computed: a value is missing for ingredient(s) [4] and no linked record has it (never counted as zero)",
        "lower_bound": 0.2042,
        "lower_bound_rule": "sum of the known ingredient contributions per 100 g (nutrients are never negative, so the true value is at least this)",
        "missing_weight_share_pct": 29.85,
        "filled": [
          {
            "ingredient": 1,
            "source": "fdc_sr_legacy:171287",
            "filled_from": "fdc:171287",
            "rule": "missing in fdc:748967; value of USDA crosswalk-linked record fdc:171287 (same food)"
          },
          {
            "ingredient": 2,
            "source": "fdc_foundation:746782",
            "filled_from": "fdc:746782",
            "rule": "missing in fdc:171265; value of USDA crosswalk-linked record fdc:746782 (same food)"
          }
        ]
      },
      "mufa_g": {},
      "pufa_g": {},
      "cholesterol_mg": {},
      "potassium_mg": {},
      "calcium_mg": {},
      "iron_mg": {}
    },
    "yield_references": [
      { "kind": "to_cooked", "match": "same_food" },
      { "kind": "fndds", "match": "same_food" }
    ],
    "method": "USDA recipe method: ingredient source values x grams / 100, weight changes only from cited yield sources, divided by the final weight (code; port of datasets/food/pipeline/recipe_engine.py)",
    "policy": {
      "missing_values": "never zero (T7): filled from a USDA crosswalk-linked record of the same food if one reports it (flagged), else null with a lower bound",
      "censored_values": "CIQUAL '< x' uses the middle bound x/2 (flagged)",
      "cooking_yield": "never assumed (T6): tier T0 not cooked, T1 cooked records, T2 USDA yields, T3 estimated (flagged)"
    },
    "note": "Values are estimates for the recipe as written; T3 (estimated yield) results carry larger uncertainty. 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": "…"
  }
}

GET /v1/food/cooking-yields

Find cooking-yield references. Rows of the USDA Table of Cooking Yields for Meat and Poultry, verified rows of USDA Agriculture Handbook 102 and FNDDS recipe moisture changes, each with the `reference` to use in a recipe.

  • Cost1 unit
  • MCP toolfood_cooking_yields
Parameters of GET /v1/food/cooking-yields
NameInTypeRequiredNotes
qquerystringno
sourcequerystring: meat, ah102, fnddsno
limitqueryintegerno Default 25.

Example

curlGET/v1/food/cooking-yields
curl -s "https://api.nutrientgraph.com/v1/food/cooking-yields?q=ground+beef&source=meat&limit=3" \
  -H "X-API-Key: $API_KEY"
Response (200, real output of the API on the current data; long arrays trimmed)
Response 200
{
  "data": {
    "count": 3,
    "rows": [
      {
        "source": "cooking_yields_meat",
        "reference": { "meat_yield_row": 23 },
        "rowno": 23,
        "food_group": "13",
        "ndb": 13494,
        "description": "Beef, ground, high fat (>22%), crumbles",
        "method": "Fried in pan, Sauteed, or Stir-fried",
        "yield_pct": 62,
        "n": 4,
        "sd": 1.6,
        "moisture_change_pct": -25,
        "fat_change_pct": -12.6,
        "year": 2003
      },
      {
        "source": "cooking_yields_meat",
        "reference": { "meat_yield_row": 24 },
        "rowno": 24,
        "food_group": "13",
        "ndb": 13495,
        "description": "Beef, ground, high fat (>22%), loaf",
        "method": "Baked or Roasted, unspecified",
        "yield_pct": 63,
        "n": 4,
        "sd": 0.9,
        "moisture_change_pct": -22.5,
        "fat_change_pct": -12.9,
        "year": 2003
      },
      "… 1 more"
    ],
    "usage": "Use `reference` as cook (or convert.yield / dish_cook) in POST /v1/food/recipe. Meat rows: add fat: 'drained' only when the method drains the fat."
  },
  "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": "…"
  }
}

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. Product page.

POST /v1/food/meal/match

Match a meal to sourced foods. Grounding for photo and assistant apps: send what your vision model or LLM recognised (a label with grams, or a quantity and unit), a barcode or a food id, per item; get the best sourced record (dishes and USDA FNDDS foods as eaten first), alternatives, the weight used and how it was found (your grams, a source portion, or USDA's default amount), nutrients per item and in total, with provenance. For a barcode, a mass unit (g, oz, lb) is a weight and 'serving' (or no unit) is the label serving; other units have no weight on a label. Deterministic search and ranking: no model runs here.

  • Cost1 unit per item
  • MCP toolfood_meal_match
Request body of POST /v1/food/meal/match
NameTypeRequiredNotes
itemsarrayyes
langstring: en, fr, de, it, esno Default en.
alternativesintegerno Default 3.

Example

curlPOST/v1/food/meal/match
curl -s "https://api.nutrientgraph.com/v1/food/meal/match" \
  -H "X-API-Key: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"items":[{"label":"spaghetti bolognese","grams":350},{"label":"caesar salad","grams":150},{"label":"banana"}]}'
Response (200, real output of the API on the current data; long arrays trimmed)
Response 200
{
  "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": "…"
  }
}