Read a recipe
get_recipeFetches a complete recipe from the Wikibooks Cookbook, including ingredients, steps, and nutrition, and rescales ingredient amounts to any desired serving size.
Instructions
Read one Wikibooks Cookbook page: ingredients, equipment, steps, yield, time, difficulty, category, and the nutrition panel when the page carries one. 'id' is the page key from search_recipes or list_recipes, such as 'Cookbook:Spaghetti_alla_Carbonara'. A plain dish name is accepted and the Cookbook namespace is added. Pass 'servings' to rescale: a countable thing lands on the smallest share a cook can take out of one of it, which is a whole one where half of one cannot be measured out at all, such as an egg or a whole clove, a half where half of one pours, weighs or splits, such as a can or a packet, and a quarter where a knife or the size of the thing goes further, such as an onion, a slice of bread or a jar; a measurement is moved to a smaller unit before rounding so nothing disappears; and anything that cannot be multiplied is flagged instead. Read 'scaling' on each ingredient rather than doing the arithmetic yourself. A page that groups its ingredients by what they are for, such as a cake and its glaze, states that group on every line; a page that lists them flat states null. Two lines can read alike and belong to different parts of the dish. A page offering several versions of the dish states which one each line came from in 'variant'. Those lists replace one another: one of them is used, even where the procedure says to mix all the ingredients. A measurement the page writes as a conversion template is read as the value and the unit the page wrote, and the counterpart the template computes is left out: nothing here is converted between measuring systems. A line asking for as much as is needed and giving an indication in brackets, such as 'water as required (about 1 ½ cups)', states a quantity: the indication is scaled with the recipe and the wording in front of it is left as the page wrote it. A line offering an alternative in brackets, such as '4 eggs (or 8 egg yolks)', has both branches scaled, since a cook takes one of them. The Cookbook keeps recipes and the book's own chapter indexes in one namespace, and both write 'Ingredients' over a bulleted list. A page carrying no recipe box, no recipe banner and no procedure comes back with empty lists and a note: its bullets are links to other pages rather than things to buy. A heading owns what is nested under it and stops at the next heading of its own level, so a page carrying two recipes returns the first of each part and names the rest in a note. A page that only redirects elsewhere is followed to the page it points at, and 'id' and 'redirected_from' say which page was read. Rescaling needs a yield to scale from. A page that states none comes back as published, and says so. A page yielding no quantities is answered with 'factor' 1 and a note: an empty ingredient list was multiplied by nothing. 'author' and 'rating' are always null: the Cookbook is written collectively and carries no reader score. A time the page does not state is null, never zero, and never inferred from the steps. A page stating phases rather than a total, such as a fermentation and a cooking, publishes them in 'time_phases' with 'total_minutes' null: the phases measure different things and are never added. Pages are published under a licence that requires attribution; 'license' and 'url' carry what to credit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Page key from a search, such as 'Cookbook:Spaghetti_alla_Carbonara'. | |
| servings | No | Rescale the ingredients to this many servings. | |
| max_description_chars | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The page that was read, which differs from 'id' after a redirect. | |
| url | Yes | ||
| tips | Yes | Notes, tips and variations the page publishes. | |
| notes | Yes | ||
| steps | Yes | ||
| title | Yes | ||
| yield | Yes | ||
| author | Yes | Always null: the Cookbook is written collectively. | |
| energy | Yes | Energy per serving as the page states it. | |
| rating | Yes | Always null: the Cookbook carries no reader score. | |
| source | Yes | ||
| license | Yes | ||
| category | Yes | ||
| equipment | Yes | ||
| nutrition | Yes | ||
| time_text | Yes | The time in the page's own wording. | |
| categories | Yes | Every category the page files itself under. | |
| difficulty | Yes | ||
| revised_at | Yes | ||
| attribution | Yes | ||
| description | Yes | ||
| ingredients | Yes | ||
| time_phases | Yes | Each duration the page states, in the order it states them. | |
| cook_minutes | Yes | The phase the page labels as cooking. Null when it labels none. | |
| prep_minutes | Yes | The phase the page labels as preparation. Null when it labels none. | |
| total_minutes | Yes | The whole dish, stated only where the page states a total: one duration, or a phase the page itself calls the total. Null where the page states phases and no total, since a fermentation, a marinade or a rest is not cooking time and adding them would answer with a figure nobody published. Read 'time_phases' instead. | |
| difficulty_max | Yes | The scale 'difficulty' sits on. | |
| redirected_from | Yes | Redirect pages walked to reach this one. Empty when the page was reached directly. |