Get food compatibility

实时计算单个食物的营养兼容性,使用搜索接口返回的(source,id)组合定位。通过 Definitions 接口解码 flagId 和 outcomeId。 可断言的内容取决于目录:通用食物只有名称,因此只能针对饮食和过敏原标记返回结果,不能针对有机或清真等标签声明返回结果。包装商品则根据其标签进行分析,也能针对这些声明返回结果。 仅支持意大利语:对于任何其他 Accept-Language,都会返回 406。

GET
/foods/{source}/{id}/compatibility
Foods
费用:60 积分

响应

200
application/json
object

FoodCompatibilityResult

实时计算的单种食物营养兼容性

object

id

其自身目录中的标识符

integer<int64>

source

食物所属的目录。“generic”表示来自 Tuduu 食物数据库的食物:没有品牌、没有包装规格、营养素按每 100 g 计算,通常日志条目指的就是这类食物。“packaged”表示来自 Tuduu 主目录的产品,包含品牌、包装规格以及标签上声明的营养素。两个目录使用彼此独立的标识符空间,因此必须通过 (source, id) 这一对值定位食物,不能只使用 id

string
"generic""packaged"

compatibility

object[]

AnalysisResultItem

单个生活方式标志的营养兼容性结果 - 包含可通过“Definitions”端点解码的标志和结果标识符,以获取本地化描述

object

flagId

生活方式标志标识符(例如 vegetarian、vegan、gluten-free)- 请参阅“Definitions”端点以解码此 ID 并获取本地化描述

integer<int16>

outcomeId?

表示兼容性结果的结果类型标识符 - 请参阅“Definitions”端点以解码此 ID 并获取本地化描述。未确定结果时为 Null

integer<uint8> | null
401
application/json
object

未授权

ConnectProblemDetails

object

type?

string

title?

string

status?

integer<int32>

detail?

string

instance?

string

requestId?

string

traceId?

string
403
application/json
object

禁止访问

ConnectProblemDetails

object

type?

string

title?

string

status?

integer<int32>

detail?

string

instance?

string

requestId?

string

traceId?

string
404
application/json
object

未找到

ConnectProblemDetails

object

type?

string

title?

string

status?

integer<int32>

detail?

string

instance?

string

requestId?

string

traceId?

string
406
application/json
object

不可接受

ConnectProblemDetails

object

type?

string

title?

string

status?

integer<int32>

detail?

string

instance?

string

requestId?

string

traceId?

string
422
application/json
object

无法处理的实体

ConnectProblemDetails

object

type?

string

title?

string

status?

integer<int32>

detail?

string

instance?

string

requestId?

string

traceId?

string
429
application/json
object

请求过多(APIM)

ConnectProblemDetails

object

type?

string

title?

string

status?

integer<int32>

detail?

string

instance?

string

requestId?

string

traceId?

string
500
application/json
object

内部服务器错误

ConnectProblemDetails

object

type?

string

title?

string

status?

integer<int32>

detail?

string

instance?

string

requestId?

string

traceId?

string
502
application/json
object

网关错误(APIM)

ConnectProblemDetails

object

type?

string

title?

string

status?

integer<int32>

detail?

string

instance?

string

requestId?

string

traceId?

string
504
application/json
object

网关超时(APIM)

ConnectProblemDetails

object

type?

string

title?

string

status?

integer<int32>

detail?

string

instance?

string

requestId?

string

traceId?

string