Get food compatibility

Compute nutritional compatibility live for a single food, addressed by the (source, id) pair returned by the search endpoint. Decode flagId and outcomeId through the Definitions endpoints. What can be asserted depends on the catalog: a generic food is only a name, so it answers for diet and allergen flags and never for label claims such as organic or halal. A packaged product is analysed from its label and answers for those too. Italian only: answers 406 for any other Accept-Language.

GET
/foods/{source}/{id}/compatibility
Foods
Cost: 60 credits

Response

200
application/json
object

FoodCompatibilityResult

Nutritional compatibility of a single food, computed live

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"

compatibility

object[]

AnalysisResultItem

Single nutritional compatibility result for one lifestyle flag - contains flag and outcome identifiers that can be decoded using the 'Definitions' endpoints to obtain localized descriptions

object

flagId

Lifestyle flag identifier (e.g., vegetarian, vegan, gluten-free) - see 'Definitions' endpoints to decode this ID and get localized descriptions

integer<int16>

outcomeId?

Outcome type identifier indicating the compatibility result - see 'Definitions' endpoints to decode this ID and get localized descriptions. Null when no outcome is determined

integer<uint8> | 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