{
"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'
After signing up, every developer is assigned a personal API access key, a unique combination of letters and digits provided to access to our API endpoint. To authenticate with the Recipe Ingredient Parser API simply include your bearer token in the Authorization header.
| Header | Description |
|---|---|
Authorization
|
Required
Should be Bearer access_key. See "Your API Access Key" above when you are subscribed.
|
No long-term commitment. Upgrade, downgrade, or cancel anytime.
Parse recipe ingredient lines into amount, unit, item, prep and aisle, with allergen keyword flags and unit conversion.
No. They are keyword matches on the line's words (butter, soy sauce, walnuts...). They can't see a product's full ingredients, "may contain" warnings or cross-contact, so always check labels.
The nine major US food allergens: milk, eggs, fish, crustacean shellfish, tree nuts, peanuts, wheat, soybeans and sesame. Coconut is not flagged as a tree nut.
Yes: "2 tazas de harina de trigo" gets the same key as "2 cups all-purpose flour". Uncommon names are less reliable, so check the confidence.
Text it could not place comes back in unparsed and the confidence drops; nothing is invented.
No. Volume to weight only works for items with a known density (flour, sugar, butter, milk and about 60 more); others answer converted: false with reason no_density.
Each endpoint returns structured data related to recipe ingredients, including parsed details like amount, unit, item, preparation method, aisle, and allergen flags. For conversion, it provides converted amounts and units, along with density information when applicable.
Key fields include "amount," "unit," "item," "prep," "aisle," "allergenFlags," and "confidence." For conversion, additional fields like "converted," "exactAmount," and "density" are included, providing comprehensive details about the ingredient.
Parameters include "line" for single or multiple ingredient strings, "amount" and "unit" for conversions, and "to" for specifying the target unit. Users can also customize requests with options like "system," "fractions," and "prepPosition."
The response data is organized in a JSON format, with each ingredient line parsed into distinct fields. Each response contains a "kind" field indicating the type (ingredient, heading, empty) and structured parts for easy access to specific details.
The endpoints provide information on ingredient parsing, unit conversion, and structured output for ingredient lines. They cover various aspects like measurement, preparation methods, and allergen identification, catering to diverse culinary needs.
Users can utilize the returned data by accessing specific fields for recipe development, dietary tracking, or ingredient substitution. For example, the "prep" field can guide cooking methods, while "allergenFlags" help in dietary considerations.
Typical use cases include recipe app development, meal planning, dietary analysis, and ingredient substitution. The API can assist chefs and home cooks in accurately measuring and converting ingredients for various recipes.
Data accuracy is maintained through consistent parsing algorithms and predefined density tables for common ingredients. The API also provides confidence scores, allowing users to gauge the reliability of parsed results.
To obtain your API key, first sign in to your account and navigate to the API you want to use. From the API's Pricing section, choose a plan and complete the subscription process. Once subscribed, return to the API page and you will see your API Access Key displayed at the top of the documentation page. You can use this key to authenticate your requests.
You can’t switch APIs during the free trial. If you subscribe to a different API, your trial will end and the new subscription will start as a paid plan.
The free trial lasts for 7 days and allows you to make up to 50 API requests.
No, the free trial is available only once, so we recommend using it on the API that interests you the most. Most of our APIs offer a free trial, but some may not include this option.
Yes. If the API offers a free trial, you will see a "Free 7-Day Trial" option in its Pricing section. The trial lasts for 7 days and allows up to 50 API requests, enabling you to evaluate the API before subscribing to a paid plan.
Zyla API Hub is like a big store for APIs, where you can find thousands of them all in one place. We also offer dedicated support and real-time monitoring of all APIs. Once you sign up, you can pick and choose which APIs you want to use. Just remember, each API needs its own subscription. But if you subscribe to multiple ones, you'll use the same key for all of them, making things easier for you.
You can monitor your API usage through the response headers included with every request:
x-zyla-api-calls-monthly-used: Shows the total number of API requests you have used during the current billing period.
x-zyla-api-calls-monthly-remaining: Shows the number of API requests you have remaining for the current billing period.
Yes, you can cancel your subscription at any time. Simply go to the Pricing section of the API you're subscribed to and click the "Unsubscribe" button.
Please note that upgrades, downgrades, and cancellations take effect immediately. Once your subscription is canceled, access to the service will end immediately, regardless of any remaining API calls in your quota.
Please have a look at our Refund Policy: https://zylalabs.com/terms#refund