| 1 | Extract recipe data from the provided webpage content and return a single JSON object conforming to the schema.org `Recipe` format.
|
| 2 |
|
| 3 | Schema reference: https://schema.org/Recipe
|
| 4 |
|
| 5 | The input may contain HTML, extracted text, metadata, navigation, advertisements, comments, unrelated page content, or duplicated recipe information. Identify and extract only the actual recipe.
|
| 6 |
|
| 7 | Do not invent, infer, or add information that is not supported by the source. If the source does not contain enough information to identify a usable recipe, return an empty JSON object: `{}`.
|
| 8 |
|
| 9 | ## Extraction rules
|
| 10 |
|
| 11 | - Prefer the recipe author’s actual content over surrounding page text, SEO text, advertisements, comments, related-recipe links, or other unrelated page content.
|
| 12 | - Remove duplicated content caused by responsive layouts, print views, metadata, repeated page sections, or multiple representations of the same recipe.
|
| 13 | - Do not include navigation labels, button text, subscription prompts, promotional text, advertisements, comments, or unrelated commentary.
|
| 14 | - Do not treat labels such as `Step 1`, `Step 2`, `Method`, or `Instructions` as separate instruction steps when they contain no cooking action.
|
| 15 | - Instruction steps must contain actual instruction text.
|
| 16 | - Remove redundant step-number prefixes such as `Step 1:`, `1.`, `01 —`, or similar because step ordering is already represented by the JSON structure.
|
| 17 | - Preserve the meaning of useful instruction section headings, but never return them as standalone instruction steps.
|
| 18 | - Do not create empty instruction sections or empty instruction steps.
|
| 19 | - Preserve the original ordering of ingredients, ingredient sections, and instructions.
|
| 20 | - Keep ingredient quantities, units, preparation notes, alternatives, package sizes, and optional markers associated with the correct ingredient.
|
| 21 | - Extract preparation time, cooking time, total time, yield, servings, temperatures, ratings, and nutritional information only when explicitly present in the source.
|
| 22 | - Prefer explicit values from the main recipe over values inferred from prose, comments, related content, or calculations.
|
| 23 | - When several representations of the recipe exist, prefer complete structured recipe data and verify it against the visible recipe content.
|
| 24 |
|
| 25 | ## Recipe normalization
|
| 26 |
|
| 27 | Normalize the recipe before returning the JSON.
|
| 28 |
|
| 29 | - Convert US customary measurements to sensible metric measurements.
|
| 30 | - Prefer grams, kilograms, millilitres, litres, and degrees Celsius.
|
| 31 | - Preserve practical kitchen units such as teaspoons and tablespoons when they are clearer than very small metric quantities.
|
| 32 | - Preserve count-based quantities where appropriate, such as `2 eggs`, `1 onion`, `3 cloves garlic`, or `1 can tomatoes`.
|
| 33 | - Convert Fahrenheit cooking temperatures to Celsius.
|
| 34 | - Round conversions to sensible cooking values.
|
| 35 | - Avoid false precision such as `236.588 ml`, `28.3495 g`, or similar values that are impractical in a kitchen.
|
| 36 | - Use quantities that are practical to measure using normal kitchen equipment.
|
| 37 | - Do not change quantities that are already expressed using sensible metric or practical kitchen units.
|
| 38 | - Do not convert culturally meaningful, product-specific, package-based, or count-based units when conversion would make the ingredient less clear.
|
| 39 | - Keep all converted quantities internally consistent across ingredients and instructions.
|
| 40 | - When a converted quantity also appears in the instructions, use the same normalized value and unit in both places.
|
| 41 |
|
| 42 | ## Ingredient formatting and unit normalization
|
| 43 |
|
| 44 | Normalize every string in `recipeIngredient` before returning the JSON.
|
| 45 |
|
| 46 | Ingredient strings should be concise, natural, and suitable for display in a recipe application.
|
| 47 |
|
| 48 | ### Preferred unit output
|
| 49 |
|
| 50 | Use these exact abbreviations for metric units:
|
| 51 |
|
| 52 | - milligram → `mg`
|
| 53 | - gram → `g`
|
| 54 | - kilogram → `kg`
|
| 55 | - millilitre or milliliter → `ml`
|
| 56 | - litre or liter → `l`
|
| 57 |
|
| 58 | Use these exact abbreviations for common kitchen units:
|
| 59 |
|
| 60 | - teaspoon → `tsp`
|
| 61 | - tablespoon → `tbsp`
|
| 62 |
|
| 63 | Use lowercase abbreviations exactly as written.
|
| 64 |
|
| 65 | Do not:
|
| 66 |
|
| 67 | - add periods to unit abbreviations
|
| 68 | - pluralize abbreviated units
|
| 69 | - output long-form metric unit names when a preferred abbreviation exists
|
| 70 | - mix long-form and abbreviated versions of the same unit within one recipe
|
| 71 |
|
| 72 | Examples:
|
| 73 |
|
| 74 | - `200 millilitres whipping cream` → `200 ml whipping cream`
|
| 75 | - `390 grams chopped tomatoes` → `390 g chopped tomatoes`
|
| 76 | - `1 kilogram potatoes` → `1 kg potatoes`
|
| 77 | - `2 tablespoons tomato purée` → `2 tbsp tomato purée`
|
| 78 | - `1 teaspoon salt` → `1 tsp salt`
|
| 79 | - `500 milligrams saffron` → `500 mg saffron`
|
| 80 |
|
| 81 | ### Unit recognition
|
| 82 |
|
| 83 | Recognize and normalize common spelling variants, abbreviations, singular forms, plural forms, and regional variants.
|
| 84 |
|
| 85 | Normalize these forms:
|
| 86 |
|
| 87 | - `mg`, `milligram`, `milligrams` → `mg`
|
| 88 | - `g`, `gram`, `grams` → `g`
|
| 89 | - `kg`, `kilogram`, `kilograms` → `kg`
|
| 90 | - `ml`, `millilitre`, `millilitres`, `milliliter`, `milliliters` → `ml`
|
| 91 | - `l`, `litre`, `litres`, `liter`, `liters` → `l`
|
| 92 | - `tsp`, `teaspoon`, `teaspoons` → `tsp`
|
| 93 | - `tbsp`, `tbs`, `tablespoon`, `tablespoons` → `tbsp`
|
| 94 |
|
| 95 | ### Count-based and descriptive units
|
| 96 |
|
| 97 | Preserve concise count-based or descriptive units as words when they are appropriate, including:
|
| 98 |
|
| 99 | - egg
|
| 100 | - onion
|
| 101 | - clove
|
| 102 | - can
|
| 103 | - jar
|
| 104 | - bottle
|
| 105 | - package
|
| 106 | - packet
|
| 107 | - sachet
|
| 108 | - cube
|
| 109 | - bunch
|
| 110 | - bundle
|
| 111 | - sprig
|
| 112 | - slice
|
| 113 | - piece
|
| 114 | - stick
|
| 115 | - pinch
|
| 116 | - dash
|
| 117 |
|
| 118 | Use natural singular or plural grammar for these units.
|
| 119 |
|
| 120 | Examples:
|
| 121 |
|
| 122 | - `4 cloves garlic`
|
| 123 | - `2 cans chopped tomatoes`
|
| 124 | - `1 bunch parsley`
|
| 125 | - `3 slices bread`
|
| 126 | - `1 pinch salt`
|
| 127 |
|
| 128 | Do not rewrite natural count-based ingredients into artificial units such as `4 units garlic cloves`.
|
| 129 |
|
| 130 | ### Practical conversions
|
| 131 |
|
| 132 | Preserve teaspoons and tablespoons when they remain practical and clear.
|
| 133 |
|
| 134 | Examples:
|
| 135 |
|
| 136 | - `1 tbsp olive oil` should remain `1 tbsp olive oil`
|
| 137 | - `2 tsp paprika` should remain `2 tsp paprika`
|
| 138 | - Do not convert `1 tsp salt` into `5 ml salt`
|
| 139 | - Do not convert `2 tbsp oil` into `30 ml oil` unless the source or recipe context clearly benefits from metric volume
|
| 140 |
|
| 141 | For larger US customary quantities, convert to sensible metric units.
|
| 142 |
|
| 143 | Examples:
|
| 144 |
|
| 145 | - `1 cup water` → approximately `240 ml water`
|
| 146 | - `2 cups flour` → a sensible weight in grams only when the ingredient and conversion are unambiguous
|
| 147 | - `1 lb potatoes` → approximately `450 g potatoes`
|
| 148 | - `8 oz cream cheese` → approximately `225 g cream cheese`
|
| 149 |
|
| 150 | Do not perform weight-to-volume or volume-to-weight conversions when ingredient density is uncertain.
|
| 151 |
|
| 152 | ### Fractions and ranges
|
| 153 |
|
| 154 | - Preserve practical fractions for teaspoons and tablespoons when they are clear, such as `½ tsp` or `1½ tbsp`.
|
| 155 | - Decimal quantities may be used when they improve consistency, such as `0.5 kg`.
|
| 156 | - For converted metric values, prefer practical rounded numbers.
|
| 157 | - Preserve quantity ranges when the source gives a meaningful range, such as `2–3 tbsp water`.
|
| 158 | - Do not collapse a meaningful ingredient range unless the target schema requires a single value.
|
| 159 | - Do not create false precision when converting fractions.
|
| 160 |
|
| 161 | ### Ingredient text
|
| 162 |
|
| 163 | - Keep ingredient preparation notes associated with the ingredient.
|
| 164 | - Preserve meaningful qualifiers that define the ingredient, such as `smoked paprika`, `dark soy sauce`, `full-fat coconut milk`, or `self-raising flour`.
|
| 165 | - Preserve optional markers and serving notes, such as `optional`, `for garnish`, `for serving`, or `to taste`.
|
| 166 | - Do not move preparation notes into separate ingredients.
|
| 167 | - Do not split one source ingredient into several ingredient strings.
|
| 168 | - Do not merge separate source ingredients.
|
| 169 | - Preserve the original ingredient ordering.
|
| 170 |
|
| 171 | Examples:
|
| 172 |
|
| 173 | - `400 g tomatoes, drained`
|
| 174 | - `2 tbsp olive oil, plus extra for frying`
|
| 175 | - `1 large onion, finely chopped`
|
| 176 | - `½ tsp red pepper flakes, optional`
|
| 177 | - `salt and freshly ground black pepper, to taste`
|
| 178 |
|
| 179 | ## Instruction normalization
|
| 180 |
|
| 181 | Normalize `recipeInstructions` before returning the JSON.
|
| 182 |
|
| 183 | ### Required behavior
|
| 184 |
|
| 185 | - Every final `HowToStep` must contain at least one concrete action that a cook can perform.
|
| 186 | - Never return a `HowToStep` whose text consists only of a title, label, section heading, phase name, or step number.
|
| 187 | - Standalone headings must not appear as separate instruction entries.
|
| 188 | - Do not create separate steps merely to preserve the source page’s visual structure.
|
| 189 | - Do not preserve heading punctuation such as trailing colons.
|
| 190 | - The final instruction list must contain only meaningful cooking actions.
|
| 191 | - Preserve the original cooking order.
|
| 192 |
|
| 193 | Examples of forbidden heading-only steps include:
|
| 194 |
|
| 195 | - `Season Chicken`
|
| 196 | - `Sear the Chicken`
|
| 197 | - `Sauté Garlic`
|
| 198 | - `Add Lemon and Spices`
|
| 199 | - `Bake the Chicken`
|
| 200 | - `Garnish and Serve`
|
| 201 | - `To serve`
|
| 202 | - `Serving`
|
| 203 | - `For serving`
|
| 204 | - `Make the sauce`
|
| 205 | - `Prepare the filling`
|
| 206 | - `Method`
|
| 207 | - `Instructions`
|
| 208 | - `Step 1`
|
| 209 |
|
| 210 | ### Heading handling
|
| 211 |
|
| 212 | When a heading is immediately followed by an instruction:
|
| 213 |
|
| 214 | - Omit the heading if the following instruction is clear without it.
|
| 215 | - Merge the heading naturally into the following instruction if it adds useful context.
|
| 216 | - Never return the heading as its own `HowToStep`.
|
| 217 |
|
| 218 | Examples:
|
| 219 |
|
| 220 | Input:
|
| 221 |
|
| 222 | `Season Chicken:`
|
| 223 |
|
| 224 | `Pat the chicken thighs dry, then season with salt and pepper.`
|
| 225 |
|
| 226 | Output:
|
| 227 |
|
| 228 | `Pat the chicken thighs dry, then season with salt and pepper.`
|
| 229 |
|
| 230 | Input:
|
| 231 |
|
| 232 | `Make the sauce:`
|
| 233 |
|
| 234 | `Add the garlic, lemon juice, and stock to the pan.`
|
| 235 |
|
| 236 | Output:
|
| 237 |
|
| 238 | `To make the sauce, add the garlic, lemon juice, and stock to the pan.`
|
| 239 |
|
| 240 | Input:
|
| 241 |
|
| 242 | `Garnish and Serve:`
|
| 243 |
|
| 244 | `Top with parsley and lemon slices, then serve.`
|
| 245 |
|
| 246 | Output:
|
| 247 |
|
| 248 | `Top with parsley and lemon slices, then serve.`
|
| 249 |
|
| 250 | ### Step consolidation
|
| 251 |
|
| 252 | - Merge adjacent fragments when one contains only a heading and the next contains the actual instruction.
|
| 253 | - Merge very short preparatory actions into the following instruction when they are directly related and doing so improves readability.
|
| 254 | - Do not split a coherent cooking action into multiple steps merely because the source uses separate visual blocks.
|
| 255 | - Do not over-merge unrelated cooking actions into excessively long steps.
|
| 256 | - Prefer a concise sequence of meaningful steps over many tiny fragments.
|
| 257 | - The final instruction list should normally contain fewer steps than the raw source when the source separates headings from their instructions.
|
| 258 |
|
| 259 | ### Temperature and unit consistency
|
| 260 |
|
| 261 | - Use Celsius in instructions.
|
| 262 | - When the source gives both Fahrenheit and Celsius, retain only the sensible Celsius value unless both are needed for clarity.
|
| 263 | - Use normalized unit abbreviations consistently in instructions when quantities are repeated.
|
| 264 | - Do not use long-form metric unit names in instructions when the preferred abbreviation is clearer.
|
| 265 |
|
| 266 | Examples:
|
| 267 |
|
| 268 | - `Bake at 375°F (190°C)` → `Bake at 190°C`
|
| 269 | - `Add 200 millilitres cream` → `Add 200 ml cream`
|
| 270 | - `Stir in 2 tablespoons olive oil` → `Stir in 2 tbsp olive oil`
|
| 271 |
|
| 272 | ### Final instruction validation
|
| 273 |
|
| 274 | Before returning the JSON, inspect every instruction step.
|
| 275 |
|
| 276 | For each step, verify:
|
| 277 |
|
| 278 | 1. It contains a concrete action a cook can perform.
|
| 279 | 2. It contains more than only a heading, label, phase name, or step number.
|
| 280 | 3. It does not duplicate information already represented by another step.
|
| 281 | 4. It is not empty or whitespace-only.
|
| 282 | 5. It is not merely explanatory text without an actionable instruction.
|
| 283 | 6. Its quantities, units, and temperatures use the same normalized forms as the ingredients.
|
| 284 |
|
| 285 | If a step fails these checks, merge it with the appropriate adjacent step or remove it.
|
| 286 |
|
| 287 | ## Language rules
|
| 288 |
|
| 289 | - If the source recipe is not in English, translate all recipe text into English.
|
| 290 | - Translate the title, description, ingredient names, ingredient notes, section headings, instructions, yield text, and relevant recipe metadata.
|
| 291 | - Preserve proper nouns, brand names, geographical names, and culturally specific dish names when translating them would make the recipe less precise or less recognizable.
|
| 292 | - Use clear, natural cooking English rather than literal word-for-word translation.
|
| 293 | - After translation, apply all unit normalization and abbreviation rules to the translated recipe.
|
| 294 | - Do not leave untranslated unit names when a preferred English abbreviation exists.
|
| 295 |
|
| 296 | ## Image rules
|
| 297 |
|
| 298 | - If the source contains a clear primary image of the finished recipe, include it in the `image` field.
|
| 299 | - Prefer the main recipe hero image or the highest-quality image that clearly depicts the completed dish.
|
| 300 | - Ignore logos, author portraits, advertisements, icons, social media images, decorative backgrounds, unrelated gallery images, and tracking pixels.
|
| 301 | - Prefer image URLs found in recipe structured data, Open Graph metadata, Twitter Card metadata, or the main recipe content.
|
| 302 | - When multiple versions of the same image are available, choose the largest practical image rather than a thumbnail or low-resolution preview.
|
| 303 | - If the source provides an image array, select the best single primary image for the finished dish rather than returning multiple images.
|
| 304 | - The `image` field must contain either:
|
| 305 | - an absolute URL string, for example: `"https://example.com/images/recipe.jpg"`
|
| 306 | - or an `ImageObject` containing an absolute `url` property, for example: `{ "@type": "ImageObject", "url": "https://example.com/images/recipe.jpg" }`
|
| 307 | - Use only the `image` field.
|
| 308 | - Do not use `thumbnail`, `thumbnailUrl`, `contentUrl`, or other image fields.
|
| 309 | - Do not use relative URLs unless they can be resolved unambiguously against the webpage URL.
|
| 310 | - Do not use embedded base64 data, data URIs, blob URLs, local file paths, or temporary browser-generated URLs.
|
| 311 | - Do not invent, rewrite, guess, or repair an image URL.
|
| 312 | - If no suitable recipe image is present, omit the `image` field.
|
| 313 |
|
| 314 | ## Final validation
|
| 315 |
|
| 316 | Before returning the JSON, verify all of the following:
|
| 317 |
|
| 318 | 1. The output is a single valid schema.org `Recipe` JSON object.
|
| 319 | 2. Every ingredient from the source is represented once and in the original order.
|
| 320 | 3. Every recognized metric or kitchen unit uses the preferred abbreviation.
|
| 321 | 4. No ingredient uses long-form metric units such as `grams`, `millilitres`, or `kilograms`.
|
| 322 | 5. Ingredient quantities are practical and do not contain false precision.
|
| 323 | 6. Instruction quantities and temperatures are consistent with the normalized ingredients.
|
| 324 | 7. No instruction step consists only of a heading, label, or step number.
|
| 325 | 8. The image, when present, is a valid absolute URL or an `ImageObject` with an absolute `url`.
|
| 326 | 9. Unsupported fields are omitted rather than guessed.
|
| 327 | 10. No information has been invented.
|
| 328 |
|
| 329 | Correct any violations before returning the final JSON.
|
| 330 |
|
| 331 | ## Output rules
|
| 332 |
|
| 333 | - Return only the final JSON object.
|
| 334 | - Do not include Markdown, explanations, comments, warnings, or code fences.
|
| 335 | - Ensure the JSON is valid and syntactically complete.
|
| 336 | - Omit unsupported optional fields rather than guessing their values.
|
| 337 | - Use an empty object only when no usable recipe can be extracted.
|