{
"input": "2 (14.5 oz) cans diced tomatoes, drained",
"kind": "ingredient",
"amount": 2,
"amountMax": null,
"approximate": false,
"unit": "can",
"unitText": "cans",
"size": {
"amount": 14.5,
"unit": "oz"
},
"item": "diced tomatoes",
"prep": "drained",
"notes": null,
"optional": false,
"key": "diced tomato",
"label": "diced tomatoes (canned)",
"known": true,
"alternatives": [],
"includes": [],
"aisle": "pantry",
"confidence": 1,
"unparsed": null,
"allergenFlags": []
}
curl --location --request GET 'https://zylalabs.com/api/14910/recipe+ingredient+parser+api/38816/parse+one+ingredient+line?line=2 (14.5 oz) cans diced tomatoes, drained' --header 'Authorization: Bearer YOUR_API_KEY'
{
"to": "cup",
"item": "sugar",
"key": "sugar",
"from": {
"amount": 250,
"amountMax": null,
"unit": "g"
},
"kind": "ingredient",
"converted": true,
"amount": 1.25,
"amountMax": null,
"unit": "cup",
"exactAmount": 1.25,
"exactAmountMax": null,
"density": {
"gramsPerCup": 200,
"basis": "granulated",
"approximate": true
},
"text": "1 ¼ cups sugar"
}
curl --location --request GET 'https://zylalabs.com/api/14910/recipe+ingredient+parser+api/38817/us+-+metric+for+one+line+or+one+quantity?amount=250&unit=g&item=sugar&to=cup&prefer=same&spoons=keep&rounding=kitchen' --header 'Authorization: Bearer YOUR_API_KEY'
{
"text": "1½ cups finely chopped onions",
"parts": {
"quantity": "1½",
"unit": "cups",
"item": "onions",
"prep": "finely chopped",
"prepPosition": "before",
"notes": null,
"optional": false
},
"amount": 1.5,
"amountMax": null,
"unit": "cup",
"key": "onion",
"aisle": "produce",
"options": {
"system": "keep",
"fractions": "unicode",
"units": "short",
"prepPosition": "auto",
"spelling": "us"
},
"note": "prepPosition \"auto\" puts cutting words (chopped, minced, diced, sliced...) before a measured item (\"1 cup chopped onions\") and everything else after a comma (\"1 cup flour, sifted\" keeps its meaning; \"2 cloves garlic, minced\"); set prepPosition to choose."
}
curl --location --request GET 'https://zylalabs.com/api/14910/recipe+ingredient+parser+api/38818/structured+fields+in+a+natural+ingredient+line+out?amount=1 1/2&unit=cups&item=onions&prep=finely chopped&optional=false&system=keep&fractions=unicode&units=short&prepPosition=auto&spelling=us' --header 'Authorization: Bearer YOUR_API_KEY'
注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 食谱成分解析器 API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
将食谱成分行解析为数量、单位、项目、准备方法和过道,并带有过敏原关键字标记和单位转换
不 它们是该行单词的关键词匹配(黄油 酱油 胡桃等)它们无法看到产品的完整成分 “可能含有” 警告或交叉接触 所以请始终检查标签
美国九大主要食物过敏原:牛奶 鸡蛋 鱼类 甲壳类海鲜 干果 花生 小麦 大豆 和 芝麻 椰子不被标记为干果
是的:“2杯小麦面粉”与“2 cups all-purpose flour”得到相同的键。较不常见的名称可靠性较低,因此请检查置信度
无法放置的文本返回未解析状态且置信度下降;没有任何被创造
体积到重量仅适用于已知密度的物品(面粉 糖 黄油 牛奶以及大约60种其他物品);其他的回答转换为:false,理由是no_density
每个端点返回与食谱成分相关的结构化数据,包括解析的细节,如数量、单位、项目、准备方法、过道和过敏原标记。对于转换,它提供转换后的数量和单位,并在适用时提供密度信息
关键字段包括“数量”“单位”“项目”“准备”“过道”“过敏原标志”和“信心”对于转换,还包括“转换”“确切数量”和“密度”等附加字段,提供有关成分的全面细节
参数包括“line”用于单个或多个成分字符串 “amount”和“unit”用于转换 “to”用于指定目标单位 用户还可以使用“system”“fractions”和“prepPosition”等选项自定义请求
响应数据以JSON格式组织,每个成分行解析为不同的字段 每个响应包含一个“kind”字段,指示类型(成分、标题、空)以及结构化部分,以便于访问特定细节
端点提供有关成分解析、单位转换和成分行的结构化输出的信息 它们涵盖了测量、准备方法和过敏原识别等各个方面,满足不同的烹饪需求
用户可以通过访问特定字段来利用返回的数据进行食谱开发、饮食跟踪或成分替代。例如,“prep”字段可以指导烹饪方法,而“allergenFlags”有助于饮食考虑
典型的用例包括食谱应用开发 餐饮规划 饮食分析和食材替代 该API可以帮助厨师和家庭厨师准确测量和转换各种食谱中的食材
数据准确性通过一致的解析算法和预定义的常见成分密度表来保持 API还提供置信度分数,使用户能够评估解析结果的可靠性