DEV Community

Cover image for I got tired of scrolling past life stories, so I built a recipe extraction API.
Dani
Dani

Posted on

I got tired of scrolling past life stories, so I built a recipe extraction API.

You know the drill. You search for a banana bread recipe and land on a page
with 2,000 words about someone's grandmother, six pop-up ads, and a video
that follows you down the screen. The actual ingredients are somewhere
near the bottom.

I built recipescraper.pro to fix that for
myself: paste a recipe link, get just the recipe. Then I realized developers
building meal planners, grocery apps, or cooking bots have the same problem
at scale, so I turned the engine into an API.

What it does

Send it a link to a recipe page (or a YouTube cooking video) and you get
clean JSON back:

{
  "title": "JB's Banana Bread",
  "ingredients": [
    "2 1/4 cup plain flour / all-purpose flour",
    "1 1/4 tsp cinnamon powder",
    "1/3 cup vegetable oil"
  ],
  "instructions": "Preheat oven and line loaf pan. Whisk dry ingredients together...",
  "source_url": "https://www.recipetineats.com/banana-bread-recipe/"
}
Enter fullscreen mode Exit fullscreen mode

No HTML parsing on your side, and Celsius temperatures get converted to
Fahrenheit along the way.

Quick example (Python)

import requests

resp = requests.get(
    "https://recipe-extractor2.p.rapidapi.com/recipe",
    params={"url": "https://www.recipetineats.com/banana-bread-recipe/"},
    headers={
        "X-RapidAPI-Key": "your-key",
        "X-RapidAPI-Host": "recipe-extractor2.p.rapidapi.com",
    },
)
recipe = resp.json()
print(recipe["title"])
for item in recipe["ingredients"]:
    print("-", item)
Enter fullscreen mode Exit fullscreen mode

How it works under the hood

Most recipe sites embed structured schema.org Recipe data for Google.
The API reads that first, falls back to site-specific parsers, and for
YouTube videos it works from the video's captions and description.

Honest limitations

  • Some large publishers block automated requests, so a few sites won't import. When that happens you get a clear error explaining why.
  • Links need to point to a single recipe, not a category or list page.

Two companion APIs

If you need more than raw text:

  • Ingredient Parser: turns "2 1/2 cups flour, sifted" into structured quantity / unit / ingredient / notes.
  • Recipe Scaler: scales a recipe up or down and converts US ↔ metric with kitchen-friendly fractions.

Try it

There's a free plan, so you can test it with your own recipe links
without paying anything.

👉 Recipe Extractor on RapidAPI

I'd love feedback, especially recipe sites that don't parse well. Drop a
link in the comments and I'll take a look.

Top comments (0)