Get food macronutrients and portion

Retrieve macronutrients per 100 g and the portion of a single food, addressed by the (source, id) pair returned by the search endpoint. Use it to redisplay a food already stored in a diary without searching for it again. Italian only: answers 406 for any other Accept-Language.

GET
/foods/{source}/{id}/macronutrients
Foods
Cost: 10 credits

Response

200
application/json
object

FoodMacronutrientsResult

Macronutrients and portion of a single food

object

id

Identifier within its own catalog

integer<int64>

source

Which catalog a food comes from. 'generic' is a food from the Tuduu food database: no brand, no pack, nutrients per 100 g, and it is what a diary entry usually refers to. 'packaged' is a product from the Tuduu master catalog, with brand, pack format and the nutrients declared on the label. The two catalogs have independent identifier spaces, so a food is addressed by the pair (source, id) and never by the id alone

string
"generic""packaged"

portion?

object

All of

Variant 1

One portion of the food. Null when neither a weight nor a label description is known

object

grams?

Portion weight in grams. Null when it is not known, or when the label describes the portion without a weight ('1 jar'). Never inferred from the pack size

number<double> | null

label?

Portion exactly as printed on the label ('30 g', '1 jar'). Null for generic foods, which have no label

string | null

isDeclared

True when Grams comes from a numeric field, false when it was extracted from the free-text label. Read it before using Grams in a calculation: a false here means the number is our reading of the label, not a value declared as a number

boolean

macronutrients

Macronutrients per 100 g of food

object

kcal?

Kilocalories

number<double> | null

fat?

Total fat (g)

number<double> | null

saturatedFat?

Saturated fat (g)

number<double> | null

carbohydrates?

Carbohydrates (g)

number<double> | null

sugars?

Sugars (g)

number<double> | null

protein?

Protein (g)

number<double> | null

salt?

Salt (g)

number<double> | null

fiber?

Dietary fibre (g)

number<double> | null
401
application/json
object

Unauthorized

ConnectProblemDetails

object

type?

string

title?

string

status?

integer<int32>

detail?

string

instance?

string

requestId?

string

traceId?

string
403
application/json
object

Forbidden

ConnectProblemDetails

object

type?

string

title?

string

status?

integer<int32>

detail?

string

instance?

string

requestId?

string

traceId?

string
404
application/json
object

Not Found

ConnectProblemDetails

object

type?

string

title?

string

status?

integer<int32>

detail?

string

instance?

string

requestId?

string

traceId?

string
406
application/json
object

Not Acceptable

ConnectProblemDetails

object

type?

string

title?

string

status?

integer<int32>

detail?

string

instance?

string

requestId?

string

traceId?

string
422
application/json
object

Unprocessable Entity

ConnectProblemDetails

object

type?

string

title?

string

status?

integer<int32>

detail?

string

instance?

string

requestId?

string

traceId?

string
429
application/json
object

Too Many Requests (APIM)

ConnectProblemDetails

object

type?

string

title?

string

status?

integer<int32>

detail?

string

instance?

string

requestId?

string

traceId?

string
500
application/json
object

Internal Server Error

ConnectProblemDetails

object

type?

string

title?

string

status?

integer<int32>

detail?

string

instance?

string

requestId?

string

traceId?

string
502
application/json
object

Bad Gateway (APIM)

ConnectProblemDetails

object

type?

string

title?

string

status?

integer<int32>

detail?

string

instance?

string

requestId?

string

traceId?

string
504
application/json
object

Gateway Timeout (APIM)

ConnectProblemDetails

object

type?

string

title?

string

status?

integer<int32>

detail?

string

instance?

string

requestId?

string

traceId?

string