Skip to main content

Ingredients

One endpoint returns an ingredient by its ID.

Get one ingredient​

GET /ingredients/{id}

Returns one ingredient with its serving, allergens, and nutrients. An ingredient that cannot be read returns 404 with the message Ingredient not found.

Example request​

curl -H "Authorization: Bearer <API_KEY>" \
"https://dev.nutritionistpro.com/v3/customer/ingredients/2000101"

Example response​

The nutrients list is shortened here.

{
"status": true,
"code": 200,
"data": {
"id": 2000101,
"name": "House flour blend",
"code": "FLR-02",
"source_code": null,
"source_code_type": null,
"source": "own",
"type": "ingredient",
"serving": {
"amount": 100.0,
"unit": "gram(s)",
"gram_weight": 100.0,
"note": null
},
"allergens": [{ "id": 3, "name": "Wheat" }],
"nutrient_basis": "per_serving",
"nutrients": [
{ "id": 121, "name": "Weight", "abbreviation": "Wt", "unit": "gram(s)", "value": 100.0 },
{ "id": 1, "name": "Kilocalories", "abbreviation": "Kcal", "unit": "kilocalorie(s)", "value": 364.0 },
{ "id": 2, "name": "Protein", "abbreviation": "Protein", "unit": "gram(s)", "value": 10.33 }
],
"creator": { "id": 4210, "name": "Test User" },
"account": { "id": 518, "name": "Test Account" },
"created_at": "2026-01-09T12:00:00Z",
"updated_at": "2026-01-09T12:04:51Z"
}
}

Ingredient fields​

  • id. The ingredient ID.
  • name. The ingredient name.
  • code. The ingredient's unique code, or null.
  • source_code. The code the ingredient carries from the database it came from: the eight-digit USDA Food and Nutrient Database for Dietary Studies (FNDDS) food code, the USDA Standard Reference NDB number, or the Canadian Nutrient File (CNF) code. Always a string, with any leading zeros kept. null for an ingredient without one, which includes most ingredients created on your account.
  • source_code_type. Which database source_code belongs to: fndds, usda_ndb, cnf, or other. null when source_code is null. Use it with source_code to match recipe ingredients to a 24-hour recall or another data set keyed by FNDDS or NDB codes.
  • source. own for an ingredient created on your account, or axxya for one from the Axxya database.
  • type. ingredient, or recipe when the ingredient is a recipe used as a sub-recipe.
  • serving. The typical serving: amount, unit, gram_weight, and note.
  • allergens. A list of id and name pairs.
  • nutrient_basis. Always per_serving.
  • nutrients. See Nutrients.
  • creator, account, created_at, and updated_at. Returned for your own ingredients only.

The API has no endpoint that lists or searches ingredients. Requests to /ingredients without an ID return 404.

Ingredient IDs come from the ingredient_id of each ingredient line in a recipe. To read the ingredients behind a recipe:

  1. Read the recipe with Get one recipe, or list recipes with view=full.
  2. Take the ingredient_id of each line in ingredients.
  3. Request /ingredients/{id} for each one.

Axxya database ingredients​

The Axxya ingredient database is licensed content, so it cannot be listed or read freely through the API.

An Axxya database ingredient can be read when it is used as an ingredient in a recipe you can see in Nutritionist Pro. Until then its ID returns 404. This lets you read the nutrients behind your own recipes.

The response for an Axxya database ingredient has "source": "axxya" and leaves out creator, account, created_at, and updated_at:

{
"status": true,
"code": 200,
"data": {
"id": 9012,
"name": "Bananas, raw",
"code": "09040",
"source_code": "09040",
"source_code_type": "usda_ndb",
"source": "axxya",
"type": "ingredient",
"serving": {
"amount": 1.0,
"unit": "item(s)",
"gram_weight": 118.0,
"note": null
},
"allergens": [],
"nutrient_basis": "per_serving",
"nutrients": [
{ "id": 121, "name": "Weight", "abbreviation": "Wt", "unit": "gram(s)", "value": 118.0 },
{ "id": 1, "name": "Kilocalories", "abbreviation": "Kcal", "unit": "kilocalorie(s)", "value": 105.02 }
]
}
}

Your own ingredients​

An ingredient created on your account can be read directly by its ID, whether or not a recipe uses it.

An ingredient of yours that is still in Draft status can be read only when one of your recipes uses it. This covers placeholder ingredients created by a recipe import.