Nutrition sources, with their nutrient values. A material product points at one through material.food_id.
idintegeris_globalbooleanTrue for a NutraSoft-supplied reference food shared by every account, which you can read but not change.
namestringnullablename_frstringnullablenutrientsarray of objectsnullableNutrient values, on GET /foods/{food_id} only: null elsewhere means not loaded, while an empty array means none.
nutrientslabelstringnullablenamestringnullablenutrient_idintegeruomstringnullableThe unit value is expressed in.
valuenumbernullablesourcestringnullableWhere the nutrition data came from, e.g. a reference database.
suggested_yield_descriptionstringnullablesuggested_yield_pctnumbernullable/foodscatalog:readNutrition sources, yours plus the NutraSoft reference set, marked is_global. nutrients is null here: retrieve a food for its values.
searchstringnullableFree-text match on id, name or French name.
sortstringnullableComma-separated field:direction pairs, e.g. id:desc. Sortable: id, name, name_fr. id is always added last, so paging is stable.
limitintegerRows to return. Maximum 200.
offsetintegerRows to skip. Maximum 10000: to read further, narrow the filters or page with updated_since.
data, with pagination.curl "https://public-api.nutrasoft.ca/v1/foods?limit=50" \
-H "Authorization: Bearer $NUTRASOFT_API_KEY"{
"data": [
{
"id": 123,
"is_global": false,
"name": "Sample name",
"name_fr": "string",
"nutrients": [
{
"label": "string",
"name": "Sample name",
"nutrient_id": 123,
"uom": "string",
"value": 12.5
}
],
"source": "string",
"suggested_yield_description": "string",
"suggested_yield_pct": 12.5
}
],
"pagination": {
"limit": 50,
"offset": 0,
"total": 1,
"has_more": false
},
"order": "id:asc"
}/foods/{food_id}catalog:readIncludes the food's nutrient values.
food_idintegerrequiredThe food's id.
data.curl "https://public-api.nutrasoft.ca/v1/foods/123" \
-H "Authorization: Bearer $NUTRASOFT_API_KEY"{
"data": {
"id": 123,
"is_global": false,
"name": "Sample name",
"name_fr": "string",
"nutrients": [
{
"label": "string",
"name": "Sample name",
"nutrient_id": 123,
"uom": "string",
"value": 12.5
}
],
"source": "string",
"suggested_yield_description": "string",
"suggested_yield_pct": 12.5
}
}/foodscatalog:writeCreates a nutrition source with no nutrient values: they cannot be written in v1. Not idempotent: a retry creates a second food.
namestringrequiredEnglish name.
name_frstringrequiredFrench name.
sourcestringnullableWhere the nutrition data came from, e.g. a reference database.
suggested_yield_descriptionstringnullablesuggested_yield_pctnumberPercentage of the raw weight left after preparation.
data.curl -X POST "https://public-api.nutrasoft.ca/v1/foods" \
-H "Authorization: Bearer $NUTRASOFT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Sample name",
"name_fr": "string"
}'{
"data": {
"id": 123,
"is_global": false,
"name": "Sample name",
"name_fr": "string",
"nutrients": [
{
"label": "string",
"name": "Sample name",
"nutrient_id": 123,
"uom": "string",
"value": 12.5
}
],
"source": "string",
"suggested_yield_description": "string",
"suggested_yield_pct": 12.5
}
}/foods/{food_id}catalog:writeOmitted fields and nutrient values are left unchanged. Shared reference foods are read-only (403).
food_idintegerrequiredThe food's id.
namestringnullablename_frstringnullablesourcestringnullablesuggested_yield_descriptionstringnullablesuggested_yield_pctnumbernullabledata.curl -X PATCH "https://public-api.nutrasoft.ca/v1/foods/123" \
-H "Authorization: Bearer $NUTRASOFT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Sample name"
}'{
"data": {
"id": 123,
"is_global": false,
"name": "Sample name",
"name_fr": "string",
"nutrients": [
{
"label": "string",
"name": "Sample name",
"nutrient_id": 123,
"uom": "string",
"value": 12.5
}
],
"source": "string",
"suggested_yield_description": "string",
"suggested_yield_pct": 12.5
}
}/foods/{food_id}catalog:writeDeletes one of your foods and its nutrient values. Refused with 409 while a product uses it as its nutrition source.
food_idintegerrequiredThe food's id.
data.curl -X DELETE "https://public-api.nutrasoft.ca/v1/foods/123" \
-H "Authorization: Bearer $NUTRASOFT_API_KEY"{
"data": {
"id": 123,
"is_global": false,
"name": "Sample name",
"name_fr": "string",
"nutrients": [
{
"label": "string",
"name": "Sample name",
"nutrient_id": 123,
"uom": "string",
"value": 12.5
}
],
"source": "string",
"suggested_yield_description": "string",
"suggested_yield_pct": 12.5
}
}